aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:39:36 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-01-21 23:39:36 +1300
commit680c5b2b58db2d6fea59de3443e38aa3dffe0914 (patch)
treef9ec628dab5549e5a996fce55428624e93a75b81
parentMerge branch 'release/v0.24.0' (diff)
parentBump version number to 0.25.0 (diff)
downloaddotfiles-680c5b2b58db2d6fea59de3443e38aa3dffe0914.tar.gz
dotfiles-680c5b2b58db2d6fea59de3443e38aa3dffe0914.zip
Merge branch 'release/v0.25.0'v0.25.0
* release/v0.25.0: Bump version number to 0.25.0 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
-rw-r--r--VERSION4
-rw-r--r--vim/after/indent/vim.vim4
-rw-r--r--vim/after/syntax/sh.vim12
-rw-r--r--vim/autoload/detect_background.vim3
-rw-r--r--vim/config/files.vim4
-rw-r--r--vim/config/syntax.vim2
-rw-r--r--vim/config/whitespace.vim3
-rw-r--r--vim/indent/csv.vim3
-rw-r--r--vim/indent/tsv.vim3
-rw-r--r--vim/vimrc16
10 files changed, 35 insertions, 19 deletions
diff --git a/VERSION b/VERSION
index 55216e2f..bd776237 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v0.24.0
-Thu Jan 18 00:04:53 UTC 2018
+tejr dotfiles v0.25.0
+Sun Jan 21 10:38:55 UTC 2018
diff --git a/vim/after/indent/vim.vim b/vim/after/indent/vim.vim
index 0cb1d397..bfd92aeb 100644
--- a/vim/after/indent/vim.vim
+++ b/vim/after/indent/vim.vim
@@ -2,6 +2,6 @@
setlocal shiftwidth=2
setlocal softtabstop=2
if exists('b:undo_indent')
- let b:undo_indent = b:undo_indent
- \ . '|setlocal shiftwidth< softtabstop<'
+ let s:ui = '|setlocal shiftwidth< softtabstop<'
+ let b:undo_indent = b:undo_indent . s:ui
endif
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
diff --git a/vim/autoload/detect_background.vim b/vim/autoload/detect_background.vim
index c010dc53..e4163a43 100644
--- a/vim/autoload/detect_background.vim
+++ b/vim/autoload/detect_background.vim
@@ -9,8 +9,7 @@
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
-if exists('g:loaded_detect_background')
- \ || &compatible
+if exists('g:loaded_detect_background') || &compatible
finish
endif
let g:loaded_detect_background = 1
diff --git a/vim/config/files.vim b/vim/config/files.vim
index 7a23b4c5..61c3b6cb 100644
--- a/vim/config/files.vim
+++ b/vim/config/files.vim
@@ -18,10 +18,6 @@ if has('file_in_path')
set path=**
endif
-" Try Mac line-endings if UNIX or DOS don't make sense; this has never
-" happened to me but who knows, it might one day
-set fileformats+=mac
-
" If the Vim buffer for a file doesn't have any changes and Vim detects the
" file has been altered, quietly update it
set autoread
diff --git a/vim/config/syntax.vim b/vim/config/syntax.vim
index b493c0a9..00004e35 100644
--- a/vim/config/syntax.vim
+++ b/vim/config/syntax.vim
@@ -1,5 +1,5 @@
" Options dependent on the syntax feature
-if has('syntax')
+if has('syntax') && !has('g:syntax_on')
" Use syntax highlighting with 100 lines of context
silent! syntax enable
diff --git a/vim/config/whitespace.vim b/vim/config/whitespace.vim
index 981def81..0d985f15 100644
--- a/vim/config/whitespace.vim
+++ b/vim/config/whitespace.vim
@@ -1,5 +1,4 @@
-" Adopt the indent of the last line on new lines; interestingly, plugins that
-" do clever things with indenting will often assume this is set
+" Adopt the indent of the last line on new lines
set autoindent
" Use spaces instead of tabs
diff --git a/vim/indent/csv.vim b/vim/indent/csv.vim
index d092838f..938bc99d 100644
--- a/vim/indent/csv.vim
+++ b/vim/indent/csv.vim
@@ -7,5 +7,4 @@ let b:did_indent = 1
" Manual indenting and literal tabs for CSVs
setlocal noautoindent
setlocal noexpandtab
-let b:undo_indent
- \ = 'setlocal autoindent< expandtab<'
+let b:undo_indent = 'setlocal autoindent< expandtab<'
diff --git a/vim/indent/tsv.vim b/vim/indent/tsv.vim
index 56721a4c..6f70276d 100644
--- a/vim/indent/tsv.vim
+++ b/vim/indent/tsv.vim
@@ -7,5 +7,4 @@ let b:did_indent = 1
" Manual indenting and literal tabs for TSVs
setlocal noautoindent
setlocal noexpandtab
-let b:undo_indent
- \ = 'setlocal autoindent< expandtab<'
+let b:undo_indent = 'setlocal autoindent< expandtab<'
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