annotate runtime/colors/README.txt @ 15113:ae25a1172514 v8.1.0567

patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed commit https://github.com/vim/vim/commit/4087bfd96d0d70791a1572ac4b40d5a655e2166b Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 7 13:26:39 2018 +0100 patch 8.1.0567: error for NUL byte in ScreenLines goes unnoticed Problem: Error for NUL byte in ScreenLines goes unnoticed. Solution: Add an internal error message.
author Bram Moolenaar <Bram@vim.org>
date Fri, 07 Dec 2018 13:30:08 +0100
parents e751b5c9dff3
children 17c4178f26ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 README.txt for color scheme files
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 These files are used for the ":colorscheme" command. They appear in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 Edit/Color Scheme menu in the GUI.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Hints for writing a color scheme file:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 There are two basic ways to define a color scheme:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 1. Define a new Normal color and set the 'background' option accordingly.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 set background={light or dark}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 highlight clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 highlight Normal ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 2. Use the default Normal color and automatically adjust to the value of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 'background'.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 highlight clear Normal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 set background&
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 highlight clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 if &background == "light"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 highlight Error ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 highlight Error ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 ...
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 You can use ":highlight clear" to reset everything to the defaults, and then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 change the groups that you want differently. This also will work for groups
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 that are added in later versions of Vim.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 Note that ":highlight clear" uses the value of 'background', thus set it
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 before this command.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 Some attributes (e.g., bold) might be set in the defaults that you want
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 removed in your color scheme. Use something like "gui=NONE" to remove the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 attributes.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
5555
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
39 In case you want to set 'background' depending on the colorscheme selected,
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
40 this autocmd might be useful:
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
41 autocmd SourcePre */colors/blue_sky.vim set background=dark
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
42 Replace "blue_sky" with the name of the colorscheme.
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
43
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
44 In case you want to tweak a colorscheme after it was loaded, check out the
13810
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
45 ColorScheme autocommand event.
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
46
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
47 To clean up just before loading another colorscheme, use the ColorSchemePre
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
48 autocommand event. For example:
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
49 let g:term_ansi_colors = ...
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
50 augroup MyColorscheme
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
51 au!
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
52 au ColorSchemePre * unlet g:term_ansi_colors
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
53 au ColorSchemePre * au! MyColorscheme
cad480bac9e1 patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents: 13049
diff changeset
54 augroup END
5555
7818ca6de3d0 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1622
diff changeset
55
10319
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
56 To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim",
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
57 and use `:runtime` to load the original colorscheme:
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
58 " load the "evening" colorscheme
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
59 runtime colors/evening.vim
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
60 " change the color of statements
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
61 hi Statement ctermfg=Blue guifg=Blue
169a62d5bcb9 commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents: 5555
diff changeset
62
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 To see which highlight group is used where, find the help for
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 "highlight-groups" and "group-name".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 You can use ":highlight" to find out the current colors. Exception: the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 ctermfg and ctermbg values are numbers, which are only valid for the current
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 terminal. Use the color names instead. See ":help cterm-colors".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 The default color settings can be found in the source file src/syntax.c.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 Search for "highlight_init".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 If you think you have a color scheme that is good enough to be used by others,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 please check the following items:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75
13857
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
76 - Source the $VIMRUNTIME/colors/tools/check_colors.vim script to check for
e751b5c9dff3 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13810
diff changeset
77 common mistakes.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 - Does it work in a color terminal as well as in the GUI?
1622
149d8b46404c updated for version 7.2a
vimboss
parents: 7
diff changeset
79 - Is "g:colors_name" set to a meaningful value? In case of doubt you can do
149d8b46404c updated for version 7.2a
vimboss
parents: 7
diff changeset
80 it this way:
149d8b46404c updated for version 7.2a
vimboss
parents: 7
diff changeset
81 let g:colors_name = expand('<sfile>:t:r')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 - Is 'background' either used or appropriately set to "light" or "dark"?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 - Try setting 'hlsearch' and searching for a pattern, is the match easy to
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 spot?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 - Split a window with ":split" and ":vsplit". Are the status lines and
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 vertical separators clearly visible?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 - In the GUI, is it easy to find the cursor, also in a file with lots of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syntax highlighting?
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 - Do not use hard coded escape sequences, these will not work in other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 terminals. Always use color names or #RRGGBB for the GUI.