diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-29 20:52:13 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-29 20:52:13 +1200 |
commit | 08f3a956d09f64acdcd79cf7b312b2416e60dfc6 (patch) | |
tree | 73b5b9a047c6b8bd5f69ec0e378ed66c789ca813 /vim/after/ftplugin/sed | |
parent | Remove 'formatoptions' reset in ftplugins (diff) | |
download | dotfiles-08f3a956d09f64acdcd79cf7b312b2416e60dfc6.tar.gz dotfiles-08f3a956d09f64acdcd79cf7b312b2416e60dfc6.zip |
Refine 'comments' ftplugins further
Add 'formatoptions' flags 'o' and 'r' to all four configured types. This
is especially important for block comments in PHP.
Diffstat (limited to 'vim/after/ftplugin/sed')
-rw-r--r-- | vim/after/ftplugin/sed/comments.vim | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vim/after/ftplugin/sed/comments.vim b/vim/after/ftplugin/sed/comments.vim index 4e779d67..53b1524c 100644 --- a/vim/after/ftplugin/sed/comments.vim +++ b/vim/after/ftplugin/sed/comments.vim @@ -1,4 +1,4 @@ -" sed/comments.vim: Set 'comments' for sed +" sed/comments.vim: Set 'comments' and supporting 'formatoptions' for sed " Don't load if running compatible or too old if &compatible || v:version < 700 @@ -6,16 +6,17 @@ if &compatible || v:version < 700 endif " Don't load if already loaded -if exists('b:did_ftplugin_sed_format') +if exists('b:did_ftplugin_sed_comments') finish endif " Flag as loaded -let b:did_ftplugin_sed_format = 1 +let b:did_ftplugin_sed_comments = 1 let b:undo_ftplugin = b:undo_ftplugin - \ . '|unlet b:did_ftplugin_sed_format' + \ . '|unlet b:did_ftplugin_sed_comments' -" Use trailing whitespace to denote continued paragraph +" Set comment formats setlocal comments=:# +setlocal formatoptions+=or let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal comments<' + \ . '|setlocal comments< formatoptions<' |