A place to store my shell setup and dotfiles. This repo should be all I need to setup a new or cloned box.
-
Install Homebrew
-
Clone this repo to a suitable local location. That could be directly under
$HOME
or some other, less prominent, location. -
Run this repo's setup script:
./setup.sh
-
Add any required language specific modules to
.zpreztorc
manually (for now), i.e.. . . # Set the Prezto modules to load (browse modules). # The order matters. zstyle ':prezto:load' pmodule \ 'environment' \ . . . 'prompt' \ 'git' \ 'python' \ 'node' \ 'ruby'
-
There is an issue where tmux modifies
$PATH
when using zsh!Solution: Modify
/etc/zprofile
to the following:# system-wide environment settings for zsh(1) if [ -x /usr/libexec/path_helper ]; then if [ -z "$TMUX" ]; then eval `/usr/libexec/path_helper -s` fi fi
This repo's setup command installs stow, which is a a symlink farm manager. I use it to backup dotfiles and place them in version control.
It's important to distinguish between dotfiles and 'hidden working/cache files/directories' that just happen to be sitting in the $HOME
directory. The later should not be placed in version control! For example, whilst the dotfile .tmux.conf
holds customizable configuration data for a tmux
install (and may therefore be recorded and monitored in version control), its related .tmux
directory is used as a cache and will simply be populated to the requirements of the .tmux.conf
configuration file at runtime.
-
Having established an app's actual dotfile(s), in order to use
stow
:-
Create a directory in this repo's
dotfiles
directory, named after the dotfile's application:# i.e. # e.g. dotfiles/appname/ dotfiles/tmux/
-
Move the dotfile(s) from the
$HOME
directory to the directory created in step 1 -
Run the following command to get
stow
to symlink the dotfile(s) from the new location (in version control)!stow appname
-
Add the appname to
bin/dotfiles.sh
to have its dotfile(s) automatically installed from version control whenever a new setup is run. -
git commit
, etc
-
-
To remove 'stow control' for an application's dotfile(s):
-
Run the following command to remove associated symlink(s)
stow --delete appname
-
Move the file(s) from the application's corresponding directory (in version control - see step 1 above) back to their original location, i.e the
$HOME
directory
-
Note: stow
will never overwrite a file that it hasn't previously created, or that already exists, so it's fairly safe to rerun any of the following commands at any time:
# for dotfile(s) in version control already...
#
# to `stow` a single application's dotfile(s)
# (use the -v flag to see what's going on)
stow -v appname
# or for multiple applications
stow -v --stow app1name [app2name [app3name]]
# to remove from stow, just use the --delete flag
stow -v --delete app1name [app2name [app3name]]
# don't forget to copy/move the dotfile(s) back to $HOME manually!
- Daniel Miessler: configuration script for bootstrapping a new box
- Xero: dotfile solution