aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-11 11:13:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-11 11:20:56 +1200
commit6b95e90cebb6837846e7a8a3d3efff41e6630b66 (patch)
treecea1c06380bcc879631e53d446496cec3897084c /vim
parentRefactor colorscheme logic a little (diff)
downloaddotfiles-6b95e90cebb6837846e7a8a3d3efff41e6630b66.tar.gz
dotfiles-6b95e90cebb6837846e7a8a3d3efff41e6630b66.zip
Set up custom ftplugin for plain text files
Diffstat (limited to 'vim')
-rw-r--r--vim/ftplugin/text.vim14
-rw-r--r--vim/vimrc3
2 files changed, 16 insertions, 1 deletions
diff --git a/vim/ftplugin/text.vim b/vim/ftplugin/text.vim
new file mode 100644
index 00000000..a5dc810f
--- /dev/null
+++ b/vim/ftplugin/text.vim
@@ -0,0 +1,14 @@
+" 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')
+ finish
+endif
+let b:did_ftplugin = 1
+
+" Set comment metacharacters
+setlocal comments+=fb:- " Dashed lists
+setlocal comments+=fb:* " Bulleted lists
+setlocal comments+=n:> " Mail quotes
+let b:undo_ftplugin = 'setlocal comments<'
diff --git a/vim/vimrc b/vim/vimrc
index 6b85ea37..17282ce1 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -82,8 +82,9 @@ if exists('+breakindent')
set breakindent
endif
-" Clear default 'comments' value, let the filetype handle it
+" Clear default 'comments' and 'commentstring', filetype to handle
set comments=
+set commentstring=
" Add completion options
if exists('+completeopt')