Skip to content

Instantly share code, notes, and snippets.

@graste
Created June 29, 2014 11:52
Show Gist options
  • Select an option

  • Save graste/ce0f5a4a0d97aeb5f219 to your computer and use it in GitHub Desktop.

Select an option

Save graste/ce0f5a4a0d97aeb5f219 to your computer and use it in GitHub Desktop.
.vimrc in working copy root folder based on .git location
" Load .vimrc in the base directory of a git repo, if it exists
let $git_vimrc= expand(system("echo -n $(git rev-parse --show-toplevel)/.vimrc"))
if filereadable($git_vimrc) && $git_vimrc != expand("$HOME/.vimrc")
source $git_vimrc
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment