diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-08 20:55:50 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-08 20:55:50 +1200 |
commit | d7748a0d665ac099b498cc3f2b21215c601463d0 (patch) | |
tree | 885849949f683ca057099b296daf3b460247e0ad | |
parent | Rework a sentence (diff) | |
download | dotfiles-d7748a0d665ac099b498cc3f2b21215c601463d0.tar.gz dotfiles-d7748a0d665ac099b498cc3f2b21215c601463d0.zip |
Adjust layout and fully document vimrc reload hook
-rw-r--r-- | vim/vimrc | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -46,6 +46,23 @@ if !exists('$MYVIM') && &runtimepath !=# '' endif +" Create a 'vimrc' automatic command hook group, if it already exists, and +" clear away any automatic command hooks already defined within it if it does, +" so that we don't end up collecting multiple copies of the hooks configured +" in the rest of this file if it's reloaded. +" +augroup vimrc + autocmd! +augroup END + +" If this file or the vimrc stub that calls it is written to by Vim, reload +" the stub vimrc and thereby the main vimrc, so that our changes apply +" immediately in the current editing session. This often makes broken changes +" immediately apparent. +" +autocmd vimrc BufWritePost $MYVIMRC,$MYVIM/vimrc + \ source $MYVIMRC + " Global indent settings go here. Filetype indent plugins will often refine " these settings for individual buffers. For example, 'expandtab' is not " appropriate for Makefiles, nor for the Go programming language. For @@ -683,10 +700,3 @@ inoreabbrev wrnog wrong inoreabbrev Fielding Feilding inoreabbrev THe the inoreabbrev THere there - -" Reload this file when I save it, modified or nay -augroup vimrc - autocmd! - autocmd BufWritePost $MYVIMRC,$MYVIM/vimrc - \ source $MYVIMRC -augroup END |