From 1c26414e732b6548c0bf6433d6d47b832cca3e62 Mon Sep 17 00:00:00 2001 From: Hashrocket Workstation Date: Fri, 20 Nov 2020 14:14:14 -0600 Subject: [PATCH] Add :Driver command to re-source user specific rc Often we have idiosyncrasies in how we work. We encode these into our muscles and having to deal with pairing situations where you are out of sync with your pair is painful sometimes. By adding a convenience function around sourcing your own set of configurations, we might alleviate some of this frustration. --- .vimrc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 76a5719f..cb641db8 100644 --- a/.vimrc +++ b/.vimrc @@ -60,6 +60,20 @@ nnoremap pt :!prettier % " }}} +" 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() + +" this may no longer be required. if filereadable(expand('~/.vimrc.local')) source ~/.vimrc.local -endif +endif \ No newline at end of file