aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-16 14:25:43 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-16 14:25:43 +1200
commitc23fe369cb44db0c89b8e371baf0e87cbaaedcd8 (patch)
tree5152aea8a0fe05c47634d1058d0c86546ffe7e72
parentMerge branch 'release/v6.12.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-6.13.0.tar.gz (sig)
dotfiles-6.13.0.zip
Merge branch 'release/v6.13.0'v6.13.0
* release/v6.13.0: Adjust &term matching regex Overhaul color scheme selection logic Break up long conditions again
-rw-r--r--VERSION4
-rw-r--r--vim/vimrc46
2 files changed, 35 insertions, 15 deletions
diff --git a/VERSION b/VERSION
index 88a788ca..696eda3a 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v6.12.0
-Sat, 15 Jun 2019 15:40:34 +0000
+tejr dotfiles v6.13.0
+Sun, 16 Jun 2019 02:25:41 +0000
diff --git a/vim/vimrc b/vim/vimrc
index 2175f114..bcb111e5 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -150,8 +150,10 @@ endif
"
" <https://github.com/vim/vim/releases/tag/v7.1.055>
"
-if $MYVIM =~# '\\'
- \ && (v:version < 701 || v:version == 701 && !has('patch55'))
+if $MYVIM =~# '\\' && (
+ \ v:version < 701
+ \ || v:version == 701 && !has('patch55')
+ \ )
echoerr 'Illegal backslash in user runtime path on Vim < v7.1.055'
finish
endif
@@ -492,7 +494,8 @@ set shiftwidth=4 " Indent command like < and > use four-space indents
"
" <https://github.com/vim/vim/releases/tag/v7.3.693>
"
-if v:version > 730 || v:version == 730 && has('patch693')
+if v:version > 730
+ \ || v:version == 730 && has('patch693')
set softtabstop=-1
else
let &softtabstop = &shiftwidth
@@ -622,7 +625,8 @@ set formatoptions+=1
"
" <https://github.com/vim/vim/releases/tag/v7.3.541>
"
-if v:version > 730 || v:version == 730 && has('patch541')
+if v:version > 730
+ \ || v:version == 730 && has('patch541')
set formatoptions+=j
endif
@@ -822,7 +826,7 @@ set synmaxcol=500
" windows terminal emulator PuTTY, and the terminal multiplexer tmux, both of
" which I use heavily.
"
-if &term =~# '^putty\|^tmux'
+if &term =~# '^\%(putty\|tmux\)'
set ttyfast
endif
@@ -977,19 +981,34 @@ autocmd vimrc ColorScheme sahara
" We'll have Vim try to use my 'sahara' fork of the 'desert256' color scheme.
" If we fail to load the color scheme, for whatever reason, suppress the
-" error, and ensure a dark background for the default color scheme.
+" error, and default to a dark background (if not already) for the the default
+" color scheme in the absence of guidance otherwise from a COLORFGBG
+" environment variable or a t_RB terminal response. Vim otherwise defaults to
+" 'light', which is less likely in my case.
"
" There's also a very simple grayscale color scheme I occasionally use instead
" called 'juvenile', which is included as a Git submodule with this dotfiles
" distribution.
"
-try
+
+" Use 'dark' as my default value for 'background', in the absence of an
+" environment variable COLORFGBG or a response in v:termrbgresp that would set
+" it specifically.
+"
+if !exists('$COLORFGBG') && (
+ \ !exists('v:termrbgresp')
+ \ || v:termrbgresp ==# ''
+ \ )
+ set background=dark
+endif
+
+" If the background seems to be dark, and my custom sahara.vim color scheme
+" looks to be available, load it.
+"
+if &background ==# 'dark'
+ \ && globpath(&runtimepath, 'colors/sahara.vim') !=# ''
colorscheme sahara
-catch
- if &background !=# 'dark'
- set background=dark
- endif
-endtry
+endif
" My mapping definitions begin here. I have some general personal rules for
" approaches to mappings:
@@ -1074,7 +1093,8 @@ nnoremap <expr> <Space>
" If the plugin isn't available, I just abandon CTRL-C to continue its
" uselessness.
"
-if &loadplugins && globpath(&runtimepath, 'plugin/insert_cancel.vim') !=# ''
+if &loadplugins
+ \ && globpath(&runtimepath, 'plugin/insert_cancel.vim') !=# ''
imap <C-C> <Plug>(InsertCancel)
endif