From b0af6efaec3e4a31cb7b230d236f38219bb6676b Mon Sep 17 00:00:00 2001 From: Gabriel Barta Date: Sun, 5 Nov 2017 21:52:02 +1100 Subject: [PATCH] Add sample command LightlineColorscheme to help --- doc/lightline.txt | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/doc/lightline.txt b/doc/lightline.txt index 187be82..dc9ab50 100644 --- a/doc/lightline.txt +++ b/doc/lightline.txt @@ -1224,7 +1224,9 @@ Problem 12: *lightline-problem-12* Problem 13: *lightline-problem-13* How to change the lightline colorscheme on the fly. - Add the following settings to your .vimrc(_vimrc). + To update your lightline colorscheme in sync with your vim + colorscheme (only for select colorschemes which exist for + both), add the following settings to your .vimrc(_vimrc). > augroup LightlineColorscheme autocmd! @@ -1245,6 +1247,27 @@ Problem 13: *lightline-problem-13* catch endtry endfunction +< + If you have not settled on a single lightline colorscheme, you + can easily switch between lightline colorschemes by adding the + following LightlineColorscheme command to your .vimrc(_vimrc). +> + function! s:setLightlineColorscheme(name) + let g:lightline.colorscheme = a:name + call lightline#init() + call lightline#colorscheme() + call lightline#update() + endfun + + function! s:lightlineColorschemes(...) + return join(map( + \ globpath(&rtp,"autoload/lightline/colorscheme/*.vim",1,1), + \ "fnamemodify(v:val,':t:r')"), + \ "\n") + endfun + + com! -nargs=1 -complete=custom,s:lightlineColorschemes LightlineColorscheme + \ call s:setLightlineColorscheme() < Problem 14: *lightline-problem-14* The 'E541' warning appears on the right hand side.