From e91e5a2234b27900737e5b0a15d12b18e57c57ae Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 18 Dec 2019 15:13:23 +1300 Subject: Simplify 'cursorline' switching --- vim/autoload/colorscheme.vim | 8 -------- vim/vimrc | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 vim/autoload/colorscheme.vim diff --git a/vim/autoload/colorscheme.vim b/vim/autoload/colorscheme.vim deleted file mode 100644 index 9ee9f24d..00000000 --- a/vim/autoload/colorscheme.vim +++ /dev/null @@ -1,8 +0,0 @@ -" 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 3eb1dbbe..9b078c17 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -887,7 +887,7 @@ endif " " autocmd vimrc ColorScheme * - \ call colorscheme#UpdateCursorline(g:colors_name, ['sahara']) + \ let &cursorline = 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 From 65d4cf63852ba7cc2c3cfd7617c19c1ebf5676ad Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 18 Dec 2019 15:15:32 +1300 Subject: Specify some interdependencies in Vim config --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 814cd41a..bdd6b1d4 100644 --- a/Makefile +++ b/Makefile @@ -554,7 +554,7 @@ install-vim-after: install-vim-after-ftplugin \ install-vim-after-plugin \ install-vim-after-syntax -install-vim-after-ftplugin: +install-vim-after-ftplugin: install-vim-compiler mkdir -p $(VIMDIR)/after/ftplugin cp -p -- vim/after/ftplugin/*.vim $(VIMDIR)/after/ftplugin @@ -595,7 +595,7 @@ install-vim-compiler: mkdir -p -- $(VIMDIR)/compiler cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler -install-vim-config: install-vim-cache +install-vim-config: install-vim-autoload install-vim-cache cp -p -- vim/vimrc.stub $(HOME)/.vimrc cp -p -- vim/vimrc $(VIMRC) -- cgit v1.2.3 From 29dff73acb39e9ba52c80103c8f7f6c4e7c7e000 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 18 Dec 2019 15:28:19 +1300 Subject: Set 'cursorline' for all windows on colors change --- vim/autoload/colorscheme.vim | 10 ++++++++++ vim/vimrc | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 vim/autoload/colorscheme.vim diff --git a/vim/autoload/colorscheme.vim b/vim/autoload/colorscheme.vim new file mode 100644 index 00000000..591550fd --- /dev/null +++ b/vim/autoload/colorscheme.vim @@ -0,0 +1,10 @@ +" Reset window-global value for 'cursorline' based on current colorscheme name +function! colorscheme#UpdateCursorline(colors_name, list) abort + let l:tab = tabpagenr() + let l:win = winnr() + tabdo windo let &g:cursorline = index(a:list, a:colors_name) >= 0 + \| silent doautocmd WinEnter,WinLeave + execute l:tab . 'tabnext' + execute l:win . 'wincmd w' + \| silent doautocmd WinEnter +endfunction diff --git a/vim/vimrc b/vim/vimrc index 9b078c17..3eb1dbbe 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -887,7 +887,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 From e721b84a1fa009e5bf66a70fda0c25209e3f682a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 18 Dec 2019 16:02:35 +1300 Subject: Update change date on vimrc --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 3eb1dbbe..91424fd1 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Tue, 09 Jul 2019 13:11:16 +1200 +" Last updated: Wed, 18 Dec 2019 16:02:05 +1300 " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, -- cgit v1.2.3 From 463cd50e7b9bda88baa4cd7a5884e448609bdd28 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 18 Dec 2019 16:02:49 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 57c7ea8b..a2dc20d7 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v8.4.0 -Sun, 15 Dec 2019 04:23:07 +0000 +tejr dotfiles v8.5.0 +Wed, 18 Dec 2019 03:02:49 +0000 -- cgit v1.2.3