My OS X dotfiles.
The installation step requires the XCode Command Line
Tools and may overwrite existing
dotfiles in your HOME, .vim
and other directories.
% bash -c "$(curl -fsSL raw.github.com/KnBrckr/dotfiles/master/bin/dotfiles)"
N.B. If you wish to fork this project and maintain your own dotfiles, you must
substitute my username for your own in the above command and the 2 variables
found at the top of the bin/dotfiles
script.
You should run the update when:
- You want to pull changes from the remote repository.
- You want to update Homebrew formulae, Node and other packages.
Run the dotfiles command:
% dotfiles
Options:
Option | Description |
---|---|
-h , --help |
Help |
-l , --list |
List of additional applications to install |
--no-packages |
Suppress package updates |
--no-sync |
Suppress pulling dotfiles from report repository |
Uses Oh My Zsh! for zsh shell configuration
Vim plugins:
- editorconfig-vim
- fzf
- fzf.vim
- gutentags_plus
- lightline
- nerdtree
- nerdtree-git-plugin
- papercolor-theme
- splitjoin
- tcomment
- vim-abolish
- vim-colors-solarized
- vim-devicons
- vim-dispatch
- Used by cmake4vim to launch async shells
- vim-fugitive Git management
- vim-gutentags
- Requires ctags support such as exuberant-ctags.
- gtags-cscope job failed - chmod +x vim-gutentags/plat/unix/*
- vim-kitty Kitty terminal emulator configuration highlighting
- vim-kitty-navigator VIM +
Kitty navigation
- Requires copying of pass_keys.py and neighboring_window.py scripts to ~/.config/kitty/
- vim-snippets
- vim-tmux-navigator
Thesaurus is retrieved from zip file found at vim/vim#629 (comment)
After install, use :call fzf#install() to update fzf binary to latest if necessary
Custom OS X settings can be applied during the dotfiles
process. They can
also be applied independently by running the following command:
% osxdefaults
Any special-case Vim directives local to a machine should be stored in a
~/.vimrc.local
file on that machine. The directives will then be automatically
imported into your master .vimrc
.
Any private and custom commands and configuration should be placed in a
~/.shell_profile.local
file. This file will not be under version control or
committed to a public repository. If ~/.shell_profile.local
exists, it will be
sourced for inclusion in bash_profile
or zshprofile
.
~/.gitconfig
is updated as a part of dotfiles execution to set author details
based on settings for VCS_AUTHOR_NAME
an VCS_AUTHOR_EMAIL
. It includes
$DOTFILES/git/gitconfig
so changes made to dotfiles gitconfig are automatically
picked up with no updating required.
Here is an example ~/.shell_profile.local
:
# PATH exports
PATH=$PATH:~/.gem/ruby/1.8/bin
export PATH
# Git credentials
# Not under version control to prevent people from
# accidentally committing with your details
VCS_AUTHOR_NAME="John Doe"
VCS_AUTHOR_EMAIL="jd@example.com"
# Done in dotfiles when putting config file in place
# Set the credentials (modifies ~/.gitconfig)
# git config --global user.name "$VCS_AUTHOR_NAME"
# git config --global user.email "$VCS_AUTHOR_EMAIL"
# Aliases
alias code="cd ~/Code"
If you want to add more git submodules, e.g., Vim plugins to be managed by pathogen, then follow these steps while in the root of the superproject.
# Add the new submodule
git submodule add --depth 1 --name submodule-name https://example.com/remote/path/to/repo.git vim/pack/vendor/opt/submodule-name
# Initialize and clone the submodule
git submodule update --depth 1 --init
# Stage the changes
git add vim/bundle/one-submodule
# Include module in load at startup if desired
vim ~/.vimrc
# Commit the changes
git commit -m "Add a new submodule: submodule-name"
Updating packages:
git submodule update --depth 1 --remote --merge
git commit
Updating individual submodules within the superproject:
# Change to the submodule directory
cd vim/bundle/one-submodule
# Checkout the desired branch (of the submodule)
git checkout master
# Pull from the tip of master (of the submodule - could be any sha or pointer)
git pull origin master
# Go back to main dotfiles repo root
cd ../../..
# Stage the submodule changes
git add vim/bundle/one-submodule
# Commit the submodule changes
git commit -m "Update submodule 'one-submodule' to the latest version"
# Push to a remote repository
git push origin master
Removing individual submodules within the superproject:
cd .dotfiles
git submodule deinit vim/pack/vendor/start/<package>
git rm vim/pack/vendor/start/<package>
rm -Rf .git/modules/vim/pack/vendor/start/<package>
git commit
Now, if anyone updates their local repository from the remote repository, then
using git submodule update
will update the submodules (that have been
initialized) in their local repository. N.B This will wipe away any local
changes made to those submodules.
Inspiration and code was taken from many sources, including:
- Moving to zsh
- @nicholas (Nicolas Gallagher) https://github.com/necolas/dotfiles
- @mathiasbynens (Mathias Bynens) https://github.com/mathiasbynens/dotfiles
- @tejr (Tom Ryder) https://github.com/tejr/dotfiles
- @gf3 (Gianni Chiappetta) https://github.com/gf3/dotfiles
- @cowboy (Ben Alman) https://github.com/cowboy/dotfiles
- @alrra (Cãtãlin Mariş) https://github.com/alrra/dotfiles