Mercurial > vim
annotate runtime/colors/README.txt @ 28887:0e207ddd939d v8.2.4966
patch 8.2.4966: MS-Windows GUI: mouse event test gets extra event
Commit: https://github.com/vim/vim/commit/e5162e76c0a8bd71fbfb0840a8c0014788d8808b
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 16 16:41:35 2022 +0100
patch 8.2.4966: MS-Windows GUI: mouse event test gets extra event
Problem: MS-Windows GUI: mouse event test gets extra event.
Solution: Ignore one move event.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 16 May 2022 17:45:03 +0200 |
parents | 82244cfc4694 |
children | 57c9377b9c62 |
rev | line source |
---|---|
7 | 1 README.txt for color scheme files |
2 | |
3 These files are used for the ":colorscheme" command. They appear in the | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
4 "Edit/Color Scheme" menu in the GUI. |
7 | 5 |
6 | |
7 Hints for writing a color scheme file: | |
8 | |
9 There are two basic ways to define a color scheme: | |
10 | |
11 1. Define a new Normal color and set the 'background' option accordingly. | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
12 |
7 | 13 set background={light or dark} |
14 highlight clear | |
15 highlight Normal ... | |
16 ... | |
17 | |
18 2. Use the default Normal color and automatically adjust to the value of | |
19 'background'. | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
20 |
7 | 21 highlight clear Normal |
22 set background& | |
23 highlight clear | |
24 if &background == "light" | |
25 highlight Error ... | |
26 ... | |
27 else | |
28 highlight Error ... | |
29 ... | |
30 endif | |
31 | |
32 You can use ":highlight clear" to reset everything to the defaults, and then | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
33 change the groups that you want differently. This will also work for groups |
7 | 34 that are added in later versions of Vim. |
35 Note that ":highlight clear" uses the value of 'background', thus set it | |
36 before this command. | |
37 Some attributes (e.g., bold) might be set in the defaults that you want | |
38 removed in your color scheme. Use something like "gui=NONE" to remove the | |
39 attributes. | |
40 | |
5555 | 41 In case you want to set 'background' depending on the colorscheme selected, |
42 this autocmd might be useful: | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
43 |
5555 | 44 autocmd SourcePre */colors/blue_sky.vim set background=dark |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
45 |
5555 | 46 Replace "blue_sky" with the name of the colorscheme. |
47 | |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
48 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
|
49 ColorScheme autocommand event. |
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
50 |
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
51 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
|
52 autocommand event. For example: |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
53 |
13810
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
54 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
|
55 augroup MyColorscheme |
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
56 au! |
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
57 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
|
58 au ColorSchemePre * au! MyColorscheme |
cad480bac9e1
patch 8.0.1777: cannot cleanup before loading another colorscheme
Christian Brabandt <cb@256bit.org>
parents:
13049
diff
changeset
|
59 augroup END |
5555 | 60 |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
61 To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim", |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
62 and use ":runtime" to load the original colorscheme: |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
63 |
10319
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
64 " load the "evening" colorscheme |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
65 runtime colors/evening.vim |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
66 " change the color of statements |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
67 hi Statement ctermfg=Blue guifg=Blue |
169a62d5bcb9
commit https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59
Christian Brabandt <cb@256bit.org>
parents:
5555
diff
changeset
|
68 |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
69 To see which highlight group is used where, see ":help highlight-groups" and |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
70 ":help group-name". |
7 | 71 |
72 You can use ":highlight" to find out the current colors. Exception: the | |
73 ctermfg and ctermbg values are numbers, which are only valid for the current | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
74 terminal. Use the color names instead for better portability. See |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
75 ":help cterm-colors". |
7 | 76 |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
77 The default color settings can be found in the source file src/syntax.c. |
7 | 78 Search for "highlight_init". |
79 | |
80 If you think you have a color scheme that is good enough to be used by others, | |
81 please check the following items: | |
82 | |
13857 | 83 - Source the $VIMRUNTIME/colors/tools/check_colors.vim script to check for |
84 common mistakes. | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
85 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
86 - Does it work in a color terminal as well as in the GUI? Is it consistent? |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
87 |
1622 | 88 - Is "g:colors_name" set to a meaningful value? In case of doubt you can do |
89 it this way: | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
90 |
1622 | 91 let g:colors_name = expand('<sfile>:t:r') |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
92 |
7 | 93 - Is 'background' either used or appropriately set to "light" or "dark"? |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
94 |
7 | 95 - Try setting 'hlsearch' and searching for a pattern, is the match easy to |
96 spot? | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
97 |
7 | 98 - Split a window with ":split" and ":vsplit". Are the status lines and |
99 vertical separators clearly visible? | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
100 |
7 | 101 - In the GUI, is it easy to find the cursor, also in a file with lots of |
102 syntax highlighting? | |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
103 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
104 - In general, test your color scheme against as many filetypes, Vim features, |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
105 environments, etc. as possible. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
106 |
7 | 107 - Do not use hard coded escape sequences, these will not work in other |
28862
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
108 terminals. Always use #RRGGBB for the GUI. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
109 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
110 - When targetting 8-16 colors terminals, don't count on "darkblue" to be blue |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
111 and dark, or on "2" to be even vaguely reddish. Names are more portable |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
112 than numbers, though. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
113 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
114 - When targetting 256 colors terminals, prefer colors 16-255 to colors 0-15 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
115 for the same reason. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
116 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
117 - Typographic attributes (bold, italic, underline, reverse, etc.) are not |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
118 universally supported. Don't count on any of them. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
119 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
120 - Is "g:terminal_ansi_colors" set to a list of 16 #RRGGBB values? |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
121 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
122 - Try to keep your color scheme simple by avoiding unnecessary logic and |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
123 refraining from adding options. The best color scheme is one that only |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
124 requires: |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
125 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
126 colorscheme foobar |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
127 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
128 The color schemes distributed with Vim are built with lifepillar/colortemplate |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
129 (https://github.com/lifepillar/vim-colortemplate). It is therefore highly |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
130 recommended. |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
131 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
132 If you would like your color scheme to be distributed with Vim, make sure |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
133 that: |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
134 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
135 - it satisfies the guidelines above, |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
136 - it was made with colortemplate, |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
137 |
82244cfc4694
Update runtime files, new color schemes
Bram Moolenaar <Bram@vim.org>
parents:
26057
diff
changeset
|
138 and join us at vim/colorschemes: (https://github.com/vim/colorschemes). |