From 09b83b6e25431fe9f3122916156f97fb0cfc2b5b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 11:43:02 +1300 Subject: Use b:undo variables correctly Setting or adding to b:undo_indent and b:undo_ftplugin variables, which I only learned about just now, allows me to avoid the _GLOBAL.vim hack and remove some files from both vim/indent/ and vim/ftplugin/. These variables aren't subjected to :execute automatically in anything older than Vim 7.0, but I don't think that's too much of a concern as the only real reason they're needed are for changing filetypes in the same buffer, which doesn't happen that often anyway. --- vim/ftplugin/sh.vim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'vim/ftplugin/sh.vim') diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim index 8990f0fa..85251aa1 100644 --- a/vim/ftplugin/sh.vim +++ b/vim/ftplugin/sh.vim @@ -48,3 +48,10 @@ endif nnoremap \ l \ :execute b:lint + +" Undo +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +endif +let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal keywordprg<' -- cgit v1.2.3