diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 11:43:02 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 11:49:39 +1300 |
commit | 09b83b6e25431fe9f3122916156f97fb0cfc2b5b (patch) | |
tree | cb5b2a92706eaa099c193095983cc0086efa6f29 /vim/indent/tsv.vim | |
parent | Update <Leader>b mapping to use new mapping name (diff) | |
download | dotfiles-09b83b6e25431fe9f3122916156f97fb0cfc2b5b.tar.gz dotfiles-09b83b6e25431fe9f3122916156f97fb0cfc2b5b.zip |
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.
Diffstat (limited to 'vim/indent/tsv.vim')
-rw-r--r-- | vim/indent/tsv.vim | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/vim/indent/tsv.vim b/vim/indent/tsv.vim index a38e53e8..161fbbe3 100644 --- a/vim/indent/tsv.vim +++ b/vim/indent/tsv.vim @@ -1,6 +1,10 @@ -" Restore local indent settings to the global values -runtime indent/_GLOBAL.vim - " Manual indenting and literal tabs for TSVs setlocal noautoindent setlocal noexpandtab + +" Undo +if !exists('b:undo_indent') + let b:undo_indent = '' +endif +let b:undo_indent = b:undo_indent + \ . '|setlocal autoindent< expandtab<' |