aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-11 11:33:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-11 11:33:54 +1200
commit0001558ea2893adf47e1df009ab0ca51f8b4cea8 (patch)
tree68f603573eabd1dfffe6916e207cb56be2e8c0c2
parent2087532351e32df801f4f2efc6f9cd0fdc425454 (diff)
downloaddotfiles-0001558ea2893adf47e1df009ab0ca51f8b4cea8.tar.gz
Replace text.vim ftplugin entirely
This makes more sense than dancing around the potential availability of the stock one.
-rw-r--r--vim/after/ftplugin/text.vim5
-rw-r--r--vim/ftplugin/text.vim13
2 files changed, 8 insertions, 10 deletions
diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim
deleted file mode 100644
index cda2891c..00000000
--- a/vim/after/ftplugin/text.vim
+++ /dev/null
@@ -1,5 +0,0 @@
-" Spellcheck documents we're actually editing (not just viewing)
-if has('spell') && &modifiable && !&readonly
- setlocal spell
- let b:undo_ftplugin .= '|setlocal spell<'
-endif
diff --git a/vim/ftplugin/text.vim b/vim/ftplugin/text.vim
index a5dc810f..362dfb69 100644
--- a/vim/ftplugin/text.vim
+++ b/vim/ftplugin/text.vim
@@ -1,8 +1,5 @@
-" The 'text' filetype was only added in v7.4.365, so anything older than this
-" requires our own filetype plugin to prevent the b:undo_ftplugin extensions
-" in after/ftplugin/text.vim from panicking.
-if v:version > 704
- \ || v:version == 703 && has('patch365')
+" Only do this when not yet done for this buffer
+if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
@@ -12,3 +9,9 @@ setlocal comments+=fb:- " Dashed lists
setlocal comments+=fb:* " Bulleted lists
setlocal comments+=n:> " Mail quotes
let b:undo_ftplugin = 'setlocal comments<'
+
+" Spellcheck documents we're actually editing (not just viewing)
+if has('spell') && &modifiable && !&readonly
+ setlocal spell
+ let b:undo_ftplugin .= '|setlocal spell<'
+endif