patch 8.0.1777: cannot cleanup before loading another colorscheme

Problem:    Cannot cleanup before loading another colorscheme.
Solution:   Add the ColorSchemePre autocommand event.
This commit is contained in:
Bram Moolenaar
2018-04-30 15:40:48 +02:00
parent 0e9d1ae321
commit 60a68362aa
6 changed files with 31 additions and 2 deletions

View File

@ -42,7 +42,16 @@ this autocmd might be useful:
Replace "blue_sky" with the name of the colorscheme.
In case you want to tweak a colorscheme after it was loaded, check out the
ColorScheme autocmd event.
ColorScheme autocommand event.
To clean up just before loading another colorscheme, use the ColorSchemePre
autocommand event. For example:
let g:term_ansi_colors = ...
augroup MyColorscheme
au!
au ColorSchemePre * unlet g:term_ansi_colors
au ColorSchemePre * au! MyColorscheme
augroup END
To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
and use `:runtime` to load the original colorscheme: