diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-29 19:52:37 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-11-29 23:18:49 +1300 |
commit | eb97e0710ca1dee99cba8f5c44d80b84b0310a62 (patch) | |
tree | c9e0d7c952ed82b187aeeaa43201c08fbfeebd0e /vim | |
parent | Merge branch 'release/v1.78.0' into develop (diff) | |
download | dotfiles-eb97e0710ca1dee99cba8f5c44d80b84b0310a62.tar.gz dotfiles-eb97e0710ca1dee99cba8f5c44d80b84b0310a62.zip |
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
Diffstat (limited to 'vim')
-rw-r--r-- | vim/after/ftplugin/gitcommit.vim | 2 |
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 |