A shell configuration supporting bash, zsh, and fish.
I spend most of my time in Emacs on macOS. This configuration can work fine on its own, and it has a companion Emacs config.
Most scripts are written in bash because it is the lowest common denominator.
Included are configurations for some programs, such as:
- Bash
- Clojure
- Ctags
- Emacs (actually, the Emacs config lives in its own repo.)
- Git
- GnuPG
- Hammerspoon
- Karabiner Elements
- Python Pip
- Ruby Gem
- Tmux
- Zsh
Clone the repository and link files into the current user’s $HOME
directory.
git clone https://github.com/mnewt/dotfiles
dotfiles/bin/install-dotfiles
The install-dotfiles
script links
USAGE: install-dotfiles [-f] [-h] [-t] [-v] [ SOURCE_DIRECTORY ] Link dotfiles to $HOME. Directories listed in "child_dirs" have their children linked so as not to interfere with other things in those directories. SOURCE_DIRECTORY, if not specified, is /Users/mn/code/dotfiles. OPTIONS: -f Force overwrite of files or directories in $HOME -h Display this help message -t Test mode - don't make any changes -v Verbose - print each action
The install-dotfiles
script performs the following functions:
- Look for an
install-dotfiles-config
file in the root of theSOURCE_DIRECTORY
. Read variables from that file:child-dirs
: A list of directories that will be created.ignore
: A list of top level files/directories to be ignored (not linked).
- Create a soft link in
$HOME
to each file in the repo that (a) starts with a.
, and (b) isn’t listed inchild_dirs
. - For each directory in
child_dirs
, ensure the directory is created in$HOME
and then create links in that directory back to the corresponding files in the respective directory within the repo. - Remove any stale links in the destination locations.
In a previous iteration of this repo, I had a somewhat lengthy “bare repo” setup. This worked great, except for the fact that various LSP servers, notably bash-language-server, kept trying to index my entire home directory because it found a .git
root there. This was pretty annoying and is the main reason I decided to switch back to a linking model.
There are set of update scripts in the bin
directory to keep all the different software on a given system up to date.
The master update
script runs all of these in succession. Each script is smart enough to figure out whether the appropriate software is installed on the current machine.
These are some of the things which can be updated:
update-arch
: Arch Linux Pacmanupdate-clojure
: Clojure deps.edn and Leiningenupdate-debian
: Debian/Ubuntu Packagesupdate-dotfiles
: This dotfiles repoupdate-fish
: Fish Shell Packagesupdate-fonts
: macos Fontsupdate-macos
: macOS App Storeupdate-homebrew
: macOS Homebrewupdate-macports
: macOS MacPortsupdate-node
: Node.js Packagesupdate-perl
: Perl Librariesupdate-python
: Python Packagesupdate-ruby
: Ruby Gems
All the stuff in this repository is licensed to the public domain under the unlicense.