diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-09 14:27:36 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-09 14:27:36 +1200 |
commit | a43a2aca36bfe1a8a8b60ce604d7a89a2fddc08f (patch) | |
tree | 0faebf308f7a5b118cf825ce785d687cae7c2c87 | |
parent | Use more idiomatic approach to get() defaulting (diff) | |
download | dotfiles-a43a2aca36bfe1a8a8b60ce604d7a89a2fddc08f.tar.gz dotfiles-a43a2aca36bfe1a8a8b60ce604d7a89a2fddc08f.zip |
Test $MYVIM is defined and non-empty for defining
-rw-r--r-- | vim/vimrc | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Fri, 08 May 2020 11:31:29 UTC +" Last updated: Sat, 09 May 2020 01:47:32 UTC " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, @@ -346,8 +346,12 @@ augroup END " saves restarting Vim or running the :source command manually, which I almost " always want to do after changing my vimrc file anyway. " -autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc +autocmd vimrc BufWritePost $MYVIMRC \ ReloadVimrc +if $MYVIM !=# '' + autocmd vimrc BufWritePost $MYVIM/vimrc + \ ReloadVimrc +endif " If Vim is new enough (v7.0.187) to support the ##SourceCmd event for " automatic command hooks, we'll also apply a hook for that event to catch @@ -359,6 +363,10 @@ autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc if exists('##SourceCmd') autocmd vimrc SourceCmd $MYVIMRC,$MYVIM/vimrc \ ReloadVimrc + if $MYVIM !=# '' + autocmd vimrc SourceCmd $MYVIM/vimrc + \ ReloadVimrc + endif endif " For spelling, use New Zealand English by default, but later on we’ll |