From 08f3a956d09f64acdcd79cf7b312b2416e60dfc6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 29 Jun 2018 20:52:13 +1200 Subject: Refine 'comments' ftplugins further Add 'formatoptions' flags 'o' and 'r' to all four configured types. This is especially important for block comments in PHP. --- vim/after/ftplugin/php/comments.vim | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 vim/after/ftplugin/php/comments.vim (limited to 'vim/after/ftplugin/php/comments.vim') diff --git a/vim/after/ftplugin/php/comments.vim b/vim/after/ftplugin/php/comments.vim new file mode 100644 index 00000000..9d233560 --- /dev/null +++ b/vim/after/ftplugin/php/comments.vim @@ -0,0 +1,22 @@ +" php/comments.vim: Set 'comments' and supporting 'formatoptions' for PHP + +" 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_php_comments') + finish +endif + +" Flag as loaded +let b:did_ftplugin_php_comments = 1 +let b:undo_ftplugin = b:undo_ftplugin + \ . '|unlet b:did_ftplugin_php_comments' + +" Set comment formats +setlocal comments=s1:/*,m:*,ex:*/,://,:# +setlocal formatoptions+=or +let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal comments< formatoptions<' -- cgit v1.2.3