comparison runtime/colors/README.txt @ 13810:cad480bac9e1 v8.0.1777

patch 8.0.1777: cannot cleanup before loading another colorscheme commit https://github.com/vim/vim/commit/60a68362aa73f4a6cb534688978f9dc2b16e60fe Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 30 15:40:48 2018 +0200 patch 8.0.1777: cannot cleanup before loading another colorscheme Problem: Cannot cleanup before loading another colorscheme. Solution: Add the ColorSchemePre autocommand event.
author Christian Brabandt <cb@256bit.org>
date Mon, 30 Apr 2018 15:45:07 +0200
parents 0d23a49da746
children e751b5c9dff3
comparison
equal deleted inserted replaced
13809:1369d55a2839 13810:cad480bac9e1
40 this autocmd might be useful: 40 this autocmd might be useful:
41 autocmd SourcePre */colors/blue_sky.vim set background=dark 41 autocmd SourcePre */colors/blue_sky.vim set background=dark
42 Replace "blue_sky" with the name of the colorscheme. 42 Replace "blue_sky" with the name of the colorscheme.
43 43
44 In case you want to tweak a colorscheme after it was loaded, check out the 44 In case you want to tweak a colorscheme after it was loaded, check out the
45 ColorScheme autocmd event. 45 ColorScheme autocommand event.
46
47 To clean up just before loading another colorscheme, use the ColorSchemePre
48 autocommand event. For example:
49 let g:term_ansi_colors = ...
50 augroup MyColorscheme
51 au!
52 au ColorSchemePre * unlet g:term_ansi_colors
53 au ColorSchemePre * au! MyColorscheme
54 augroup END
46 55
47 To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim", 56 To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
48 and use `:runtime` to load the original colorscheme: 57 and use `:runtime` to load the original colorscheme:
49 " load the "evening" colorscheme 58 " load the "evening" colorscheme
50 runtime colors/evening.vim 59 runtime colors/evening.vim