Update runtime files
[MacVim.git] / runtime / syntax / colortest.vim
blob58de7aaf13ae043b8bac8cbdc7d7acfa53f6b018
1 " Vim script for testing colors
2 " Maintainer:   Bram Moolenaar <Bram@vim.org>
3 " Contributors: Rafael Garcia-Suarez, Charles Campbell
4 " Last Change:  2008 Jun 04
6 " edit this file, then do ":source %", and check if the colors match
8 " black         black_on_white                          white_on_black
9 "                               black_on_black          black_on_black
10 " darkred       darkred_on_white                        white_on_darkred
11 "                               darkred_on_black        black_on_darkred
12 " darkgreen     darkgreen_on_white                      white_on_darkgreen
13 "                               darkgreen_on_black      black_on_darkgreen
14 " brown         brown_on_white                          white_on_brown
15 "                               brown_on_black          black_on_brown
16 " darkblue      darkblue_on_white                       white_on_darkblue
17 "                               darkblue_on_black       black_on_darkblue
18 " darkmagenta   darkmagenta_on_white                    white_on_darkmagenta
19 "                               darkmagenta_on_black    black_on_darkmagenta
20 " darkcyan      darkcyan_on_white                       white_on_darkcyan
21 "                               darkcyan_on_black       black_on_darkcyan
22 " lightgray     lightgray_on_white                      white_on_lightgray
23 "                               lightgray_on_black      black_on_lightgray
24 " darkgray      darkgray_on_white                       white_on_darkgray
25 "                               darkgray_on_black       black_on_darkgray
26 " red           red_on_white                            white_on_red
27 "                               red_on_black            black_on_red
28 " green         green_on_white                          white_on_green
29 "                               green_on_black          black_on_green
30 " yellow        yellow_on_white                         white_on_yellow
31 "                               yellow_on_black         black_on_yellow
32 " blue          blue_on_white                           white_on_blue
33 "                               blue_on_black           black_on_blue
34 " magenta       magenta_on_white                        white_on_magenta
35 "                               magenta_on_black        black_on_magenta
36 " cyan          cyan_on_white                           white_on_cyan
37 "                               cyan_on_black           black_on_cyan
38 " white         white_on_white                          white_on_white
39 "                               white_on_black          black_on_white
40 " grey          grey_on_white                           white_on_grey
41 "                               grey_on_black           black_on_grey
42 " lightred      lightred_on_white                       white_on_lightred
43 "                               lightred_on_black       black_on_lightred
44 " lightgreen    lightgreen_on_white                     white_on_lightgreen
45 "                               lightgreen_on_black     black_on_lightgreen
46 " lightyellow   lightyellow_on_white                    white_on_lightyellow
47 "                               lightyellow_on_black    black_on_lightyellow
48 " lightblue     lightblue_on_white                      white_on_lightblue
49 "                               lightblue_on_black      black_on_lightblue
50 " lightmagenta  lightmagenta_on_white                   white_on_lightmagenta
51 "                               lightmagenta_on_black   black_on_lightmagenta
52 " lightcyan     lightcyan_on_white                      white_on_lightcyan
53 "                               lightcyan_on_black      black_on_lightcyan
55 " Open this file in a window if it isn't edited yet.
56 " Use the current window if it's empty.
57 if expand('%:p') != expand('<sfile>:p')
58   let s:fname = expand('<sfile>')
59   if exists('*fnameescape')
60     let s:fname = fnameescape(s:fname)
61   else
62     let s:fname = escape(s:fname, ' \|')
63   endif
64   if &mod || line('$') != 1 || getline(1) != ''
65     exe "new " . s:fname
66   else
67     exe "edit " . s:fname
68   endif
69   unlet s:fname
70 endif
72 syn clear
74 while search("_on_", "W") < 55
75   let col1 = substitute(expand("<cword>"), '\(\a\+\)_on_\a\+', '\1', "")
76   let col2 = substitute(expand("<cword>"), '\a\+_on_\(\a\+\)', '\1', "")
77   exec 'hi col_'.col1.'_'.col2.' ctermfg='.col1.' guifg='.col1.' ctermbg='.col2.' guibg='.col2
78   exec 'syn keyword col_'.col1.'_'.col2.' '.col1.'_on_'.col2
79 endwhile
80 8,54g/^" \a/exec 'hi col_'.expand("<cword>").' ctermfg='.expand("<cword>").' guifg='.expand("<cword>")| exec 'syn keyword col_'.expand("<cword>")." ".expand("<cword>")
81 nohlsearch