From c139e8e0482c484fcb7115fe91bae668a51ea4bc Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 11 Jul 2019 14:52:08 +1200 Subject: Avoid let-& syntax --- vim/autoload/colorscheme.vim | 8 ++++++++ vim/vimrc | 11 ++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 vim/autoload/colorscheme.vim (limited to 'vim') diff --git a/vim/autoload/colorscheme.vim b/vim/autoload/colorscheme.vim new file mode 100644 index 00000000..9ee9f24d --- /dev/null +++ b/vim/autoload/colorscheme.vim @@ -0,0 +1,8 @@ +" Reset colorscheme based on current colorscheme name +function! colorscheme#UpdateCursorline(colors_name, list) abort + if index(a:list, a:colors_name) >= 0 + set cursorline + else + set nocursorline + endif +endfunction diff --git a/vim/vimrc b/vim/vimrc index c3f21c03..5052ed61 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -323,7 +323,7 @@ endif set spellfile& execute 'set spellfile^='.escape#Arg(escape#Item(s:spellfile)) if exists('s:isfname') - let &isfname = s:isfname + execute 'set isfname='.escape#Arg(s:isfname) unlet s:isfname endif CreatePath $MYVIM/spell @@ -439,11 +439,8 @@ set smarttab " " " -if has#('patch-7.3.693') - set softtabstop=-1 -else - let &softtabstop = &shiftwidth -endif +execute 'set softtabstop=' + \ . escape#Arg(has#('patch-7.3.693') ? -1 : &shiftwidth) " Relax traditional vi’s harsh standards over what regions of the buffer can " be removed with backspace in insert mode. While this admittedly allows bad @@ -916,7 +913,7 @@ endif " " autocmd vimrc ColorScheme * - \ let &cursorline = g:colors_name ==# 'sahara' + \ call colorscheme#UpdateCursorline(g:colors_name, ['sahara']) " 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 -- cgit v1.2.3