diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:26:26 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 14:26:26 +1300 |
commit | 0c1e3e08ed50f59c9d2d82ea27d74c1282f7bef4 (patch) | |
tree | a923ed9eb4d1f5ea9a98dd55aa57a86abfb6186b | |
parent | Revert dynamic filetype indent configuration (diff) | |
download | dotfiles-0c1e3e08ed50f59c9d2d82ea27d74c1282f7bef4.tar.gz dotfiles-0c1e3e08ed50f59c9d2d82ea27d74c1282f7bef4.zip |
Clear autocommands in ftdetect augroups
Clear autocommand definitions for each of the ftdetect augroups with
`autocmd!` as the first command within them. This avoids ending up with
doubled-up autocmd definitions if the configuration file is re-sourced,
and is pretty standard good Vimscript practice.
It's done correctly elsewhere in my Vim configuration, for example in
config/undo.vim, but it's been unintentionally omitted here.
-rw-r--r-- | vim/ftdetect/muttrc.vim | 1 | ||||
-rw-r--r-- | vim/ftdetect/sh.vim | 1 | ||||
-rw-r--r-- | vim/ftdetect/xdefaults.vim | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/vim/ftdetect/muttrc.vim b/vim/ftdetect/muttrc.vim index ff3776b5..1800aff9 100644 --- a/vim/ftdetect/muttrc.vim +++ b/vim/ftdetect/muttrc.vim @@ -1,5 +1,6 @@ " Add automatic commands to detect .muttrc files augroup dfmuttrc + autocmd! autocmd BufNewFile,BufRead \ **/.dotfiles/mutt/muttrc.d/*.rc diff --git a/vim/ftdetect/sh.vim b/vim/ftdetect/sh.vim index f2bc0df2..dce776cf 100644 --- a/vim/ftdetect/sh.vim +++ b/vim/ftdetect/sh.vim @@ -1,5 +1,6 @@ " Add automatic commands to choose shell flavours based on filename pattern augroup dfsh + autocmd! " Names/paths of things that are Bash shell script autocmd BufNewFile,BufRead diff --git a/vim/ftdetect/xdefaults.vim b/vim/ftdetect/xdefaults.vim index f0ee7b81..bda1161a 100644 --- a/vim/ftdetect/xdefaults.vim +++ b/vim/ftdetect/xdefaults.vim @@ -1,5 +1,6 @@ " Add automatic commands to find Xresources subfiles augroup dfxdefaults + autocmd! autocmd BufNewFile,BufRead \ **/.Xresources.d/* \ setlocal filetype=xdefaults |