From 90ac35e462086110ddb507648daa9c56c5120d9e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 14:19:19 +1200 Subject: Break up long conditions again I'm having some trouble deciding how I want to do these. --- vim/vimrc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 2175f114..0a95d1a9 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -150,8 +150,10 @@ endif " " " -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 " " " -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 " " " -if v:version > 730 || v:version == 730 && has('patch541') +if v:version > 730 + \ || v:version == 730 && has('patch541') set formatoptions+=j endif @@ -1074,7 +1078,8 @@ nnoremap " 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 (InsertCancel) endif -- cgit v1.2.3 From 615463509a033a15e9e4caad9a748be418c2ed06 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 14:19:36 +1200 Subject: Overhaul color scheme selection logic --- vim/vimrc | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 0a95d1a9..ccb3782f 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -981,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: -- cgit v1.2.3 From 2836b94c3e655dc5cc95611a9defaffed1cd6c70 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 14:22:26 +1200 Subject: Adjust &term matching regex --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index ccb3782f..bcb111e5 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -826,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 -- cgit v1.2.3 From 61f01e5f87f24e2ab300bf2525dd9263ad9f2150 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 16 Jun 2019 14:25:41 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 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 -- cgit v1.2.3