aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:38:04 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:38:04 +1300
commit76082ffecb2dbc0f12f11acfb561de886f42a983 (patch)
tree3de06ca0cc53dacac71f9b0beb858bfe12c3f079 /vim/vimrc
parentMerge branch 'release/v0.24.0' into develop (diff)
parentSuspend 'C' from 'cpoptions' for sh syn extensions (diff)
downloaddotfiles-76082ffecb2dbc0f12f11acfb561de886f42a983.tar.gz
dotfiles-76082ffecb2dbc0f12f11acfb561de886f42a983.zip
Merge branch 'feature/vimrc-review' into develop
* feature/vimrc-review: Suspend 'C' from 'cpoptions' for sh syn extensions Join short-circuit line in detect_background.vim Break some continued lines in Vim indent files Remove 'mac' from 'fileformats' Tweak 'cpoptions' C flag instead of 'nocompatible' Remove a baseless assertion I made in a config Make entire syntax config dependent on load state Activate syntax settings conditionally
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc16
1 files changed, 14 insertions, 2 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 5d195427..18363956 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,5 +1,10 @@
-" Don't try to be vi-compatible, even if invoked as ex or with -u specified
-set nocompatible
+" If we're in compatible mode, ensure that the 'C' option that disallows line
+" continuations is stripped out, as they're heavily used in this
+" configuration for readability; we'll put it back later
+if &compatible
+ let s:cpoptions_save = &cpoptions
+ set cpoptions-=C
+endif
" Use different keys for global and local leaders
if has('eval')
@@ -29,3 +34,10 @@ if v:version >= 701
silent! colorscheme sahara
endif
endif
+
+" If we're in compatible mode, put 'cpoptions' back the way we found it at the
+" start of this configuration, even though it's the current year
+if exists('s:cpoptions_save')
+ let &cpoptions = s:cpoptions_save
+ unlet s:cpoptions_save
+endif