aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-11-29 19:52:37 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-29 23:18:49 +1300
commiteb97e0710ca1dee99cba8f5c44d80b84b0310a62 (patch)
treec9e0d7c952ed82b187aeeaa43201c08fbfeebd0e
parent2678c74c7df62abd2651072933580119d85c8b12 (diff)
downloaddotfiles-eb97e0710ca1dee99cba8f5c44d80b84b0310a62.tar.gz
Wrap Vim gitcommit autocmd clear in :execute
Noticed that my b:undo_ftplugin script for this filetype was only getting halfway through its work, and stopping at this command. From `:help autocmd`: > Note: The ":autocmd" command can only be followed by another command when the > '|' appears before {cmd}. This works: > :augroup mine | au! BufRead | augroup END > But this sees "augroup" as part of the defined command: > :augroup mine | au! BufRead * | augroup END > :augroup mine | au BufRead * set tw=70 | augroup END > Instead you can put the group name into the command: > :au! mine BufRead * > :au mine BufRead * set tw=70 > Or use :execute: > :augroup mine | exe "au! BufRead *" | augroup END > :augroup mine | exe "au BufRead * set tw=70" | augroup END
-rw-r--r--vim/after/ftplugin/gitcommit.vim2
1 files changed, 1 insertions, 1 deletions
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 2dc5fa37..0ba80c92 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -14,7 +14,7 @@ if has('autocmd') && exists('+cursorcolumn')
autocmd CursorMoved,CursorMovedI <buffer>
\ let &l:colorcolumn = gitcommit#CursorColumn()
augroup END
- let b:undo_ftplugin .= '|autocmd! gitcommit'
+ let b:undo_ftplugin .= '|execute ''autocmd! gitcommit'''
\ . '|augroup! gitcommit'
endif