aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-20 00:38:10 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-20 00:38:10 +1200
commit877b2f3593c52ae3c819b725f48271b93443a763 (patch)
tree3d63daccf3cbc061b5494a53cd2c6e6e161c6388 /vim
parent5cd1dbb216318f5210e0eccb958fdfffe74205f1 (diff)
downloaddotfiles-877b2f3593c52ae3c819b725f48271b93443a763.tar.gz
dotfiles-877b2f3593c52ae3c819b725f48271b93443a763.zip
Move Vim help indent rules to main indent ftplugin
I assumed Vim's runtime files included indent rules for :help files, but they don't.
Diffstat (limited to 'vim')
-rw-r--r--vim/after/indent/help.vim6
-rw-r--r--vim/indent/help.vim12
2 files changed, 12 insertions, 6 deletions
diff --git a/vim/after/indent/help.vim b/vim/after/indent/help.vim
deleted file mode 100644
index 449e3b4a..00000000
--- a/vim/after/indent/help.vim
+++ /dev/null
@@ -1,6 +0,0 @@
-" Use hard tabs for Vim help
-setlocal noexpandtab shiftwidth=0 tabstop=8
-if &softtabstop != -1
- let &softtabstop = &shiftwidth
-endif
-let b:undo_indent .= '|setlocal expandtab< shiftwidth< softtabstop< tabstop<'
diff --git a/vim/indent/help.vim b/vim/indent/help.vim
new file mode 100644
index 00000000..1edf64fb
--- /dev/null
+++ b/vim/indent/help.vim
@@ -0,0 +1,12 @@
+" Only do this when not done yet for this buffer
+if exists('b:did_indent')
+ finish
+endif
+let b:did_indent = 1
+
+" Use hard tabs for editing Vim help files
+setlocal noexpandtab shiftwidth=0 tabstop=8
+if &softtabstop != -1
+ let &softtabstop = &shiftwidth
+endif
+let b:undo_indent = 'setlocal expandtab< shiftwidth< softtabstop< tabstop<'