aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-29 17:00:35 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-29 17:00:35 +1200
commitad09761c847a31c49ecb54b05d0037c3379936f5 (patch)
tree2c74fa91406c4b53177821a4e42c814664d8745e
parentClear 'commentstring' as well as 'comments' (diff)
downloaddotfiles-ad09761c847a31c49ecb54b05d0037c3379936f5.tar.gz
dotfiles-ad09761c847a31c49ecb54b05d0037c3379936f5.zip
Add 'comments' settings for sh filetype
-rw-r--r--vim/after/ftplugin/sh/comments.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/vim/after/ftplugin/sh/comments.vim b/vim/after/ftplugin/sh/comments.vim
new file mode 100644
index 00000000..0cb671e5
--- /dev/null
+++ b/vim/after/ftplugin/sh/comments.vim
@@ -0,0 +1,22 @@
+" sh/format.vim: Set 'comments' and 'formatoptions'
+
+" Don't load if running compatible or too old
+if &compatible || v:version < 700
+ finish
+endif
+
+" Don't load if already loaded
+if exists('b:did_ftplugin_sh_format')
+ finish
+endif
+
+" Flag as loaded
+let b:did_ftplugin_sh_format = 1
+let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|unlet b:did_ftplugin_sh_format'
+
+" Use trailing whitespace to denote continued paragraph
+setlocal comments=:#
+setlocal formatoptions-=t formatoptions+=cloqr
+let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|setlocal comments< formatoptions<'