2014-07-10 21:05:51 -07:00
|
|
|
README.txt for color scheme files
|
|
|
|
|
2022-05-23 14:49:38 -07:00
|
|
|
These files are used for the `:colorscheme` command. They appear in the
|
2022-05-15 01:25:02 -07:00
|
|
|
"Edit/Color Scheme" menu in the GUI.
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2022-05-23 14:49:38 -07:00
|
|
|
The colorschemes were updated for the Vim 9 release. If you don't like the
|
|
|
|
changes you can find the old ones here:
|
|
|
|
https://github.com/vim/colorschemes/tree/master/legacy_colors
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
Hints for writing a color scheme file:
|
|
|
|
|
|
|
|
There are two basic ways to define a color scheme:
|
|
|
|
|
2022-05-23 14:49:38 -07:00
|
|
|
1. Define a new Normal color and set the 'background' option accordingly. >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
set background={light or dark}
|
|
|
|
highlight clear
|
|
|
|
highlight Normal ...
|
|
|
|
...
|
|
|
|
|
|
|
|
2. Use the default Normal color and automatically adjust to the value of
|
2022-05-23 14:49:38 -07:00
|
|
|
'background'. >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
highlight clear Normal
|
|
|
|
set background&
|
|
|
|
highlight clear
|
|
|
|
if &background == "light"
|
|
|
|
highlight Error ...
|
|
|
|
...
|
|
|
|
else
|
|
|
|
highlight Error ...
|
|
|
|
...
|
|
|
|
endif
|
|
|
|
|
2022-05-23 14:49:38 -07:00
|
|
|
You can use `:highlight clear` to reset everything to the defaults, and then
|
2022-05-15 01:25:02 -07:00
|
|
|
change the groups that you want differently. This will also work for groups
|
2014-07-10 21:05:51 -07:00
|
|
|
that are added in later versions of Vim.
|
2022-05-23 14:49:38 -07:00
|
|
|
Note that `:highlight clear` uses the value of 'background', thus set it
|
2014-07-10 21:05:51 -07:00
|
|
|
before this command.
|
|
|
|
Some attributes (e.g., bold) might be set in the defaults that you want
|
|
|
|
removed in your color scheme. Use something like "gui=NONE" to remove the
|
|
|
|
attributes.
|
|
|
|
|
|
|
|
In case you want to set 'background' depending on the colorscheme selected,
|
2022-05-23 14:49:38 -07:00
|
|
|
this autocmd might be useful: >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
autocmd SourcePre */colors/blue_sky.vim set background=dark
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
Replace "blue_sky" with the name of the colorscheme.
|
|
|
|
|
2017-04-28 16:50:00 -07:00
|
|
|
In case you want to tweak a colorscheme after it was loaded, check out the
|
2018-10-10 23:27:37 -07:00
|
|
|
ColorScheme autocommand event.
|
|
|
|
|
|
|
|
To clean up just before loading another colorscheme, use the ColorSchemePre
|
2022-05-23 14:49:38 -07:00
|
|
|
autocommand event. For example: >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2018-10-10 23:27:37 -07:00
|
|
|
let g:term_ansi_colors = ...
|
|
|
|
augroup MyColorscheme
|
|
|
|
au!
|
|
|
|
au ColorSchemePre * unlet g:term_ansi_colors
|
|
|
|
au ColorSchemePre * au! MyColorscheme
|
|
|
|
augroup END
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2017-04-28 16:50:00 -07:00
|
|
|
To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
|
2022-05-23 14:49:38 -07:00
|
|
|
and use ":runtime" to load the original colorscheme: >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2017-04-28 16:50:00 -07:00
|
|
|
" load the "evening" colorscheme
|
|
|
|
runtime colors/evening.vim
|
|
|
|
" change the color of statements
|
|
|
|
hi Statement ctermfg=Blue guifg=Blue
|
|
|
|
|
2022-05-23 14:49:38 -07:00
|
|
|
To see which highlight group is used where, see `:help highlight-groups` and
|
|
|
|
`:help group-name` .
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
You can use ":highlight" to find out the current colors. Exception: the
|
|
|
|
ctermfg and ctermbg values are numbers, which are only valid for the current
|
2022-05-15 01:25:02 -07:00
|
|
|
terminal. Use the color names instead for better portability. See
|
2022-05-23 14:49:38 -07:00
|
|
|
`:help cterm-colors` .
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2022-05-15 01:25:02 -07:00
|
|
|
The default color settings can be found in the source file
|
|
|
|
"src/nvim/highlight_group.c". Search for "highlight_init".
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
If you think you have a color scheme that is good enough to be used by others,
|
|
|
|
please check the following items:
|
|
|
|
|
2022-05-15 01:25:02 -07:00
|
|
|
- Does it work in a color terminal as well as in the GUI? Is it consistent?
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- Is "g:colors_name" set to a meaningful value? In case of doubt you can do
|
2022-05-23 14:49:38 -07:00
|
|
|
it this way: >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
let g:colors_name = expand('<sfile>:t:r')
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- Is 'background' either used or appropriately set to "light" or "dark"?
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- Try setting 'hlsearch' and searching for a pattern, is the match easy to
|
|
|
|
spot?
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- Split a window with ":split" and ":vsplit". Are the status lines and
|
|
|
|
vertical separators clearly visible?
|
2022-05-15 01:25:02 -07:00
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- In the GUI, is it easy to find the cursor, also in a file with lots of
|
|
|
|
syntax highlighting?
|
2022-05-15 01:25:02 -07:00
|
|
|
|
|
|
|
- In general, test your color scheme against as many filetypes, Vim features,
|
|
|
|
environments, etc. as possible.
|
|
|
|
|
2014-07-10 21:05:51 -07:00
|
|
|
- Do not use hard coded escape sequences, these will not work in other
|
2022-05-15 01:25:02 -07:00
|
|
|
terminals. Always use #RRGGBB for the GUI.
|
|
|
|
|
2023-10-16 01:36:25 -07:00
|
|
|
- When targeting 8-16 colors terminals, don't count on "darkblue" to be blue
|
2022-05-15 01:25:02 -07:00
|
|
|
and dark, or on "2" to be even vaguely reddish. Names are more portable
|
|
|
|
than numbers, though.
|
|
|
|
|
2023-10-16 01:36:25 -07:00
|
|
|
- When targeting 256 colors terminals, prefer colors 16-255 to colors 0-15
|
2022-05-15 01:25:02 -07:00
|
|
|
for the same reason.
|
|
|
|
|
|
|
|
- Typographic attributes (bold, italic, underline, reverse, etc.) are not
|
|
|
|
universally supported. Don't count on any of them.
|
|
|
|
|
|
|
|
- Is "g:terminal_ansi_colors" set to a list of 16 #RRGGBB values?
|
|
|
|
|
|
|
|
- Try to keep your color scheme simple by avoiding unnecessary logic and
|
|
|
|
refraining from adding options. The best color scheme is one that only
|
2022-05-23 14:49:38 -07:00
|
|
|
requires: >
|
2022-05-15 01:25:02 -07:00
|
|
|
|
|
|
|
colorscheme foobar
|
|
|
|
|
|
|
|
The color schemes distributed with Vim are built with lifepillar/colortemplate
|
|
|
|
(https://github.com/lifepillar/vim-colortemplate). It is therefore highly
|
|
|
|
recommended.
|
|
|
|
|
|
|
|
If you would like your color scheme to be distributed with Vim, make sure
|
|
|
|
that:
|
|
|
|
|
|
|
|
- it satisfies the guidelines above,
|
|
|
|
- it was made with colortemplate,
|
|
|
|
|
|
|
|
and join us at vim/colorschemes: (https://github.com/vim/colorschemes).
|
2022-05-23 14:49:38 -07:00
|
|
|
|
|
|
|
|
|
|
|
vim: set ft=help :
|