.vim/colors/jellybeans.vim

Tue, 30 Apr 2024 22:53:50 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Tue, 30 Apr 2024 22:53:50 -0500
changeset 1154
dc04a7db1e83
parent 863
c1b4166611ed
permissions
-rw-r--r--

Fix signature_help toggle

1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
1 " Vim color file
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
2 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
3 " " __ _ _ _ "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
4 " " \ \ ___| | |_ _| |__ ___ __ _ _ __ ___ "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
5 " " \ \/ _ \ | | | | | _ \ / _ \/ _ | _ \/ __| "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
6 " " /\_/ / __/ | | |_| | |_| | __/ |_| | | | \__ \ "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
7 " " \___/ \___|_|_|\__ |____/ \___|\____|_| |_|___/ "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
8 " " \___/ "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
9 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
10 " "A colorful, dark color scheme for Vim."
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
11 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
12 " File: jellybeans.vim
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
13 " URL: github.com/nanotech/jellybeans.vim
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
14 " Scripts URL: vim.org/scripts/script.php?script_id=2555
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
15 " Maintainer: NanoTech (nanotech.nanotechcorp.net)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
16 " Version: 1.7
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
17 " Last Change: June 21st, 2019
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
18 " License: MIT
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
19 " Contributors: Andrew Wong (w0ng)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
20 " Benjamin R. Haskell (benizi)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
21 " Brian Marshall (bmars)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
22 " Daniel Herbert (pocketninja)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
23 " David Liang <bmdavll at gmail dot com>
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
24 " Filipe Silva (ninrod)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
25 " Henry So, Jr. <henryso@panix.com>
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
26 " Ihor Kalnytskyi (ikalnytskyi)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
27 " Joe Doherty (docapotamus)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
28 " Karl Litterfeldt (Litterfeldt)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
29 " Keith Pitt (keithpitt)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
30 " Mike Schreifels (schreifels)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
31 " Philipp Rustemeier (12foo)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
32 " Rafael Bicalho (rbika)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
33 " Rich Healey (richo)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
34 " Siwen Yu (yusiwen)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
35 " Tim Willis (willist)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
36 " Tom McLaughlin (tmcoma)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
37 "
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
38 " Copyright (c) 2009-2019 NanoTech
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
39 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
40 " Permission is hereby granted, free of charge, to any per‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
41 " son obtaining a copy of this software and associated doc‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
42 " umentation files (the “Software”), to deal in the Soft‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
43 " ware without restriction, including without limitation
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
44 " the rights to use, copy, modify, merge, publish, distrib‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
45 " ute, sublicense, and/or sell copies of the Software, and
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
46 " to permit persons to whom the Software is furnished to do
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
47 " so, subject to the following conditions:
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
48 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
49 " The above copyright notice and this permission notice
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
50 " shall be included in all copies or substantial portions
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
51 " of the Software.
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
52 "
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
53 " THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
54 " KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
55 " THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICU‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
56 " LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
57 " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
58 " DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
59 " TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON‐
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
60 " NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
61 " THE SOFTWARE.
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
62
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
63 set background=dark
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
64
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
65 hi clear
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
66
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
67 if exists("syntax_on")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
68 syntax reset
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
69 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
70
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
71 let colors_name = "jellybeans"
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
72
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
73 if has("gui_running") || (has('termguicolors') && &termguicolors)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
74 let s:true_color = 1
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
75 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
76 let s:true_color = 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
77 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
78
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
79 if s:true_color || &t_Co >= 88
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
80 let s:low_color = 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
81 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
82 let s:low_color = 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
83 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
84
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
85 " Configuration Variables:
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
86 " - g:jellybeans_overrides (default = {})
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
87 " - g:jellybeans_use_lowcolor_black (default = 0)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
88 " - g:jellybeans_use_gui_italics (default = 1)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
89 " - g:jellybeans_use_term_italics (default = 0)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
90
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
91 let s:background_color = "151515"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
92
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
93 if exists("g:jellybeans_overrides")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
94 let s:overrides = g:jellybeans_overrides
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
95 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
96 let s:overrides = {}
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
97 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
98
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
99 " Backwards compatibility
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
100 if exists("g:jellybeans_background_color")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
101 \ || exists("g:jellybeans_background_color_256")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
102 \ || exists("g:jellybeans_use_term_background_color")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
103
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
104 let s:overrides = deepcopy(s:overrides)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
105
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
106 if !has_key(s:overrides, "background")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
107 let s:overrides["background"] = {}
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
108 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
109
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
110 if exists("g:jellybeans_background_color")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
111 let s:overrides["background"]["guibg"] = g:jellybeans_background_color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
112 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
113
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
114 if exists("g:jellybeans_background_color_256")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
115 let s:overrides["background"]["256ctermbg"] = g:jellybeans_background_color_256
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
116 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
117
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
118 if exists("g:jellybeans_use_term_background_color")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
119 \ && g:jellybeans_use_term_background_color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
120 let s:overrides["background"]["ctermbg"] = "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
121 let s:overrides["background"]["256ctermbg"] = "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
122 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
123 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
124
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
125 if exists("g:jellybeans_use_lowcolor_black") && g:jellybeans_use_lowcolor_black
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
126 let s:termBlack = "Black"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
127 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
128 let s:termBlack = "Grey"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
129 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
130
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
131 " When `termguicolors` is set, Vim[^1] ignores `hi Normal guibg=NONE`
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
132 " after Normal's `guibg` is already set to a color. See:
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
133 "
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
134 " - https://github.com/vim/vim/issues/981
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
135 " - https://github.com/nanotech/jellybeans.vim/issues/64
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
136 "
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
137 " To work around this, ensure we don't set the default background
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
138 " color before an override changes it to `NONE` by ensuring that the
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
139 " background color isn't set to a value different from its override.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
140 "
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
141 " [^1]: Tested on 8.0.567. Does not apply to Neovim.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
142 "
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
143 if has_key(s:overrides, "background") && has_key(s:overrides["background"], "guibg")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
144 let s:background_color = s:overrides["background"]["guibg"]
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
145 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
146
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
147 " Color approximation functions by Henry So, Jr. and David Liang {{{
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
148 " Added to jellybeans.vim by Daniel Herbert
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
149
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
150 if &t_Co == 88
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
151
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
152 " returns an approximate grey index for the given grey level
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
153 fun! s:grey_number(x)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
154 if a:x < 23
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
155 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
156 elseif a:x < 69
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
157 return 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
158 elseif a:x < 103
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
159 return 2
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
160 elseif a:x < 127
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
161 return 3
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
162 elseif a:x < 150
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
163 return 4
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
164 elseif a:x < 173
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
165 return 5
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
166 elseif a:x < 196
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
167 return 6
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
168 elseif a:x < 219
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
169 return 7
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
170 elseif a:x < 243
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
171 return 8
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
172 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
173 return 9
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
174 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
175 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
176
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
177 " returns the actual grey level represented by the grey index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
178 fun! s:grey_level(n)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
179 if a:n == 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
180 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
181 elseif a:n == 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
182 return 46
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
183 elseif a:n == 2
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
184 return 92
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
185 elseif a:n == 3
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
186 return 115
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
187 elseif a:n == 4
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
188 return 139
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
189 elseif a:n == 5
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
190 return 162
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
191 elseif a:n == 6
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
192 return 185
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
193 elseif a:n == 7
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
194 return 208
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
195 elseif a:n == 8
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
196 return 231
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
197 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
198 return 255
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
199 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
200 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
201
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
202 " returns the palette index for the given grey index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
203 fun! s:grey_color(n)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
204 if a:n == 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
205 return 16
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
206 elseif a:n == 9
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
207 return 79
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
208 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
209 return 79 + a:n
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
210 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
211 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
212
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
213 " returns an approximate color index for the given color level
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
214 fun! s:rgb_number(x)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
215 if a:x < 69
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
216 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
217 elseif a:x < 172
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
218 return 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
219 elseif a:x < 230
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
220 return 2
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
221 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
222 return 3
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
223 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
224 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
225
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
226 " returns the actual color level for the given color index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
227 fun! s:rgb_level(n)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
228 if a:n == 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
229 return 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
230 elseif a:n == 1
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
231 return 139
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
232 elseif a:n == 2
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
233 return 205
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
234 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
235 return 255
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
236 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
237 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
238
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
239 " returns the palette index for the given R/G/B color indices
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
240 fun! s:rgb_color(x, y, z)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
241 return 16 + (a:x * 16) + (a:y * 4) + a:z
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
242 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
243
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
244 else " assuming &t_Co == 256
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
245
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
246 " returns an approximate grey index for the given grey level
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
247 fun! s:grey_number(x)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
248 if a:x < 14
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
249 return 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
250 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
251 let l:n = (a:x - 8) / 10
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
252 let l:m = (a:x - 8) % 10
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
253 if l:m < 5
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
254 return l:n
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
255 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
256 return l:n + 1
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
257 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
258 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
259 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
260
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
261 " returns the actual grey level represented by the grey index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
262 fun! s:grey_level(n)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
263 if a:n == 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
264 return 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
265 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
266 return 8 + (a:n * 10)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
267 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
268 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
269
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
270 " returns the palette index for the given grey index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
271 fun! s:grey_color(n)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
272 if a:n == 0
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
273 return 16
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
274 elseif a:n == 25
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
275 return 231
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
276 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
277 return 231 + a:n
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
278 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
279 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
280
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
281 " returns an approximate color index for the given color level
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
282 fun! s:rgb_number(x)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
283 if a:x < 75
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
284 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
285 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
286 let l:n = (a:x - 55) / 40
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
287 let l:m = (a:x - 55) % 40
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
288 if l:m < 20
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
289 return l:n
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
290 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
291 return l:n + 1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
292 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
293 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
294 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
295
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
296 " returns the actual color level for the given color index
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
297 fun! s:rgb_level(n)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
298 if a:n == 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
299 return 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
300 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
301 return 55 + (a:n * 40)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
302 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
303 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
304
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
305 " returns the palette index for the given R/G/B color indices
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
306 fun! s:rgb_color(x, y, z)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
307 return 16 + (a:x * 36) + (a:y * 6) + a:z
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
308 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
309
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
310 endif
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
311
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
312 " returns the palette index to approximate the given R/G/B color levels
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
313 fun! s:color(r, g, b)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
314 " map greys directly (see xterm's 256colres.pl)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
315 if &t_Co == 256 && a:r == a:g && a:g == a:b && a:r > 3 && a:r < 243
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
316 return (a:r - 8) / 10 + 232
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
317 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
318
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
319 " get the closest grey
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
320 let l:gx = s:grey_number(a:r)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
321 let l:gy = s:grey_number(a:g)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
322 let l:gz = s:grey_number(a:b)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
323
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
324 " get the closest color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
325 let l:x = s:rgb_number(a:r)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
326 let l:y = s:rgb_number(a:g)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
327 let l:z = s:rgb_number(a:b)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
328
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
329 if l:gx == l:gy && l:gy == l:gz
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
330 " there are two possibilities
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
331 let l:dgr = s:grey_level(l:gx) - a:r
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
332 let l:dgg = s:grey_level(l:gy) - a:g
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
333 let l:dgb = s:grey_level(l:gz) - a:b
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
334 let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
335 let l:dr = s:rgb_level(l:gx) - a:r
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
336 let l:dg = s:rgb_level(l:gy) - a:g
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
337 let l:db = s:rgb_level(l:gz) - a:b
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
338 let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
339 if l:dgrey < l:drgb
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
340 " use the grey
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
341 return s:grey_color(l:gx)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
342 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
343 " use the color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
344 return s:rgb_color(l:x, l:y, l:z)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
345 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
346 else
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
347 " only one possibility
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
348 return s:rgb_color(l:x, l:y, l:z)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
349 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
350 endfun
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
351
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
352 fun! s:is_empty_or_none(str)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
353 return empty(a:str) || a:str ==? "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
354 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
355
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
356 " returns the palette index to approximate the 'rrggbb' hex string
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
357 fun! s:rgb(rgb)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
358 if s:is_empty_or_none(a:rgb)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
359 return "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
360 endif
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
361 let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
362 let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
363 let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
364 return s:color(l:r, l:g, l:b)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
365 endfun
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
366
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
367 fun! s:prefix_highlight_value_with(prefix, color)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
368 if s:is_empty_or_none(a:color)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
369 return "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
370 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
371 return a:prefix . a:color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
372 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
373 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
374
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
375 fun! s:remove_italic_attr(attr)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
376 let l:attr = join(filter(split(a:attr, ","), "v:val !=? 'italic'"), ",")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
377 if empty(l:attr)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
378 let l:attr = "NONE"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
379 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
380 return l:attr
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
381 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
382
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
383 " sets the highlighting for the given group
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
384 fun! s:X(group, fg, bg, attr, lcfg, lcbg)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
385 if s:low_color
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
386 let l:cmd = "hi ".a:group.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
387 \ " ctermfg=".s:prefix_highlight_value_with("", a:lcfg).
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
388 \ " ctermbg=".s:prefix_highlight_value_with("", a:lcbg)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
389 else
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
390 let l:cmd = "hi ".a:group.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
391 \ " guifg=".s:prefix_highlight_value_with("#", a:fg).
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
392 \ " guibg=".s:prefix_highlight_value_with("#", a:bg)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
393 if !s:true_color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
394 let l:cmd = l:cmd.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
395 \ " ctermfg=".s:rgb(a:fg).
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
396 \ " ctermbg=".s:rgb(a:bg)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
397 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
398 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
399
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
400 let l:attr = s:prefix_highlight_value_with("", a:attr)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
401
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
402 if exists("g:jellybeans_use_term_italics") && g:jellybeans_use_term_italics
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
403 let l:cterm_attr = l:attr
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
404 else
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
405 let l:cterm_attr = s:remove_italic_attr(l:attr)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
406 endif
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
407
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
408 if !exists("g:jellybeans_use_gui_italics") || g:jellybeans_use_gui_italics
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
409 let l:gui_attr = l:attr
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
410 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
411 let l:gui_attr = s:remove_italic_attr(l:attr)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
412 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
413
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
414 let l:cmd = l:cmd." gui=".l:gui_attr." cterm=".l:cterm_attr
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
415 exec l:cmd
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
416 endfun
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
417 " }}}
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
418
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
419 call s:X("Normal","e8e8d3",s:background_color,"","White","")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
420 set background=dark
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
421
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
422 call s:X("CursorLine","","1c1c1c","","",s:termBlack)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
423 call s:X("CursorColumn","","1c1c1c","","",s:termBlack)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
424
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
425 " Some of Terminal.app's default themes have a cursor color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
426 " too close to Jellybeans' preferred MatchParen background
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
427 " color to be easily distinguishable. Other terminals tend
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
428 " to use a brighter cursor color.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
429 "
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
430 " Use a more distinct color in Terminal.app, and also in
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
431 " low-color terminals if the preferred background color is
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
432 " not available.
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
433 if !has('gui_running') && $TERM_PROGRAM == "Apple_Terminal"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
434 let s:matchParenGuiFg = "dd0093"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
435 let s:matchParenGuiBg = "000000"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
436 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
437 let s:matchParenGuiFg = "ffffff"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
438 let s:matchParenGuiBg = "556779"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
439 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
440 if s:termBlack != "Black"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
441 let s:matchParenTermFg = "Magenta"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
442 let s:matchParenTermBg = ""
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
443 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
444 let s:matchParenTermFg = ""
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
445 let s:matchParenTermBg = s:termBlack
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
446 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
447 call s:X("MatchParen",s:matchParenGuiFg,s:matchParenGuiBg,"bold",
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
448 \ s:matchParenTermFg,s:matchParenTermBg)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
449
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
450 call s:X("TabLine","000000","b0b8c0","italic","",s:termBlack)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
451 call s:X("TabLineFill","9098a0","","","",s:termBlack)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
452 call s:X("TabLineSel","000000","f0f0f0","italic,bold",s:termBlack,"White")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
453
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
454 " Auto-completion
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
455 call s:X("Pmenu","ffffff","606060","","White",s:termBlack)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
456 call s:X("PmenuSel","101010","eeeeee","",s:termBlack,"White")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
457
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
458 call s:X("Visual","","404040","","",s:termBlack)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
459 call s:X("Cursor",s:background_color,"b0d0f0","","","")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
460
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
461 call s:X("LineNr","605958",s:background_color,"NONE",s:termBlack,"")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
462 call s:X("CursorLineNr","ccc5c4","","NONE","White","")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
463 call s:X("Comment","888888","","italic","Grey","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
464 call s:X("Todo","c7c7c7","","bold","White",s:termBlack)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
465
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
466 call s:X("StatusLine","000000","dddddd","italic","","White")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
467 call s:X("StatusLineNC","ffffff","403c41","italic","White","Black")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
468 call s:X("VertSplit","777777","403c41","",s:termBlack,s:termBlack)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
469 call s:X("WildMenu","f0a0c0","302028","","Magenta","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
470
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
471 call s:X("Folded","a0a8b0","384048","italic",s:termBlack,"")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
472 call s:X("FoldColumn","535D66","1f1f1f","","",s:termBlack)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
473 call s:X("SignColumn","777777","333333","","",s:termBlack)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
474 call s:X("ColorColumn","","000000","","",s:termBlack)
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
475
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
476 call s:X("Title","70b950","","bold","Green","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
477
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
478 call s:X("Constant","cf6a4c","","","Red","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
479 call s:X("Special","799d6a","","","Green","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
480 call s:X("Delimiter","668799","","","Grey","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
481
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
482 call s:X("String","99ad6a","","","Green","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
483 call s:X("StringDelimiter","556633","","","DarkGreen","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
484
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
485 call s:X("Identifier","c6b6ee","","","LightCyan","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
486 call s:X("Structure","8fbfdc","","","LightCyan","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
487 call s:X("Function","fad07a","","","Yellow","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
488 call s:X("Statement","8197bf","","","DarkBlue","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
489 call s:X("PreProc","8fbfdc","","","LightBlue","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
490
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
491 hi! link Operator Structure
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
492 hi! link Conceal Operator
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
493
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
494 call s:X("Type","ffb964","","","Yellow","")
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
495 call s:X("NonText","606060",s:background_color,"",s:termBlack,"")
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
496
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
497 call s:X("SpecialKey","444444","1c1c1c","",s:termBlack,"")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
498
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
499 call s:X("Search","f0a0c0","302028","underline","Magenta","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
500
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
501 call s:X("Directory","dad085","","","Yellow","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
502 call s:X("ErrorMsg","","902020","","","DarkRed")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
503 hi! link Error ErrorMsg
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
504 hi! link MoreMsg Special
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
505 call s:X("Question","65C254","","","Green","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
506
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
507
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
508 " Spell Checking
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
509
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
510 call s:X("SpellBad","","902020","underline","","DarkRed")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
511 call s:X("SpellCap","","0000df","underline","","Blue")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
512 call s:X("SpellRare","","540063","underline","","DarkMagenta")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
513 call s:X("SpellLocal","","2D7067","underline","","Green")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
514
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
515 " Diff
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
516
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
517 hi! link diffRemoved Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
518 hi! link diffAdded String
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
519
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
520 " VimDiff
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
521
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
522 call s:X("DiffAdd","D2EBBE","437019","","White","DarkGreen")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
523 call s:X("DiffDelete","40000A","700009","","DarkRed","DarkRed")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
524 call s:X("DiffChange","","2B5B77","","White","DarkBlue")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
525 call s:X("DiffText","8fbfdc","000000","reverse","Yellow","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
526
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
527 " PHP
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
528
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
529 hi! link phpFunctions Function
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
530 call s:X("StorageClass","c59f6f","","","Red","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
531 hi! link phpSuperglobal Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
532 hi! link phpQuoteSingle StringDelimiter
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
533 hi! link phpQuoteDouble StringDelimiter
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
534 hi! link phpBoolean Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
535 hi! link phpNull Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
536 hi! link phpArrayPair Operator
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
537 hi! link phpOperator Normal
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
538 hi! link phpRelation Normal
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
539 hi! link phpVarSelector Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
540
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
541 " Python
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
542
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
543 hi! link pythonOperator Statement
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
544
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
545 " Ruby
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
546
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
547 hi! link rubySharpBang Comment
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
548 call s:X("rubyClass","447799","","","DarkBlue","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
549 call s:X("rubyIdentifier","c6b6fe","","","Cyan","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
550 hi! link rubyConstant Type
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
551 hi! link rubyFunction Function
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
552
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
553 call s:X("rubyInstanceVariable","c6b6fe","","","Cyan","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
554 call s:X("rubySymbol","7697d6","","","Blue","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
555 hi! link rubyGlobalVariable rubyInstanceVariable
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
556 hi! link rubyModule rubyClass
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
557 call s:X("rubyControl","7597c6","","","Blue","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
558
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
559 hi! link rubyString String
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
560 hi! link rubyStringDelimiter StringDelimiter
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
561 hi! link rubyInterpolationDelimiter Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
562
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
563 call s:X("rubyRegexpDelimiter","540063","","","Magenta","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
564 call s:X("rubyRegexp","dd0093","","","DarkMagenta","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
565 call s:X("rubyRegexpSpecial","a40073","","","Magenta","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
566
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
567 call s:X("rubyPredefinedIdentifier","de5577","","","Red","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
568
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
569 " Erlang
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
570
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
571 hi! link erlangAtom rubySymbol
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
572 hi! link erlangBIF rubyPredefinedIdentifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
573 hi! link erlangFunction rubyPredefinedIdentifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
574 hi! link erlangDirective Statement
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
575 hi! link erlangNode Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
576
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
577 " Elixir
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
578
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
579 hi! link elixirAtom rubySymbol
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
580
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
581
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
582 " JavaScript
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
583
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
584 hi! link javaScriptValue Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
585 hi! link javaScriptRegexpString rubyRegexp
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
586 hi! link javaScriptTemplateVar StringDelim
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
587 hi! link javaScriptTemplateDelim Identifier
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
588 hi! link javaScriptTemplateString String
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
589
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
590 " CoffeeScript
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
591
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
592 hi! link coffeeRegExp javaScriptRegexpString
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
593
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
594 " Lua
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
595
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
596 hi! link luaOperator Conditional
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
597
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
598 " C
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
599
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
600 hi! link cFormat Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
601 hi! link cOperator Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
602
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
603 " Objective-C/Cocoa
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
604
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
605 hi! link objcClass Type
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
606 hi! link cocoaClass objcClass
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
607 hi! link objcSubclass objcClass
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
608 hi! link objcSuperclass objcClass
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
609 hi! link objcDirective rubyClass
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
610 hi! link objcStatement Constant
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
611 hi! link cocoaFunction Function
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
612 hi! link objcMethodName Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
613 hi! link objcMethodArg Normal
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
614 hi! link objcMessageName Identifier
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
615
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
616 " Vimscript
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
617
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
618 hi! link vimOper Normal
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
619
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
620 " HTML
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
621
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
622 hi! link htmlTag Statement
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
623 hi! link htmlEndTag htmlTag
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
624 hi! link htmlTagName htmlTag
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
625
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
626 " XML
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
627
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
628 hi! link xmlTag Statement
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
629 hi! link xmlEndTag xmlTag
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
630 hi! link xmlTagName xmlTag
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
631 hi! link xmlEqual xmlTag
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
632 hi! link xmlEntity Special
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
633 hi! link xmlEntityPunct xmlEntity
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
634 hi! link xmlDocTypeDecl PreProc
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
635 hi! link xmlDocTypeKeyword PreProc
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
636 hi! link xmlProcessingDelim xmlAttrib
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
637
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
638 " Debugger.vim
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
639
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
640 call s:X("DbgCurrent","DEEBFE","345FA8","","White","DarkBlue")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
641 call s:X("DbgBreakPt","","4F0037","","","DarkMagenta")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
642
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
643 " vim-indent-guides
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
644
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
645 if !exists("g:indent_guides_auto_colors")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
646 let g:indent_guides_auto_colors = 0
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
647 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
648 call s:X("IndentGuidesOdd","","232323","","","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
649 call s:X("IndentGuidesEven","","1b1b1b","","","")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
650
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
651 " Plugins, etc.
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
652
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
653 hi! link TagListFileName Directory
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
654 call s:X("PreciseJumpTarget","B9ED67","405026","","White","Green")
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
655
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
656 " Manual overrides for 256-color terminals. Dark colors auto-map badly.
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
657 if !s:low_color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
658 hi StatusLineNC ctermbg=235
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
659 hi Folded ctermbg=236
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
660 hi DiffText ctermfg=81
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
661 hi DbgBreakPt ctermbg=53
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
662 hi IndentGuidesOdd ctermbg=235
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
663 hi IndentGuidesEven ctermbg=234
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
664 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
665
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
666 if !empty("s:overrides")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
667 fun! s:current_attr(group)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
668 let l:synid = synIDtrans(hlID(a:group))
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
669 let l:attrs = []
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
670 for l:attr in ["bold", "italic", "reverse", "standout", "underline", "undercurl"]
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
671 if synIDattr(l:synid, l:attr, "gui") == 1
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
672 call add(l:attrs, l:attr)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
673 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
674 endfor
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
675 return join(l:attrs, ",")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
676 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
677 fun! s:current_color(group, what, mode)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
678 let l:color = synIDattr(synIDtrans(hlID(a:group)), a:what, a:mode)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
679 if l:color == -1
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
680 return ""
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
681 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
682 return substitute(l:color, "^#", "", "")
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
683 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
684 endfun
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
685 fun! s:load_color_def(group, def)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
686 call s:X(a:group, get(a:def, "guifg", s:current_color(a:group, "fg", "gui")),
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
687 \ get(a:def, "guibg", s:current_color(a:group, "bg", "gui")),
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
688 \ get(a:def, "attr", s:current_attr(a:group)),
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
689 \ get(a:def, "ctermfg", s:current_color(a:group, "fg", "cterm")),
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
690 \ get(a:def, "ctermbg", s:current_color(a:group, "bg", "cterm")))
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
691 if !s:low_color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
692 for l:prop in ["ctermfg", "ctermbg"]
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
693 let l:override_key = "256".l:prop
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
694 if has_key(a:def, l:override_key)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
695 exec "hi ".a:group." ".l:prop."=".a:def[l:override_key]
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
696 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
697 endfor
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
698 endif
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
699 endfun
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
700 fun! s:load_colors(defs)
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
701 for [l:group, l:def] in items(a:defs)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
702 if l:group == "background"
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
703 call s:load_color_def("LineNr", l:def)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
704 call s:load_color_def("NonText", l:def)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
705 call s:load_color_def("Normal", l:def)
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
706 else
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
707 call s:load_color_def(l:group, l:def)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
708 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
709 unlet l:group
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
710 unlet l:def
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
711 endfor
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
712 endfun
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
713 call s:load_colors(s:overrides)
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
714 delf s:load_colors
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
715 delf s:load_color_def
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
716 delf s:current_color
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
717 delf s:current_attr
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
718 endif
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
719
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
720 " delete functions {{{
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
721 delf s:X
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
722 delf s:remove_italic_attr
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
723 delf s:prefix_highlight_value_with
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
724 delf s:rgb
863
c1b4166611ed update jellybeans!
Meredith Howard <mhoward@roomag.org>
parents: 1
diff changeset
725 delf s:is_empty_or_none
1
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
726 delf s:color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
727 delf s:rgb_color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
728 delf s:rgb_level
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
729 delf s:rgb_number
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
730 delf s:grey_color
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
731 delf s:grey_level
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
732 delf s:grey_number
727a469263f2 Add dotfiles
Meredith Howard <mhoward@roomag.org>
parents:
diff changeset
733 " }}}

mercurial