aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:34:32 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:34:32 +1300
commitec775b023b0e83f413708d1bf294ab3abcaed666 (patch)
tree3de06ca0cc53dacac71f9b0beb858bfe12c3f079
parentf8e01d5f70c020631257dbb6b144ee103330f7bd (diff)
downloaddotfiles-ec775b023b0e83f413708d1bf294ab3abcaed666.tar.gz
dotfiles-ec775b023b0e83f413708d1bf294ab3abcaed666.zip
Suspend 'C' from 'cpoptions' for sh syn extensions
This allows me to use line-breaking to keep the file readable.
-rw-r--r--vim/after/syntax/sh.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim
index 08dbd857..026e4ebd 100644
--- a/vim/after/syntax/sh.vim
+++ b/vim/after/syntax/sh.vim
@@ -1,3 +1,9 @@
+" Support line continuation for this file
+if &compatible
+ let s:cpoptions_save = &cpoptions
+ set cpoptions-=C
+endif
+
" If we know we have another shell type, clear away the others completely, now
" that core syntax/sh.vim is done prodding /bin/sh to determine the system
" shell type (which I don't care about).
@@ -210,3 +216,9 @@ if exists('b:is_bash')
\ variables
\ wait
endif
+
+" Restore 'cpoptions' setting if we touched it
+if exists('s:cpoptions_save')
+ let &cpoptions = s:cpoptions_save
+ unlet s:cpoptions_save
+endif