direnv,vim: add 'add_extra_vimrc'
This commit is contained in:
parent
b644866ff9
commit
b42920e007
8
.config/direnv/direnvrc
Normal file
8
.config/direnv/direnvrc
Normal file
@ -0,0 +1,8 @@
|
||||
# as per https://github.com/direnv/direnv/wiki/Vim
|
||||
add_extra_vimrc() {
|
||||
local extravim="$(find_up .vimrc)"
|
||||
if [ -n "$extravim" ]; then
|
||||
echo "Adding extra .vimrc: ${extravim}"
|
||||
path_add EXTRA_VIM $extravim
|
||||
fi
|
||||
}
|
@ -562,3 +562,10 @@ imap a <M-A>
|
||||
|
||||
nnoremap <Leader>ve :e $MYVIMRC<CR>
|
||||
nnoremap <Leader>vr :source $MYVIMRC<CR>
|
||||
|
||||
" as per https://github.com/direnv/direnv/wiki/Vim
|
||||
if exists("$EXTRA_VIM")
|
||||
for path in split($EXTRA_VIM, ':')
|
||||
exec "source ".path
|
||||
endfor
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user