Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :Driver command to re-source user specific rc #96

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .vimrc
Original file line number Diff line number Diff line change
@@ -60,6 +60,20 @@ nnoremap <leader>pt :!prettier %<CR>

" }}}

" Allow different drivers to quickly re-source their personal configurations
" for ease of navigation and code manipulation
fu! Driver(name)
let fname='~/.vimrc.' . a:name
if filereadable(expand(fname))
exec "source " . fname
else
echomsg "Cannot read configuration " . fname . ", please ensure that you have your developer config present on this machine."
endif
endfu

:command! -nargs=1 Driver :call Driver(<q-args>)

" this may no longer be required.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .local files are widely used so I wouldn't get rid of it.

if filereadable(expand('~/.vimrc.local'))
source ~/.vimrc.local
endif
endif