Skip to content

mccallumjack/dotfiles

Repository files navigation

These Dotfiles were originally a fork from ThoughtBot - https://github.com/thoughtbot/dotfiles

To install:

  1. Clone the repo locally

  2. Run the following:

    brew tap thoughtbot/formulae brew install rcm

  3. Install the dotfiles:

    env RCRC=$HOME/dotfiles/rcrc rcup

After the initial installation, you can run rcup without the one-time variable RCRC being set (rcup will symlink the repo's rcrc to ~/.rcrc for future runs of rcup).

This command will create symlinks for config files in your home directory. Setting the RCRC environment variable tells rcup to use standard configuration options:

  • Exclude the README.md and LICENSE files, which are part of the dotfiles repository but do not need to be symlinked in.
  • Give precedence to personal overrides which by default are placed in ~/dotfiles-local

You can safely run rcup multiple times to update:

rcup

You should run rcup after pulling a new version of the repository to symlink any new files in the repository.

zsh Configurations

Additional zsh configuration can go under the ~/.zsh/configs directory. This has two special subdirectories: pre for files that must be loaded first, and post for files that must be loaded last.

For example, ~/.zsh/configs/pre/virtualenv makes use of various shell features which may be affected by your settings, so load it first:

# Load the virtualenv wrapper
. /usr/local/bin/virtualenvwrapper.sh

Setting a key binding can happen in ~/.zsh/configs/keys:

# Grep anywhere with ^G
bindkey -s '^G' ' | grep '

Some changes, like chpwd, must happen in ~/.zsh/configs/post/chpwd:

# Show the entries in a directory whenever you cd in
function chpwd {
  ls
}

This directory is handy for combining dotfiles from multiple teams; one team can add the virtualenv file, another keys, and a third chpwd.

The ~/.zshrc.local is loaded after ~/.zsh/configs.

vim Configurations

Similarly to the zsh configuration directory as described above, vim automatically loads all files in the ~/.vim/plugin directory. This does not have the same pre or post subdirectory support that our zshrc has.

This is an example ~/.vim/plugin/c.vim. It is loaded every time vim starts, regardless of the file name:

# Indent C programs according to BSD style(9)
set cinoptions=:0,t0,+4,(4
autocmd BufNewFile,BufRead *.[ch] setlocal sw=0 ts=8 noet

Releases

No releases published

Packages

No packages published