diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-18 10:26:46 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-18 10:26:46 +1200 |
commit | 568a09a4f1c8948dbcb4f07f4f7fc5b59f6db9bc (patch) | |
tree | ffb766cde3d94d6b94a0f1acae595b7e82d14ec6 /vim/vimrc | |
parent | Check for sahara.vim suitability more carefully (diff) | |
download | dotfiles-568a09a4f1c8948dbcb4f07f4f7fc5b59f6db9bc.tar.gz dotfiles-568a09a4f1c8948dbcb4f07f4f7fc5b59f6db9bc.zip |
Continue faffing around with vimrc conditionals
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 20 |
1 files changed, 8 insertions, 12 deletions
@@ -118,7 +118,7 @@ endif " Firstly, MYVIM can't be an empty string. We need a real path. " -if $MYVIM ==# '' +if !strlen($MYVIM) echoerr 'Blank user runtime path' finish endif @@ -130,7 +130,7 @@ endif " :execute abstraction, but it's not really worth the extra complexity for " such a niche situation. " -if $MYVIM =~# ',' +if stridx($MYVIM, ',') != -1 echoerr 'Illegal comma in user runtime path' finish endif @@ -149,10 +149,8 @@ endif " " <https://github.com/vim/vim/releases/tag/v7.1.055> " -if $MYVIM =~# '\\' && ( - \ v:version < 701 - \ || v:version == 701 && !has('patch55') - \ ) +if stridx($MYVIM, '\') != -1 + \ && (v:version < 701 || v:version == 701 && !has('patch55')) echoerr 'Illegal backslash in user runtime path on Vim < v7.1.055' finish endif @@ -825,8 +823,7 @@ set shortmess+=I " plugin doesn't look like it's going to load, whether because plugins have " been disabled, or it's not in any of the plugin directories. " -if !&loadplugins - \ && globpath(&runtimepath, 'plugin/matchparen.vim') !=# '' +if !&loadplugins || !strlen(globpath(&runtimepath, 'plugin/matchparen.vim')) set showmatch matchtime=3 endif @@ -1008,7 +1005,7 @@ autocmd vimrc ColorScheme sahara " environment variable COLORFGBG or a response in v:termrbgresp that would set " it specifically. " -if !exists('$COLORFGBG') && get(v:, 'termrbgresp', '') ==# '' +if !exists('$COLORFGBG') && !strlen(get(v:, 'termrbgresp', '')) set background=dark endif @@ -1018,7 +1015,7 @@ endif " if &background ==# 'dark' \ && (has('gui_running') || &t_Co >= 256) - \ && globpath(&runtimepath, 'colors/sahara.vim') !=# '' + \ && strlen(globpath(&runtimepath, 'colors/sahara.vim')) colorscheme sahara endif @@ -1111,8 +1108,7 @@ 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 && strlen(globpath(&runtimepath, 'plugin/insert_cancel.vim')) imap <C-C> <Plug>(InsertCancel) endif |