aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vim/after/ftplugin/awk/comments.vim13
-rw-r--r--vim/after/ftplugin/php/comments.vim22
-rw-r--r--vim/after/ftplugin/sed/comments.vim13
-rw-r--r--vim/after/ftplugin/sh/comments.vim7
4 files changed, 40 insertions, 15 deletions
diff --git a/vim/after/ftplugin/awk/comments.vim b/vim/after/ftplugin/awk/comments.vim
index 5f91bef2..caf11679 100644
--- a/vim/after/ftplugin/awk/comments.vim
+++ b/vim/after/ftplugin/awk/comments.vim
@@ -1,4 +1,4 @@
-" awk/comments.vim: Set 'comments' for AWK
+" awk/comments.vim: Set 'comments' and supporting 'formatoptions' for AWK
" 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_awk_format')
+if exists('b:did_ftplugin_awk_comments')
finish
endif
" Flag as loaded
-let b:did_ftplugin_awk_format = 1
+let b:did_ftplugin_awk_comments = 1
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|unlet b:did_ftplugin_awk_format'
+ \ . '|unlet b:did_ftplugin_awk_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<'
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<'
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<'
diff --git a/vim/after/ftplugin/sh/comments.vim b/vim/after/ftplugin/sh/comments.vim
index 247fa2b0..97e8adc9 100644
--- a/vim/after/ftplugin/sh/comments.vim
+++ b/vim/after/ftplugin/sh/comments.vim
@@ -1,4 +1,4 @@
-" sh/comments.vim: Set 'comments' for shell script
+" sh/comments.vim: Set 'comments' and supporting 'formatoptions' for shell script
" Don't load if running compatible or too old
if &compatible || v:version < 700
@@ -15,7 +15,8 @@ let b:did_ftplugin_sh_comments = 1
let b:undo_ftplugin = b:undo_ftplugin
\ . '|unlet b:did_ftplugin_sh_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<'