xonecas.io
314
Vc

vim-colors-256 / files

vim-colors-256 / colors / seoul256.vim

14.0 KB
1" "  _____             _ ___ ___ ___      "
2" " |   __|___ ___ _ _| |_  |  _|  _|     "
3" " |__   | -_| . | | | |  _|_  | . |     "
4" " |_____|___|___|___|_|___|___|___|.vim "
5"
6" " Low-contrast dark Vim color scheme using Seoul Colors "
7"
8" File:         seoul256.vim
9" URL:          github.com/junegunn/seoul256.vim
10" Author:       Junegunn Choi (junegunn.c@gmail.com)
11" Version:      1.5.3
12" Last Updated: Aug 4, 2014
13" License:      MIT
14"
15" Copyright (c) 2013 Junegunn Choi
16"
17" MIT License
18"
19" Permission is hereby granted, free of charge, to any person obtaining
20" a copy of this software and associated documentation files (the
21" "Software"), to deal in the Software without restriction, including
22" without limitation the rights to use, copy, modify, merge, publish,
23" distribute, sublicense, and/or sell copies of the Software, and to
24" permit persons to whom the Software is furnished to do so, subject to
25" the following conditions:
26"
27" The above copyright notice and this permission notice shall be
28" included in all copies or substantial portions of the Software.
29"
30" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
38if !exists('s:rgb_map')
39  let s:rgb_map = {
40  \ 'NONE': 'NONE',
41  \ 16: "#000000", 17: "#0C0077", 18: "#14009F", 19: "#1B00C5", 20: "#2200E8",
42  \ 21: "#2900FF", 22: "#007600", 23: "#007475", 24: "#00739E", 25: "#0071C3",
43  \ 26: "#006EE7", 27: "#006BFF", 28: "#009E00", 29: "#009D72", 30: "#009C9C",
44  \ 31: "#009AC2", 32: "#0098E6", 33: "#0096FF", 34: "#00C300", 35: "#00C26F",
45  \ 36: "#00C19A", 37: "#00C0C1", 38: "#00BFE5", 39: "#00BDFF", 40: "#00E600",
46  \ 41: "#00E56B", 42: "#00E497", 43: "#00E3BF", 44: "#00E2E3", 45: "#00E1FF",
47  \ 46: "#00FF00", 47: "#00FF66", 48: "#00FF94", 49: "#00FFBC", 50: "#00FFE1",
48  \ 51: "#00FFFF", 52: "#7F0000", 53: "#800075", 54: "#81009E", 55: "#8200C3",
49  \ 56: "#8300E7", 57: "#8500FF", 58: "#717400", 59: "#727272", 60: "#73709C",
50  \ 61: "#746EC2", 62: "#766CE6", 63: "#7868FF", 64: "#629C00", 65: "#639B6F",
51  \ 66: "#649A9A", 67: "#6698C1", 68: "#6897E5", 69: "#6A95FF", 70: "#49C200",
52  \ 71: "#4BC16C", 72: "#4DC098", 73: "#4FBFBF", 74: "#52BDE3", 75: "#54BCFF",
53  \ 76: "#07E500", 77: "#12E468", 78: "#18E395", 79: "#1EE2BD", 80: "#25E1E2",
54  \ 81: "#2BE0FF", 82: "#00FF00", 83: "#00FF63", 84: "#00FF92", 85: "#00FFBB",
55  \ 86: "#00FFE0", 87: "#00FFFF", 88: "#AA0000", 89: "#AA0072", 90: "#AB009C",
56  \ 91: "#AC00C2", 92: "#AD00E6", 93: "#AE00FF", 94: "#A07200", 95: "#A1706F",
57  \ 96: "#A16E9A", 97: "#A26CC1", 98: "#A369E5", 99: "#A566FF", 100: "#979B00",
58  \ 101: "#989A6D", 102: "#989898", 103: "#9997BF", 104: "#9A95E4", 105: "#9C93FF",
59  \ 106: "#8AC000", 107: "#8BC06A", 108: "#8CBF96", 109: "#8DBEBE", 110: "#8EBCE2",
60  \ 111: "#90BBFF", 112: "#79E400", 113: "#7AE365", 114: "#7BE294", 115: "#7CE1BC",
61  \ 116: "#7DE0E1", 117: "#7FDFFF", 118: "#5FFF00", 119: "#60FF60", 120: "#62FF90",
62  \ 121: "#63FFBA", 122: "#65FFDF", 123: "#67FFFF", 124: "#D10000", 125: "#D2006F",
63  \ 126: "#D2009A", 127: "#D300C1", 128: "#D300E5", 129: "#D400FF", 130: "#CA6F00",
64  \ 131: "#CA6D6C", 132: "#CB6B98", 133: "#CC69BF", 134: "#CC66E3", 135: "#CD63FF",
65  \ 136: "#C39900", 137: "#C4986A", 138: "#C49796", 139: "#C595BE", 140: "#C693E2",
66  \ 141: "#C791FF", 142: "#BABF00", 143: "#BBBE66", 144: "#BCBD94", 145: "#BCBCBC",
67  \ 146: "#BDBBE1", 147: "#BEB9FF", 148: "#AFE300", 149: "#B0E262", 150: "#B0E191",
68  \ 151: "#B1E0BA", 152: "#B2DFE0", 153: "#B3DEFF", 154: "#A0FF00", 155: "#A1FF5C",
69  \ 156: "#A2FF8E", 157: "#A2FFB8", 158: "#A3FFDE", 159: "#A5FFFF", 160: "#F60000",
70  \ 161: "#F7006B", 162: "#F70097", 163: "#F800BF", 164: "#F800E3", 165: "#F900FF",
71  \ 166: "#F16C00", 167: "#F16A68", 168: "#F16895", 169: "#F265BD", 170: "#F363E2",
72  \ 171: "#F35FFF", 172: "#EB9700", 173: "#EC9565", 174: "#EC9494", 175: "#ED93BC",
73  \ 176: "#ED91E1", 177: "#EE8FFF", 178: "#E4BD00", 179: "#E5BC62", 180: "#E5BC91",
74  \ 181: "#E6BBBA", 182: "#E7B9E0", 183: "#E7B8FF", 184: "#DCE100", 185: "#DCE15D",
75  \ 186: "#DDE08F", 187: "#DDDFB8", 188: "#DEDEDE", 189: "#DFDDFF", 190: "#D1FF00",
76  \ 191: "#D2FF57", 192: "#D2FF8B", 193: "#D3FFB6", 194: "#D4FFDC", 195: "#D4FFFF",
77  \ 196: "#FF0000", 197: "#FF0066", 198: "#FF0094", 199: "#FF00BC", 200: "#FF00E1",
78  \ 201: "#FF00FF", 202: "#FF6700", 203: "#FF6563", 204: "#FF6392", 205: "#FF61BB",
79  \ 206: "#FF5EE0", 207: "#FF5AFF", 208: "#FF9400", 209: "#FF9360", 210: "#FF9291",
80  \ 211: "#FF90BA", 212: "#FF8EDF", 213: "#FF8CFF", 214: "#FFBB00", 215: "#FFBA5C",
81  \ 216: "#FFBA8E", 217: "#FFB9B8", 218: "#FFB7DE", 219: "#FFB6FF", 220: "#FFE000",
82  \ 221: "#FFDF57", 222: "#FFDE8B", 223: "#FFDDB6", 224: "#FFDCDC", 225: "#FFDBFF",
83  \ 226: "#FCFF00", 227: "#FCFF51", 228: "#FDFF88", 229: "#FDFFB4", 230: "#FEFFDA",
84  \ 231: "#FEFEFE", 232: "#060606", 233: "#171717", 234: "#252525", 235: "#323232",
85  \ 236: "#3F3F3F", 237: "#4A4A4A", 238: "#565656", 239: "#606060", 240: "#6B6B6B",
86  \ 241: "#757575", 242: "#7F7F7F", 243: "#888888", 244: "#929292", 245: "#9B9B9B",
87  \ 246: "#A4A4A4", 247: "#ADADAD", 248: "#B6B6B6", 249: "#BFBFBF", 250: "#C7C7C7",
88  \ 251: "#D0D0D0", 252: "#D8D8D8", 253: "#E0E0E0", 254: "#E9E9E9", 255: "#F1F1F1"
89  \ }
90endif
91
92let s:background  = &background
93let s:colors_name = get(g:, 'colors_name', '')
94
95silent! unlet s:style s:seoul256_background
96
97" 1. If g:seoul256_background is found
98if exists('g:seoul256_background')
99  let s:seoul256_background = g:seoul256_background
100  if s:seoul256_background >= 233 && s:seoul256_background <= 239
101    let s:style = 'dark'
102  elseif s:seoul256_background >= 252 && s:seoul256_background <= 256
103    let s:style = 'light'
104  else
105    unlet s:seoul256_background
106  endif
107endif
108
109if !exists('s:style')
110  " 2. If g:colors_name is NOT 'seoul256' -> dark version
111  if s:colors_name != 'seoul256'
112    let s:style = 'dark'
113  " 3. Follow &background setting
114  else
115    let s:style = &background
116  endif
117endif
118let s:style_idx = s:style == 'light'
119
120" Background colors
121if s:style == 'dark'
122  let s:dark_bg  = get(s:, 'seoul256_background', 237)
123  let s:light_bg = 253
124else
125  let s:dark_bg  = 237
126  let s:light_bg = get(s:, 'seoul256_background', 253)
127endif
128let s:dark_bg_2 = s:dark_bg > 233 ? s:dark_bg - 2 : 16
129let s:light_bg_1 = min([s:light_bg + 1, 256])
130let s:light_bg_2 = min([s:light_bg + 2, 256])
131
132" Foreground colors
133let s:dark_fg = 252
134let s:light_fg = 239
135
136function! s:hi(item, fg, bg)
137  let fg = a:fg[s:style_idx] > 255 ? 231 : a:fg[s:style_idx]
138  let bg = a:bg[s:style_idx] > 255 ? 231 : a:bg[s:style_idx]
139
140  if !empty(fg)
141    execute printf("highlight %s ctermfg=%s guifg=%s", a:item, fg, s:rgb_map[fg])
142  endif
143  if !empty(bg)
144    execute printf("highlight %s ctermbg=%s guibg=%s", a:item, bg, s:rgb_map[bg])
145  endif
146endfunction
147
148let s:gui = has('gui_running')
149if !s:gui
150  set t_Co=256
151end
152
153silent! unlet g:colors_name
154hi clear
155if exists("syntax_on")
156  syntax reset
157endif
158
159call s:hi('Normal', [s:dark_fg, s:light_fg], [s:dark_bg, s:light_bg])
160
161call s:hi('LineNr', [101, 101], [s:dark_bg + 1, s:light_bg - 2])
162call s:hi('Visual', ['', ''], [23, 152])
163call s:hi('VisualNOS', ['', ''], [23, 152])
164
165call s:hi('Comment', [65, 65], ['', ''])
166call s:hi('Number', [222, 95], ['', ''])
167call s:hi('Float', [222, 95], ['', ''])
168call s:hi('Boolean', [103, 168], ['', ''])
169call s:hi('String', [109, 30], ['', ''])
170call s:hi('Constant', [73, 23], ['', ''])
171call s:hi('Character', [174, 168], ['', ''])
172call s:hi('Delimiter', [137, 94], ['', ''])
173call s:hi('StringDelimiter', [137, 94], ['', ''])
174call s:hi('Statement', [108, 66], ['', ''])
175" case, default, etc.
176" hi Label ctermfg=
177
178" if else end
179call s:hi('Conditional', [110, 31], ['', ''])
180
181" while end
182call s:hi('Repeat', [68, 67], ['', ''])
183call s:hi('Todo', [161, 125], [s:dark_bg_2, s:light_bg_2])
184call s:hi('Function', [187, 58], ['', ''])
185
186" Macros
187call s:hi('Define', [173, 131], ['', ''])
188call s:hi('Macro', [173, 131], ['', ''])
189call s:hi('Include', [173, 131], ['', ''])
190call s:hi('PreCondit', [173, 131], ['', ''])
191
192
193" #!
194call s:hi('PreProc', [143, 58], ['', ''])
195
196" @abc
197call s:hi('Identifier', [217, 96], ['', ''])
198
199" AAA Abc
200call s:hi('Type', [179, 94], ['', ''])
201
202" + - * / <<
203call s:hi('Operator', [186, 131], ['', ''])
204
205" super yield
206call s:hi('Keyword', [168, 168], ['', ''])
207
208" raise
209call s:hi('Exception', [161, 161], ['', ''])
210"
211" hi StorageClass ctermfg=
212call s:hi('Structure', [116, 23], ['', ''])
213" hi Typedef ctermfg=
214
215call s:hi('Error', [s:dark_fg, s:light_bg_1], [52, 174])
216call s:hi('ErrorMsg', [s:dark_fg, s:light_bg_1], [52, 168])
217call s:hi('Underlined', [181, 168], ['', ''])
218
219" set textwidth=80
220" set colorcolumn=+1
221call s:hi('ColorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 2])
222
223" GVIM only
224" hi Cursor ctermfg=
225" hi CursorIM ctermfg=
226
227" set cursorline cursorcolumn
228call s:hi('CursorLine', ['', ''], [s:dark_bg - 1, s:light_bg - 1])
229call s:hi('CursorLineNr', [131, 131], [s:dark_bg - 1, s:light_bg - 1])
230call s:hi('CursorColumn', ['', ''], [s:dark_bg - 1, s:light_bg - 1])
231
232call s:hi('Directory', [187, 95], ['', ''])
233
234call s:hi('DiffAdd',    ['NONE', 'NONE'], [22, 151])
235call s:hi('DiffDelete', ['NONE', 'NONE'], [95, 181])
236call s:hi('DiffChange', ['NONE', 'NONE'], [s:dark_bg + 3, 189])
237call s:hi('DiffText',   ['NONE', 'NONE'], [52, 224])
238
239call s:hi('VertSplit', [s:dark_bg_2, s:light_bg - 3], [s:dark_bg_2, s:light_bg - 3])
240call s:hi('Folded', [101, 101], [s:dark_bg + 1, s:light_bg - 2])
241
242" set foldcolumn=1
243call s:hi('FoldColumn', [144, 94], [s:dark_bg + 1, s:light_bg - 2])
244
245call s:hi('MatchParen', ['', ''], [s:dark_bg + 3, s:light_bg - 3])
246
247" -- INSERT --
248call s:hi('ModeMsg', [173, 173], ['', ''])
249
250" let &showbreak = '> '
251call s:hi('NonText', [101, 101], ['', ''])
252
253call s:hi('MoreMsg', [173, 173], ['', ''])
254
255" Popup menu
256call s:hi('Pmenu', [s:dark_bg + 1, 238], [224, 224])
257call s:hi('PmenuSel', [s:dark_fg, s:dark_fg], [89, 89])
258call s:hi('PmenuSbar', ['', ''], [65, 65])
259call s:hi('PmenuThumb', ['', ''], [23, 23])
260
261call s:hi('Search', [s:dark_fg, 255], [24, 74])
262call s:hi('IncSearch', [220, 220], [s:dark_bg + 1, 238])
263
264" String delimiter, interpolation
265call s:hi('Special', [216, 173], ['', ''])
266" hi SpecialChar ctermfg=
267" hi SpecialComment ctermfg=
268" hi Tag ctermfg=
269" hi Debug ctermfg=
270
271" :map, listchars
272call s:hi('SpecialKey', [59, 145], ['', ''])
273
274if !s:gui
275  " Red / Blue / Cyan / Magenta
276  if s:style_idx == 0
277    hi SpellBad   ctermbg=NONE cterm=underline ctermfg=168
278    hi SpellCap   ctermbg=NONE cterm=underline ctermfg=110
279    hi SpellLocal ctermbg=NONE cterm=underline ctermfg=153
280    hi SpellRare  ctermbg=NONE cterm=underline ctermfg=218
281  else
282    hi SpellBad   ctermbg=NONE cterm=underline ctermfg=125
283    hi SpellCap   ctermbg=NONE cterm=underline ctermfg=25
284    hi SpellLocal ctermbg=NONE cterm=underline ctermfg=31
285    hi SpellRare  ctermbg=NONE cterm=underline ctermfg=96
286  endif
287else
288  if s:style_idx == 0
289    execute 'hi SpellBad   gui=underline guisp=' . s:rgb_map[168]
290    execute 'hi SpellCap   gui=underline guisp=' . s:rgb_map[110]
291    execute 'hi SpellLocal gui=underline guisp=' . s:rgb_map[153]
292    execute 'hi SpellRare  gui=underline guisp=' . s:rgb_map[218]
293  else
294    execute 'hi SpellBad   gui=underline guisp=' . s:rgb_map[125]
295    execute 'hi SpellCap   gui=underline guisp=' . s:rgb_map[25]
296    execute 'hi SpellLocal gui=underline guisp=' . s:rgb_map[31]
297    execute 'hi SpellRare  gui=underline guisp=' . s:rgb_map[96]
298  endif
299endif
300
301"
302call s:hi('StatusLine', [95, 95], [187, 187])
303call s:hi('StatusLineNC', [s:dark_bg + 2, s:light_bg - 2], [187, 238])
304call s:hi('TabLineFill', [s:dark_bg + 2, s:light_bg - 2], ['', ''])
305call s:hi('TabLineSel', [187, 187], [23, 66])
306call s:hi('TabLine', [s:dark_bg + 12, s:light_bg - 12], [s:dark_bg + 4, s:light_bg - 4])
307call s:hi('WildMenu', [95, 95], [184, 184])
308
309" :set all
310call s:hi('Title', [181, 88], ['', ''])
311
312" TODO
313call s:hi('Question', [179, 88], ['', ''])
314
315" Search hit bottom
316call s:hi('WarningMsg', [179, 88], ['', ''])
317
318" Sign column
319call s:hi('SignColumn', [173, 173], [s:dark_bg, s:light_bg])
320
321" Diff
322call s:hi('diffAdded',   [108, 65], ['', ''])
323call s:hi('diffRemoved', [174, 131], ['', ''])
324hi link diffLine Constant
325
326call s:hi('Conceal', [s:dark_fg + 2, s:light_fg - 2], [s:dark_bg - 1, s:light_bg + 2])
327call s:hi('Ignore',  [s:dark_bg + 3, s:light_bg - 3], [s:dark_bg, s:light_bg])
328
329"""""""""""""""""""""""""""""""""""""""""""""""""
330" Plugins
331"""""""""""""""""""""""""""""""""""""""""""""""""
332
333" vim-indent-guides
334" -----------------
335let g:indent_guides_auto_colors = 0
336call s:hi('IndentGuidesOdd', ['', ''], [s:dark_bg - 1, s:light_bg + 1])
337call s:hi('IndentGuidesEven', ['', ''], [s:dark_bg + 1, s:light_bg - 1])
338
339" vim-gitgutter
340" -------------
341call s:hi('GitGutterAdd', [108, 65], ['', ''])
342call s:hi('GitGutterChange', [68, 68], ['', ''])
343call s:hi('GitGutterDelete', [161, 161], ['', ''])
344call s:hi('GitGutterChangeDelete', [168, 168], ['', ''])
345
346" http://vim.wikia.com/wiki/Highlight_unwanted_spaces     
347" ---------------------------------------------------^^^^^
348call s:hi('ExtraWhitespace', ['', ''], [s:dark_bg - 1, s:light_bg - 2])
349
350" vim-ruby
351" --------
352" " rubySymbol
353let ruby_operators = 1
354call s:hi('rubyClass', [31, 31], ['', ''])
355" call s:hi('rubyInstanceVariable', [189, 189], ['', ''])
356call s:hi('rubyRegexp', [186, 101], ['', ''])
357call s:hi('rubyRegexpDelimiter', [168, 168], ['', ''])
358call s:hi('rubyArrayDelimiter', [67, 38], ['', ''])
359call s:hi('rubyBlockParameterList', [186, 94], ['', ''])
360call s:hi('rubyCurlyBlockDelimiter', [144, 101], ['', ''])
361
362" ARGV $stdout
363call s:hi('rubyPredefinedIdentifier', [230, 52], ['', ''])
364" hi rubyRegexpSpecial
365
366hi CursorLine cterm=NONE
367hi CursorLineNr cterm=NONE
368
369let g:seoul256_current_fg = [s:dark_fg, s:light_fg][s:style_idx]
370let g:seoul256_current_bg = [s:dark_bg, s:light_bg][s:style_idx]
371let g:colors_name = 'seoul256'
372if s:colors_name != g:colors_name || s:background == s:style
373  let &background = s:style
374else
375  let &background = s:background
376endif