Skip to content
forked from necolas/dotfiles

OS X dotfiles: bash, git, vim, etc.

License

Notifications You must be signed in to change notification settings

KnBrckr/dotfiles

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotfiles (Ken Brucker)

My OS X dotfiles.

How to install

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.

How to update

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

Features

Oh My Zsh

Uses Oh My Zsh! for zsh shell configuration

Automatic software installation

Vim plugins:

Neovim

Thesaurus is retrieved from zip file found at vim/vim#629 (comment)

FZF Notes

After install, use :call fzf#install() to update fzf binary to latest if necessary

Custom OS X defaults

Custom OS X settings can be applied during the dotfiles process. They can also be applied independently by running the following command:

% osxdefaults

Local/private Bash and Vim configuration

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"

Adding new git submodules

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 git submodules

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 git submodules

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.

Acknowledgements

Inspiration and code was taken from many sources, including:

About

OS X dotfiles: bash, git, vim, etc.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 50.2%
  • Shell 34.0%
  • Lua 8.2%
  • Ruby 6.1%
  • Perl 0.6%
  • Python 0.5%
  • Awk 0.4%