From ad09761c847a31c49ecb54b05d0037c3379936f5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 29 Jun 2018 17:00:35 +1200 Subject: Add 'comments' settings for sh filetype --- vim/after/ftplugin/sh/comments.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 vim/after/ftplugin/sh/comments.vim (limited to 'vim/after') 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<' -- cgit v1.2.3