2018-10-23 commit, with vim-pathogen

This commit is contained in:
trey 2018-10-23 19:13:25 -04:00
parent 1d67b40d1c
commit 7193782b0f
214 changed files with 44511 additions and 0 deletions

921
CSApprox.vim Executable file
View File

@ -0,0 +1,921 @@
" CSApprox: Make gvim-only colorschemes Just Work terminal vim
" Maintainer: Matthew Wozniski (godlygeek@gmail.com)
" Date: Fri, 14 Sep 2012 01:12:13 -0400
" Version: 4.00
" History: :help csapprox-changelog
"
" Long Description:
" It's hard to find colorschemes for terminal Vim. Most colorschemes are
" written to only support GVim, and don't work at all in terminal Vim.
"
" This plugin makes GVim-only colorschemes Just Work in terminal Vim, as long
" as the terminal supports 88 or 256 colors - and most do these days. This
" usually requires no user interaction (but see below for what to do if things
" don't Just Work). After getting this plugin happily installed, any time you
" use :colorscheme it will do its magic and make the colorscheme Just Work.
"
" Whenever you change colorschemes using the :colorscheme command this script
" will be executed. It will take the colors that the scheme specified for use
" in the GUI and use an approximation algorithm to try to gracefully degrade
" them to the closest color available in your terminal. If you are running in
" a GUI or if your terminal doesn't support 88 or 256 colors, no changes are
" made. Also, no changes will be made if the colorscheme seems to have been
" high color already.
"
" License:
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" {>1} Basic plugin setup
" {>2} Check preconditions
" Quit if the user doesn't want or need us or is missing the gui feature. We
" need +gui to be able to check the gui color settings; vim doesn't bother to
" store them if it is not built with +gui.
if exists('g:CSApprox_loaded')
finish
elseif !has('gui') && v:version < 703
" Vim versions less than < 7.3.0 need +gui.
" Warn unless the user set g:CSApprox_verbose_level to zero.
if get(g:, 'CSApprox_verbose_level', 1)
echomsg "CSApprox needs gui support - not loading."
echomsg " See :help |csapprox-+gui| for possible workarounds."
endif
finish
endif
" {1} Mark us as loaded, and disable all compatibility options for now.
let g:CSApprox_loaded = 1
let s:savecpo = &cpo
set cpo&vim
" {>1} Collect info for the set highlights
" {>2} Determine if synIDattr is usable
" synIDattr() couldn't support 'guisp' until 7.2.052. This function returns
" true if :redir is needed to find the 'guisp' attribute, false if synIDattr()
" is functional. This test can be overridden by setting the global variable
" g:CSApprox_redirfallback to 1 (to force use of :redir) or to 0 (to force use
" of synIDattr()).
function! s:NeedRedirFallback()
if !exists("g:CSApprox_redirfallback")
let g:CSApprox_redirfallback = (v:version == 702 && !has('patch52'))
\ || v:version < 702
endif
return g:CSApprox_redirfallback
endfunction
" {>2} Collect and store the highlights
" Get a dictionary containing information for every highlight group not merely
" linked to another group. Return value is a dictionary, with highlight group
" numbers for keys and values that are dictionaries with four keys each,
" 'name', 'term', 'cterm', and 'gui'. 'name' holds the group name, and each
" of the others holds highlight information for that particular mode.
function! s:Highlights(modes)
let rv = {}
let i = 0
while 1
let i += 1
" Only interested in groups that exist and aren't linked
if synIDtrans(i) == 0
break
endif
" Handle vim bug allowing groups with name == "" to be created
if synIDtrans(i) != i || len(synIDattr(i, "name")) == 0
continue
endif
let rv[i] = {}
let rv[i].name = synIDattr(i, "name")
for where in a:modes
let rv[i][where] = {}
for attr in s:PossibleAttributes()
let rv[i][where][attr] = synIDattr(i, attr, where)
endfor
for attr in [ "fg", "bg" ]
let rv[i][where][attr] = synIDattr(i, attr.'#', where)
endfor
if where == "gui"
let rv[i][where]["sp"] = s:SynGuiSp(i, rv[i].name)
else
let rv[i][where]["sp"] = -1
endif
for attr in [ "fg", "bg", "sp" ]
if rv[i][where][attr] == -1
let rv[i][where][attr] = ''
endif
endfor
endfor
endwhile
return rv
endfunction
" {>2} Retrieve guisp
" Get guisp using whichever method is specified by _redir_fallback
function! s:SynGuiSp(idx, name)
if !s:NeedRedirFallback()
return s:SynGuiSpAttr(a:idx)
else
return s:SynGuiSpRedir(a:name)
endif
endfunction
" {>3} Implementation for retrieving guisp with redir hack
function! s:SynGuiSpRedir(name)
redir => temp
exe 'sil hi ' . a:name
redir END
let temp = matchstr(temp, 'guisp=\zs.*')
if len(temp) == 0 || temp[0] =~ '\s'
let temp = ""
else
" Make sure we can handle guisp='dark red'
let temp = substitute(temp, '[\x00].*', '', '')
let temp = substitute(temp, '\s*\(c\=term\|gui\).*', '', '')
let temp = substitute(temp, '\s*$', '', '')
endif
return temp
endfunction
" {>3} Implementation for retrieving guisp with synIDattr()
function! s:SynGuiSpAttr(idx)
return synIDattr(a:idx, 'sp#', 'gui')
endfunction
" {>1} Handle color names
" Place to store rgb.txt name to color mappings - lazy loaded if needed
let s:rgb = {}
" {>2} Builtin gui color names
" gui_x11.c and gui_gtk_x11.c have some default colors names that are searched
" if the x server doesn't know about a color. If 'showrgb' is available,
" we'll default to using these color names and values, and overwrite them with
" other values if 'showrgb' tells us about those colors.
let s:rgb_defaults = { "lightred" : "#FFBBBB",
\ "lightgreen" : "#88FF88",
\ "lightmagenta" : "#FFBBFF",
\ "darkcyan" : "#008888",
\ "darkblue" : "#0000BB",
\ "darkred" : "#BB0000",
\ "darkmagenta" : "#BB00BB",
\ "darkgrey" : "#BBBBBB",
\ "darkyellow" : "#BBBB00",
\ "gray10" : "#1A1A1A",
\ "grey10" : "#1A1A1A",
\ "gray20" : "#333333",
\ "grey20" : "#333333",
\ "gray30" : "#4D4D4D",
\ "grey30" : "#4D4D4D",
\ "gray40" : "#666666",
\ "grey40" : "#666666",
\ "gray50" : "#7F7F7F",
\ "grey50" : "#7F7F7F",
\ "gray60" : "#999999",
\ "grey60" : "#999999",
\ "gray70" : "#B3B3B3",
\ "grey70" : "#B3B3B3",
\ "gray80" : "#CCCCCC",
\ "grey80" : "#CCCCCC",
\ "gray90" : "#E5E5E5",
\ "grey90" : "#E5E5E5" }
" {>2} Colors that vim will use by name in one of the default schemes, either
" for bg=light or for bg=dark. This lets us avoid loading the entire rgb.txt
" database when the scheme itself doesn't ask for colors by name.
let s:rgb_presets = { "black" : "#000000",
\ "blue" : "#0000ff",
\ "brown" : "#a52a2a",
\ "cyan" : "#00ffff",
\ "darkblue" : "#00008b",
\ "darkcyan" : "#008b8b",
\ "darkgrey" : "#a9a9a9",
\ "darkmagenta" : "#8b008b",
\ "green" : "#00ff00",
\ "grey" : "#bebebe",
\ "grey40" : "#666666",
\ "grey90" : "#e5e5e5",
\ "lightblue" : "#add8e6",
\ "lightcyan" : "#e0ffff",
\ "lightgrey" : "#d3d3d3",
\ "lightmagenta" : "#ffbbff",
\ "magenta" : "#ff00ff",
\ "red" : "#ff0000",
\ "seagreen" : "#2e8b57",
\ "white" : "#ffffff",
\ "yellow" : "#ffff00" }
" {>2} Find available color names
" Find the valid named colors. By default, use our own rgb list, but try to
" retrieve the system's list if g:CSApprox_use_showrgb is set to true. Store
" the color names and color values to the dictionary s:rgb - the keys are
" color names (in lowercase), the values are strings representing color values
" (as '#rrggbb').
function! s:UpdateRgbHash()
try
if !exists("g:CSApprox_use_showrgb") || !g:CSApprox_use_showrgb
throw "Not using showrgb"
endif
" We want to use the 'showrgb' program, if it's around
let lines = split(system('showrgb'), '\n')
if v:shell_error || !exists('lines') || empty(lines)
throw "'showrgb' didn't give us an rgb.txt"
endif
let s:rgb = copy(s:rgb_defaults)
" fmt is (blanks?)(red)(blanks)(green)(blanks)(blue)(blanks)(name)
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(\d\+\)\s\+\(.*\)$'
for line in lines
let v = matchlist(line, parsepat)
if len(v) < 0
throw "CSApprox: Bad RGB line: " . string(line)
endif
let s:rgb[tolower(v[4])] = printf("#%02x%02x%02x", v[1], v[2], v[3])
endfor
catch
try
let s:rgb = csapprox#rgb()
catch
echohl ErrorMsg
echomsg "Can't call rgb() from autoload/csapprox.vim"
echomsg "Named colors will not be available!"
echohl None
endtry
endtry
return 0
endfunction
" {>1} Derive and set cterm attributes
" {>2} List of all possible attributes
function! s:PossibleAttributes()
return [ "bold", "italic", "reverse", "underline", "undercurl" ]
endfunction
" {>2} Attribute overrides
" Allow the user to override a specified attribute with another attribute.
" For example, the default is to map 'italic' to 'underline' (since many
" terminals cannot display italic text, and gvim itself will replace italics
" with underlines where italicizing is impossible), and to replace 'sp' with
" 'fg' (since terminals can't use one color for the underline and another for
" the foreground, we color the entire word). This default can of course be
" overridden by the user, by setting g:CSApprox_attr_map. This map must be
" a dictionary of string keys, representing the same attributes that synIDattr
" can look up, to string values, representing the attribute mapped to or an
" empty string to disable the given attribute entirely.
function! s:attr_map(attr)
let rv = get(g:CSApprox_attr_map, a:attr, a:attr)
return rv
endfunction
function! s:NormalizeAttrMap(map)
let old = copy(a:map)
let new = filter(a:map, '0')
let valid_attrs = [ 'bg', 'fg', 'sp' ] + s:PossibleAttributes()
let colorattrs = [ 'fg', 'bg', 'sp' ]
for olhs in keys(old)
if olhs ==? 'inverse'
let nlhs = 'reverse'
endif
let orhs = old[olhs]
if orhs ==? 'inverse'
let nrhs = 'reverse'
endif
let nlhs = tolower(olhs)
let nrhs = tolower(orhs)
try
if index(valid_attrs, nlhs) == -1
echomsg "CSApprox: Bad attr map (removing unrecognized attribute " . olhs . ")"
elseif nrhs != '' && index(valid_attrs, nrhs) == -1
echomsg "CSApprox: Bad attr map (removing unrecognized attribute " . orhs . ")"
elseif nrhs != '' && !!(index(colorattrs, nlhs)+1) != !!(index(colorattrs, nrhs)+1)
echomsg "CSApprox: Bad attr map (removing " . olhs . "; type mismatch with " . orhs . ")"
elseif nrhs == 'sp'
echomsg "CSApprox: Bad attr map (removing " . olhs . "; can't map to 'sp')"
else
let new[nlhs] = nrhs
endif
catch
echo v:exception
endtry
endfor
endfunction
" {>2} Normalize the GUI settings of a highlight group
" If the Normal group is cleared, set it to gvim's default, black on white
" Though this would be a really weird thing for a scheme to do... *shrug*
function! s:FixupGuiInfo(highlights)
if a:highlights[s:hlid_normal].gui.bg == ''
let a:highlights[s:hlid_normal].gui.bg = 'white'
endif
if a:highlights[s:hlid_normal].gui.fg == ''
let a:highlights[s:hlid_normal].gui.fg = 'black'
endif
endfunction
" {>2} Map gui settings to cterm settings
" Given information about a highlight group, replace the cterm settings with
" the mapped gui settings, applying any attribute overrides along the way. In
" particular, this gives special treatment to the 'reverse' attribute and the
" 'guisp' attribute. In particular, if the 'reverse' attribute is set for
" gvim, we unset it for the terminal and instead set ctermfg to match guibg
" and vice versa, since terminals can consider a 'reverse' flag to mean using
" default-bg-on-default-fg instead of current-bg-on-current-fg. We also
" ensure that the 'sp' attribute is never set for cterm, since no terminal can
" handle that particular highlight. If the user wants to display the guisp
" color, he should map it to either 'fg' or 'bg' using g:CSApprox_attr_map.
function! s:FixupCtermInfo(highlights)
for hl in values(a:highlights)
if !has_key(hl, 'cterm')
let hl["cterm"] = {}
endif
" Find attributes to be set in the terminal
for attr in s:PossibleAttributes()
let hl.cterm[attr] = ''
if hl.gui[attr] == 1
if s:attr_map(attr) != ''
let hl.cterm[ s:attr_map(attr) ] = 1
endif
endif
endfor
for color in [ "bg", "fg" ]
let eff_color = color
if hl.cterm['reverse']
let eff_color = (color == 'bg' ? 'fg' : 'bg')
endif
let hl.cterm[color] = get(hl.gui, s:attr_map(eff_color), '')
endfor
if hl.gui['sp'] != '' && s:attr_map('sp') != ''
let hl.cterm[s:attr_map('sp')] = hl.gui['sp']
endif
if exists("g:CSApprox_fake_reverse") && g:CSApprox_fake_reverse
if hl.cterm['reverse'] && hl.cterm.bg == ''
let hl.cterm.bg = 'fg'
endif
if hl.cterm['reverse'] && hl.cterm.fg == ''
let hl.cterm.fg = 'bg'
endif
if hl.cterm['reverse']
let hl.cterm.reverse = ''
endif
endif
endfor
endfunction
" {>2} Kludge around inability to reference autoload functions
function! s:DefaultApproximator(...)
return call('csapprox#per_component#Approximate', a:000)
endfunction
" {>2} Set cterm colors for a highlight group
" Given the information for a single highlight group (ie, the value of
" one of the items in s:Highlights() already normalized with s:FixupCtermInfo
" and s:FixupGuiInfo), handle matching the gvim colors to the closest cterm
" colors by calling the appropriate approximator as specified with the
" g:CSApprox_approximator_function variable and set the colors and attributes
" appropriately to match the gui.
function! s:SetCtermFromGui(hl)
let hl = a:hl
" Set up the default approximator function, if needed
if !exists("g:CSApprox_approximator_function")
let g:CSApprox_approximator_function = function("s:DefaultApproximator")
endif
" Clear existing highlights
exe 'hi ' . hl.name . ' cterm=NONE ctermbg=NONE ctermfg=NONE'
for which in [ 'bg', 'fg' ]
let val = hl.cterm[which]
" Skip unset colors
if val == -1 || val == ""
continue
endif
" Try translating anything but 'fg', 'bg', #rrggbb, and rrggbb from an
" rgb.txt color to a #rrggbb color
if val !~? '^[fb]g$' && val !~ '^#\=\x\{6}$'
try
" First see if it is in our preset-by-vim rgb list
let val = s:rgb_presets[tolower(val)]
catch
" Then try loading and checking our real rgb list
if empty(s:rgb)
call s:UpdateRgbHash()
endif
try
let val = s:rgb[tolower(val)]
catch
" And then barf if we still haven't found it
if &verbose
echomsg "CSApprox: Colorscheme uses unknown color \"" . val . "\""
endif
continue
endtry
endtry
endif
if val =~? '^[fb]g$'
exe 'hi ' . hl.name . ' cterm' . which . '=' . val
let hl.cterm[which] = val
elseif val =~ '^#\=\x\{6}$'
let val = substitute(val, '^#', '', '')
let r = str2nr(val[0:1], 16)
let g = str2nr(val[2:3], 16)
let b = str2nr(val[4:5], 16)
let hl.cterm[which] = g:CSApprox_approximator_function(r, g, b)
exe 'hi ' . hl.name . ' cterm' . which . '=' . hl.cterm[which]
else
throw "Internal error handling color: " . val
endif
endfor
" Finally, set the attributes
let attrs = s:PossibleAttributes()
call filter(attrs, 'hl.cterm[v:val] == 1')
if !empty(attrs)
exe 'hi ' . hl.name . ' cterm=' . join(attrs, ',')
endif
endfunction
" {>1} Top-level control
" Cache the highlight ID of the normal group; it's used often and won't change
let s:hlid_normal = hlID('Normal')
" {>2} Builtin cterm color names above 15
" Vim defines some color name to high color mappings internally (see
" syntax.c:do_highlight). Since we don't want to overwrite a colorscheme that
" was actually written for a high color terminal with our choices, but have no
" way to tell if a colorscheme was written for a high color terminal, we fall
" back on guessing. If any highlight group has a cterm color set to 16 or
" higher, we assume that the user has used a high color colorscheme - unless
" that color is one of the below, which vim can set internally when a color is
" requested by name.
let s:presets_88 = []
let s:presets_88 += [32] " Brown
let s:presets_88 += [72] " DarkYellow
let s:presets_88 += [84] " Gray
let s:presets_88 += [84] " Grey
let s:presets_88 += [82] " DarkGray
let s:presets_88 += [82] " DarkGrey
let s:presets_88 += [43] " LightBlue
let s:presets_88 += [61] " LightGreen
let s:presets_88 += [63] " LightCyan
let s:presets_88 += [74] " LightRed
let s:presets_88 += [75] " LightMagenta
let s:presets_88 += [78] " LightYellow
let s:presets_256 = []
let s:presets_256 += [130] " Brown
let s:presets_256 += [130] " DarkYellow
let s:presets_256 += [248] " Gray
let s:presets_256 += [248] " Grey
let s:presets_256 += [242] " DarkGray
let s:presets_256 += [242] " DarkGrey
let s:presets_256 += [ 81] " LightBlue
let s:presets_256 += [121] " LightGreen
let s:presets_256 += [159] " LightCyan
let s:presets_256 += [224] " LightRed
let s:presets_256 += [225] " LightMagenta
let s:presets_256 += [229] " LightYellow
" {>2} Wrapper around :exe to allow :executing multiple commands.
" "cmd" is the command to be :executed.
" If the variable is a String, it is :executed.
" If the variable is a List, each element is :executed.
function! s:exe(cmd)
if type(a:cmd) == type('')
exe a:cmd
else
for cmd in a:cmd
call s:exe(cmd)
endfor
endif
endfunction
" {>2} Function to handle hooks
" Prototype: HandleHooks(type [, scheme])
" "type" is the type of hook to be executed, ie. "pre" or "post"
" "scheme" is the name of the colorscheme that is currently active, if known
"
" If the variables g:CSApprox_hook_{type} and g:CSApprox_hook_{scheme}_{type}
" exist, this will :execute them in that order. If one does not exist, it
" will silently be ignored.
"
" If the scheme name contains characters that are invalid in a variable name,
" they will simply be removed. Ie, g:colors_name = "123 foo_bar-baz456"
" becomes "foo_barbaz456"
"
" NOTE: Exceptions will be printed out, rather than end processing early. The
" rationale is that it is worse for the user to fix the hook in an editor with
" broken colors. :)
function! s:HandleHooks(type, ...)
let type = a:type
let scheme = (a:0 == 1 ? a:1 : "")
let scheme = substitute(scheme, '[^[:alnum:]_]', '', 'g')
let scheme = substitute(scheme, '^\d\+', '', '')
for cmd in [ 'g:CSApprox_hook_' . type,
\ 'g:CSApprox_' . scheme . '_hook_' . type,
\ 'g:CSApprox_hook_' . scheme . '_' . type ]
if exists(cmd)
try
call s:exe(eval(cmd))
catch
echomsg "Error processing " . cmd . ":"
echomsg v:exception
endtry
endif
endfor
endfunction
" {>2} Main function
" Wrapper around the actual implementation to make it easier to ensure that
" all temporary settings are restored by the time we return, whether or not
" something was thrown. Additionally, sets the 'verbose' option to the max of
" g:CSApprox_verbose_level (default 1) and &verbose for the duration of the
" main function. This allows us to default to a message whenever any error,
" even a recoverable one, occurs, meaning the user quickly finds out when
" something's wrong, but makes it very easy for the user to make us silent.
function! s:CSApprox(...)
try
if a:0 == 1 && a:1
if !exists('s:inhibit_hicolor_test')
let s:inhibit_hicolor_test = 0
endif
let s:inhibit_hicolor_test += 1
endif
let savelz = &lz
set lz
if exists("g:CSApprox_attr_map") && type(g:CSApprox_attr_map) == type({})
call s:NormalizeAttrMap(g:CSApprox_attr_map)
else
let g:CSApprox_attr_map = { 'italic' : 'underline', 'sp' : 'fg' }
endif
" colors_name must be unset and reset, or vim will helpfully reload the
" colorscheme when we set the background for the Normal group.
" See the help entries ':hi-normal-cterm' and 'g:colors_name'
if exists("g:colors_name")
let colors_name = g:colors_name
unlet g:colors_name
endif
" Similarly, the global variable "syntax_cmd" must be set to something vim
" doesn't recognize, lest vim helpfully switch all colors back to the
" default whenever the Normal group is changed (in syncolor.vim)...
if exists("g:syntax_cmd")
let syntax_cmd = g:syntax_cmd
endif
let g:syntax_cmd = "PLEASE DON'T CHANGE ANY COLORS!!!"
" Set up our verbosity level, if needed.
" Default to 1, so the user can know if something's wrong.
if !exists("g:CSApprox_verbose_level")
let g:CSApprox_verbose_level = 1
endif
call s:HandleHooks("pre", (exists("colors_name") ? colors_name : ""))
let old_bg = &bg
" Set 'verbose' set to the maximum of &verbose and CSApprox_verbose_level
exe max([&vbs, g:CSApprox_verbose_level]) 'verbose call s:CSApproxImpl()'
let &bg = old_bg
call s:HandleHooks("post", (exists("colors_name") ? colors_name : ""))
finally
if exists("colors_name")
let g:colors_name = colors_name
endif
unlet g:syntax_cmd
if exists("syntax_cmd")
let g:syntax_cmd = syntax_cmd
endif
let &lz = savelz
if a:0 == 1 && a:1
let s:inhibit_hicolor_test -= 1
if s:inhibit_hicolor_test == 0
unlet s:inhibit_hicolor_test
endif
endif
endtry
endfunction
" {>2} CSApprox implementation
" Verifies that the user has not started the gui, and that vim recognizes his
" terminal as having enough colors for us to go on, then gathers the existing
" highlights and sets the cterm colors to match the gui colors for all those
" highlights (unless the colorscheme was already high-color).
function! s:CSApproxImpl()
" Return if not running in an 88/256 color terminal
if &t_Co != 256 && &t_Co != 88
if &verbose && &t_Co != ''
echomsg "CSApprox skipped; terminal only has" &t_Co "colors, not 88/256"
echomsg "Try checking :help csapprox-terminal for workarounds"
endif
return
endif
" Get the current highlight colors
let highlights = s:Highlights(["gui"])
let hinums = keys(highlights)
" Make sure that the script is not already 256 color by checking to make
" sure that no groups are set to a value above 256, unless the color they're
" set to can be set internally by vim (gotten by scraping
" color_numbers_{88,256} in syntax.c:do_highlight)
"
" XXX: s:inhibit_hicolor_test allows this test to be skipped for snapshots
if !exists("s:inhibit_hicolor_test") || !s:inhibit_hicolor_test
for hlid in hinums
for type in [ 'bg', 'fg' ]
let color = synIDattr(hlid, type, 'cterm')
if color > 15 && index(s:presets_{&t_Co}, str2nr(color)) < 0
" The value is set above 15, and wasn't set by vim.
if &verbose >= 2
echomsg 'CSApprox: Exiting - high' type 'color found for' highlights[hlid].name
endif
return
endif
endfor
endfor
endif
call s:FixupGuiInfo(highlights)
call s:FixupCtermInfo(highlights)
" We need to set the Normal group first so 'bg' and 'fg' work as colors
call insert(hinums, remove(hinums, index(hinums, string(s:hlid_normal))))
" then set each color's cterm attributes to match gui
for hlid in hinums
call s:SetCtermFromGui(highlights[hlid])
endfor
endfunction
" {>2} Write out the current colors to an 88/256 color colorscheme file.
" "file" - destination filename
" "overwrite" - overwrite an existing file
function! s:CSApproxSnapshot(file, overwrite)
let force = a:overwrite
let file = fnamemodify(a:file, ":p")
if empty(file)
throw "Bad file name: \"" . file . "\""
elseif (filewritable(fnamemodify(file, ':h')) != 2)
throw "Cannot write to directory \"" . fnamemodify(file, ':h') . "\""
elseif (glob(file) || filereadable(file)) && !force
" TODO - respect 'confirm' here and prompt if it's set.
echohl ErrorMsg
echomsg "E13: File exists (add ! to override)"
echohl None
return
endif
" Sigh... This is basically a bug, but one that I have no chance of fixing.
" Vim decides that Pmenu should be highlighted in 'LightMagenta' in terminal
" vim and as 'Magenta' in gvim... And I can't ask it what color it actually
" *wants*. As far as I can see, there's no way for me to learn that
" I should output 'Magenta' when 'LightMagenta' is provided by vim for the
" terminal.
if !has('gui_running')
echohl WarningMsg
echomsg "Warning: The written colorscheme may have incorrect colors"
echomsg " when CSApproxSnapshot is used in terminal vim!"
echohl None
endif
let save_t_Co = &t_Co
let s:inhibit_hicolor_test = 1
if exists("g:CSApprox_konsole")
let save_CSApprox_konsole = g:CSApprox_konsole
endif
if exists("g:CSApprox_eterm")
let save_CSApprox_eterm = g:CSApprox_eterm
endif
" Needed just like in CSApprox()
if exists("g:colors_name")
let colors_name = g:colors_name
unlet g:colors_name
endif
" Needed just like in CSApprox()
if exists("g:syntax_cmd")
let syntax_cmd = g:syntax_cmd
endif
let g:syntax_cmd = "PLEASE DON'T CHANGE ANY COLORS!!!"
try
let lines = []
let lines += [ '" This scheme was created by CSApproxSnapshot' ]
let lines += [ '" on ' . strftime("%a, %d %b %Y") ]
let lines += [ '' ]
let lines += [ 'hi clear' ]
let lines += [ 'if exists("syntax_on")' ]
let lines += [ ' syntax reset' ]
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'if v:version < 700' ]
let lines += [ ' let g:colors_name = expand("<sfile>:t:r")' ]
let lines += [ ' command! -nargs=+ CSAHi exe "hi" substitute(substitute(<q-args>, "undercurl", "underline", "g"), "guisp\\S\\+", "", "g")' ]
let lines += [ 'else' ]
let lines += [ ' let g:colors_name = expand("<sfile>:t:r")' ]
let lines += [ ' command! -nargs=+ CSAHi exe "hi" <q-args>' ]
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'function! s:old_kde()' ]
let lines += [ ' " Konsole only used its own palette up til KDE 4.2.0' ]
let lines += [ " if executable('kde4-config') && system('kde4-config --kde-version') =~ '^4\.[10]\.'" ]
let lines += [ ' return 1' ]
let lines += [ " elseif executable('kde-config') && system('kde-config --version') =~# 'KDE: 3\.'" ]
let lines += [ ' return 1' ]
let lines += [ ' else' ]
let lines += [ ' return 0' ]
let lines += [ ' endif' ]
let lines += [ 'endfunction' ]
let lines += [ '' ]
let lines += [ 'if 0' ]
for round in [ 'konsole', 'eterm', 'xterm', 'urxvt' ]
sil! unlet g:CSApprox_eterm
sil! unlet g:CSApprox_konsole
if round == 'konsole'
let g:CSApprox_konsole = 1
elseif round == 'eterm'
let g:CSApprox_eterm = 1
endif
if round == 'urxvt'
set t_Co=88
else
set t_Co=256
endif
call s:CSApprox()
let highlights = s:Highlights(["term", "cterm", "gui"])
call s:FixupGuiInfo(highlights)
if round == 'konsole' || round == 'eterm'
if round == 'konsole'
let term_matches_round = '(&term =~? "^konsole" && s:old_kde())'
else
let term_matches_round = '&term =~? "^' . round . '"'
endif
let lines += [ 'elseif has("gui_running") || (&t_Co == ' . &t_Co
\ . ' && (&term ==# "xterm" || &term =~# "^screen")'
\ . ' && exists("g:CSApprox_' . round . '")'
\ . ' && g:CSApprox_' . round . ')'
\ . ' || ' . term_matches_round ]
else
let lines += [ 'elseif has("gui_running") || &t_Co == ' . &t_Co ]
endif
let hinums = keys(highlights)
call insert(hinums, remove(hinums, index(hinums, string(s:hlid_normal))))
for hlnum in hinums
let hl = highlights[hlnum]
let line = ' CSAHi ' . hl.name
for type in [ 'term', 'cterm', 'gui' ]
let attrs = s:PossibleAttributes()
call filter(attrs, 'hl[type][v:val] == 1')
let line .= ' ' . type . '=' . (empty(attrs) ? 'NONE' : join(attrs, ','))
if type != 'term'
let line .= ' ' . type . 'bg=' . (len(hl[type].bg) ? hl[type].bg : 'bg')
let line .= ' ' . type . 'fg=' . (len(hl[type].fg) ? hl[type].fg : 'fg')
if type == 'gui' && hl.gui.sp !~ '^\s*$'
let line .= ' ' . type . 'sp=' . hl[type].sp
endif
endif
endfor
let lines += [ line ]
endfor
endfor
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'if 1' ]
let lines += [ ' delcommand CSAHi' ]
let lines += [ 'endif' ]
call writefile(lines, file)
finally
let &t_Co = save_t_Co
if exists("save_CSApprox_konsole")
let g:CSApprox_konsole = save_CSApprox_konsole
endif
if exists("save_CSApprox_eterm")
let g:CSApprox_eterm = save_CSApprox_eterm
endif
if exists("colors_name")
let g:colors_name = colors_name
endif
unlet g:syntax_cmd
if exists("syntax_cmd")
let g:syntax_cmd = syntax_cmd
endif
call s:CSApprox()
unlet s:inhibit_hicolor_test
endtry
endfunction
" {>2} Snapshot user command
command! -bang -nargs=1 -complete=file -bar CSApproxSnapshot
\ call s:CSApproxSnapshot(<f-args>, strlen("<bang>"))
" {>2} Manual updates
command -bang -bar CSApprox call s:CSApprox(strlen("<bang>"))
" {>1} Autocmds
" Set up an autogroup to hook us on the completion of any :colorscheme command
augroup CSApprox
au!
au ColorScheme * call s:CSApprox()
"au User CSApproxPost highlight Normal ctermbg=none | highlight NonText ctermbg=None
augroup END
" {>1} Restore compatibility options
let &cpo = s:savecpo
unlet s:savecpo
" {0} vim:sw=2:sts=2:et:fdm=expr:fde=substitute(matchstr(getline(v\:lnum),'^\\s*"\\s*{\\zs.\\{-}\\ze}'),'^$','=','')

835
CSApprox/autoload/csapprox.vim Executable file
View File

@ -0,0 +1,835 @@
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
let s:rgb = {}
let s:rgb["alice blue"] = "#f0f8ff"
let s:rgb["aliceblue"] = "#f0f8ff"
let s:rgb["antique white"] = "#faebd7"
let s:rgb["antiquewhite"] = "#faebd7"
let s:rgb["antiquewhite1"] = "#ffefdb"
let s:rgb["antiquewhite2"] = "#eedfcc"
let s:rgb["antiquewhite3"] = "#cdc0b0"
let s:rgb["antiquewhite4"] = "#8b8378"
let s:rgb["aquamarine"] = "#7fffd4"
let s:rgb["aquamarine1"] = "#7fffd4"
let s:rgb["aquamarine2"] = "#76eec6"
let s:rgb["aquamarine3"] = "#66cdaa"
let s:rgb["aquamarine4"] = "#458b74"
let s:rgb["azure"] = "#f0ffff"
let s:rgb["azure1"] = "#f0ffff"
let s:rgb["azure2"] = "#e0eeee"
let s:rgb["azure3"] = "#c1cdcd"
let s:rgb["azure4"] = "#838b8b"
let s:rgb["beige"] = "#f5f5dc"
let s:rgb["bisque"] = "#ffe4c4"
let s:rgb["bisque1"] = "#ffe4c4"
let s:rgb["bisque2"] = "#eed5b7"
let s:rgb["bisque3"] = "#cdb79e"
let s:rgb["bisque4"] = "#8b7d6b"
let s:rgb["black"] = "#000000"
let s:rgb["blanched almond"] = "#ffebcd"
let s:rgb["blanchedalmond"] = "#ffebcd"
let s:rgb["blue violet"] = "#8a2be2"
let s:rgb["blue"] = "#0000ff"
let s:rgb["blue1"] = "#0000ff"
let s:rgb["blue2"] = "#0000ee"
let s:rgb["blue3"] = "#0000cd"
let s:rgb["blue4"] = "#00008b"
let s:rgb["blueviolet"] = "#8a2be2"
let s:rgb["brown"] = "#a52a2a"
let s:rgb["brown1"] = "#ff4040"
let s:rgb["brown2"] = "#ee3b3b"
let s:rgb["brown3"] = "#cd3333"
let s:rgb["brown4"] = "#8b2323"
let s:rgb["burlywood"] = "#deb887"
let s:rgb["burlywood1"] = "#ffd39b"
let s:rgb["burlywood2"] = "#eec591"
let s:rgb["burlywood3"] = "#cdaa7d"
let s:rgb["burlywood4"] = "#8b7355"
let s:rgb["cadet blue"] = "#5f9ea0"
let s:rgb["cadetblue"] = "#5f9ea0"
let s:rgb["cadetblue1"] = "#98f5ff"
let s:rgb["cadetblue2"] = "#8ee5ee"
let s:rgb["cadetblue3"] = "#7ac5cd"
let s:rgb["cadetblue4"] = "#53868b"
let s:rgb["chartreuse"] = "#7fff00"
let s:rgb["chartreuse1"] = "#7fff00"
let s:rgb["chartreuse2"] = "#76ee00"
let s:rgb["chartreuse3"] = "#66cd00"
let s:rgb["chartreuse4"] = "#458b00"
let s:rgb["chocolate"] = "#d2691e"
let s:rgb["chocolate1"] = "#ff7f24"
let s:rgb["chocolate2"] = "#ee7621"
let s:rgb["chocolate3"] = "#cd661d"
let s:rgb["chocolate4"] = "#8b4513"
let s:rgb["coral"] = "#ff7f50"
let s:rgb["coral1"] = "#ff7256"
let s:rgb["coral2"] = "#ee6a50"
let s:rgb["coral3"] = "#cd5b45"
let s:rgb["coral4"] = "#8b3e2f"
let s:rgb["cornflower blue"] = "#6495ed"
let s:rgb["cornflowerblue"] = "#6495ed"
let s:rgb["cornsilk"] = "#fff8dc"
let s:rgb["cornsilk1"] = "#fff8dc"
let s:rgb["cornsilk2"] = "#eee8cd"
let s:rgb["cornsilk3"] = "#cdc8b1"
let s:rgb["cornsilk4"] = "#8b8878"
let s:rgb["cyan"] = "#00ffff"
let s:rgb["cyan1"] = "#00ffff"
let s:rgb["cyan2"] = "#00eeee"
let s:rgb["cyan3"] = "#00cdcd"
let s:rgb["cyan4"] = "#008b8b"
let s:rgb["dark blue"] = "#00008b"
let s:rgb["dark cyan"] = "#008b8b"
let s:rgb["dark goldenrod"] = "#b8860b"
let s:rgb["dark gray"] = "#a9a9a9"
let s:rgb["dark green"] = "#006400"
let s:rgb["dark grey"] = "#a9a9a9"
let s:rgb["dark khaki"] = "#bdb76b"
let s:rgb["dark magenta"] = "#8b008b"
let s:rgb["dark olive green"] = "#556b2f"
let s:rgb["dark orange"] = "#ff8c00"
let s:rgb["dark orchid"] = "#9932cc"
let s:rgb["dark red"] = "#8b0000"
let s:rgb["dark salmon"] = "#e9967a"
let s:rgb["dark sea green"] = "#8fbc8f"
let s:rgb["dark slate blue"] = "#483d8b"
let s:rgb["dark slate gray"] = "#2f4f4f"
let s:rgb["dark slate grey"] = "#2f4f4f"
let s:rgb["dark turquoise"] = "#00ced1"
let s:rgb["dark violet"] = "#9400d3"
let s:rgb["dark yellow"] = "#bbbb00"
let s:rgb["darkblue"] = "#00008b"
let s:rgb["darkcyan"] = "#008b8b"
let s:rgb["darkgoldenrod"] = "#b8860b"
let s:rgb["darkgoldenrod1"] = "#ffb90f"
let s:rgb["darkgoldenrod2"] = "#eead0e"
let s:rgb["darkgoldenrod3"] = "#cd950c"
let s:rgb["darkgoldenrod4"] = "#8b6508"
let s:rgb["darkgray"] = "#a9a9a9"
let s:rgb["darkgreen"] = "#006400"
let s:rgb["darkgrey"] = "#a9a9a9"
let s:rgb["darkkhaki"] = "#bdb76b"
let s:rgb["darkmagenta"] = "#8b008b"
let s:rgb["darkolivegreen"] = "#556b2f"
let s:rgb["darkolivegreen1"] = "#caff70"
let s:rgb["darkolivegreen2"] = "#bcee68"
let s:rgb["darkolivegreen3"] = "#a2cd5a"
let s:rgb["darkolivegreen4"] = "#6e8b3d"
let s:rgb["darkorange"] = "#ff8c00"
let s:rgb["darkorange1"] = "#ff7f00"
let s:rgb["darkorange2"] = "#ee7600"
let s:rgb["darkorange3"] = "#cd6600"
let s:rgb["darkorange4"] = "#8b4500"
let s:rgb["darkorchid"] = "#9932cc"
let s:rgb["darkorchid1"] = "#bf3eff"
let s:rgb["darkorchid2"] = "#b23aee"
let s:rgb["darkorchid3"] = "#9a32cd"
let s:rgb["darkorchid4"] = "#68228b"
let s:rgb["darkred"] = "#8b0000"
let s:rgb["darksalmon"] = "#e9967a"
let s:rgb["darkseagreen"] = "#8fbc8f"
let s:rgb["darkseagreen1"] = "#c1ffc1"
let s:rgb["darkseagreen2"] = "#b4eeb4"
let s:rgb["darkseagreen3"] = "#9bcd9b"
let s:rgb["darkseagreen4"] = "#698b69"
let s:rgb["darkslateblue"] = "#483d8b"
let s:rgb["darkslategray"] = "#2f4f4f"
let s:rgb["darkslategray1"] = "#97ffff"
let s:rgb["darkslategray2"] = "#8deeee"
let s:rgb["darkslategray3"] = "#79cdcd"
let s:rgb["darkslategray4"] = "#528b8b"
let s:rgb["darkslategrey"] = "#2f4f4f"
let s:rgb["darkturquoise"] = "#00ced1"
let s:rgb["darkviolet"] = "#9400d3"
let s:rgb["darkyellow"] = "#bbbb00"
let s:rgb["deep pink"] = "#ff1493"
let s:rgb["deep sky blue"] = "#00bfff"
let s:rgb["deeppink"] = "#ff1493"
let s:rgb["deeppink1"] = "#ff1493"
let s:rgb["deeppink2"] = "#ee1289"
let s:rgb["deeppink3"] = "#cd1076"
let s:rgb["deeppink4"] = "#8b0a50"
let s:rgb["deepskyblue"] = "#00bfff"
let s:rgb["deepskyblue1"] = "#00bfff"
let s:rgb["deepskyblue2"] = "#00b2ee"
let s:rgb["deepskyblue3"] = "#009acd"
let s:rgb["deepskyblue4"] = "#00688b"
let s:rgb["dim gray"] = "#696969"
let s:rgb["dim grey"] = "#696969"
let s:rgb["dimgray"] = "#696969"
let s:rgb["dimgrey"] = "#696969"
let s:rgb["dodger blue"] = "#1e90ff"
let s:rgb["dodgerblue"] = "#1e90ff"
let s:rgb["dodgerblue1"] = "#1e90ff"
let s:rgb["dodgerblue2"] = "#1c86ee"
let s:rgb["dodgerblue3"] = "#1874cd"
let s:rgb["dodgerblue4"] = "#104e8b"
let s:rgb["firebrick"] = "#b22222"
let s:rgb["firebrick1"] = "#ff3030"
let s:rgb["firebrick2"] = "#ee2c2c"
let s:rgb["firebrick3"] = "#cd2626"
let s:rgb["firebrick4"] = "#8b1a1a"
let s:rgb["floral white"] = "#fffaf0"
let s:rgb["floralwhite"] = "#fffaf0"
let s:rgb["forest green"] = "#228b22"
let s:rgb["forestgreen"] = "#228b22"
let s:rgb["gainsboro"] = "#dcdcdc"
let s:rgb["ghost white"] = "#f8f8ff"
let s:rgb["ghostwhite"] = "#f8f8ff"
let s:rgb["gold"] = "#ffd700"
let s:rgb["gold1"] = "#ffd700"
let s:rgb["gold2"] = "#eec900"
let s:rgb["gold3"] = "#cdad00"
let s:rgb["gold4"] = "#8b7500"
let s:rgb["goldenrod"] = "#daa520"
let s:rgb["goldenrod1"] = "#ffc125"
let s:rgb["goldenrod2"] = "#eeb422"
let s:rgb["goldenrod3"] = "#cd9b1d"
let s:rgb["goldenrod4"] = "#8b6914"
let s:rgb["gray"] = "#bebebe"
let s:rgb["gray0"] = "#000000"
let s:rgb["gray1"] = "#030303"
let s:rgb["gray10"] = "#1a1a1a"
let s:rgb["gray100"] = "#ffffff"
let s:rgb["gray11"] = "#1c1c1c"
let s:rgb["gray12"] = "#1f1f1f"
let s:rgb["gray13"] = "#212121"
let s:rgb["gray14"] = "#242424"
let s:rgb["gray15"] = "#262626"
let s:rgb["gray16"] = "#292929"
let s:rgb["gray17"] = "#2b2b2b"
let s:rgb["gray18"] = "#2e2e2e"
let s:rgb["gray19"] = "#303030"
let s:rgb["gray2"] = "#050505"
let s:rgb["gray20"] = "#333333"
let s:rgb["gray21"] = "#363636"
let s:rgb["gray22"] = "#383838"
let s:rgb["gray23"] = "#3b3b3b"
let s:rgb["gray24"] = "#3d3d3d"
let s:rgb["gray25"] = "#404040"
let s:rgb["gray26"] = "#424242"
let s:rgb["gray27"] = "#454545"
let s:rgb["gray28"] = "#474747"
let s:rgb["gray29"] = "#4a4a4a"
let s:rgb["gray3"] = "#080808"
let s:rgb["gray30"] = "#4d4d4d"
let s:rgb["gray31"] = "#4f4f4f"
let s:rgb["gray32"] = "#525252"
let s:rgb["gray33"] = "#545454"
let s:rgb["gray34"] = "#575757"
let s:rgb["gray35"] = "#595959"
let s:rgb["gray36"] = "#5c5c5c"
let s:rgb["gray37"] = "#5e5e5e"
let s:rgb["gray38"] = "#616161"
let s:rgb["gray39"] = "#636363"
let s:rgb["gray4"] = "#0a0a0a"
let s:rgb["gray40"] = "#666666"
let s:rgb["gray41"] = "#696969"
let s:rgb["gray42"] = "#6b6b6b"
let s:rgb["gray43"] = "#6e6e6e"
let s:rgb["gray44"] = "#707070"
let s:rgb["gray45"] = "#737373"
let s:rgb["gray46"] = "#757575"
let s:rgb["gray47"] = "#787878"
let s:rgb["gray48"] = "#7a7a7a"
let s:rgb["gray49"] = "#7d7d7d"
let s:rgb["gray5"] = "#0d0d0d"
let s:rgb["gray50"] = "#7f7f7f"
let s:rgb["gray51"] = "#828282"
let s:rgb["gray52"] = "#858585"
let s:rgb["gray53"] = "#878787"
let s:rgb["gray54"] = "#8a8a8a"
let s:rgb["gray55"] = "#8c8c8c"
let s:rgb["gray56"] = "#8f8f8f"
let s:rgb["gray57"] = "#919191"
let s:rgb["gray58"] = "#949494"
let s:rgb["gray59"] = "#969696"
let s:rgb["gray6"] = "#0f0f0f"
let s:rgb["gray60"] = "#999999"
let s:rgb["gray61"] = "#9c9c9c"
let s:rgb["gray62"] = "#9e9e9e"
let s:rgb["gray63"] = "#a1a1a1"
let s:rgb["gray64"] = "#a3a3a3"
let s:rgb["gray65"] = "#a6a6a6"
let s:rgb["gray66"] = "#a8a8a8"
let s:rgb["gray67"] = "#ababab"
let s:rgb["gray68"] = "#adadad"
let s:rgb["gray69"] = "#b0b0b0"
let s:rgb["gray7"] = "#121212"
let s:rgb["gray70"] = "#b3b3b3"
let s:rgb["gray71"] = "#b5b5b5"
let s:rgb["gray72"] = "#b8b8b8"
let s:rgb["gray73"] = "#bababa"
let s:rgb["gray74"] = "#bdbdbd"
let s:rgb["gray75"] = "#bfbfbf"
let s:rgb["gray76"] = "#c2c2c2"
let s:rgb["gray77"] = "#c4c4c4"
let s:rgb["gray78"] = "#c7c7c7"
let s:rgb["gray79"] = "#c9c9c9"
let s:rgb["gray8"] = "#141414"
let s:rgb["gray80"] = "#cccccc"
let s:rgb["gray81"] = "#cfcfcf"
let s:rgb["gray82"] = "#d1d1d1"
let s:rgb["gray83"] = "#d4d4d4"
let s:rgb["gray84"] = "#d6d6d6"
let s:rgb["gray85"] = "#d9d9d9"
let s:rgb["gray86"] = "#dbdbdb"
let s:rgb["gray87"] = "#dedede"
let s:rgb["gray88"] = "#e0e0e0"
let s:rgb["gray89"] = "#e3e3e3"
let s:rgb["gray9"] = "#171717"
let s:rgb["gray90"] = "#e5e5e5"
let s:rgb["gray91"] = "#e8e8e8"
let s:rgb["gray92"] = "#ebebeb"
let s:rgb["gray93"] = "#ededed"
let s:rgb["gray94"] = "#f0f0f0"
let s:rgb["gray95"] = "#f2f2f2"
let s:rgb["gray96"] = "#f5f5f5"
let s:rgb["gray97"] = "#f7f7f7"
let s:rgb["gray98"] = "#fafafa"
let s:rgb["gray99"] = "#fcfcfc"
let s:rgb["green yellow"] = "#adff2f"
let s:rgb["green"] = "#00ff00"
let s:rgb["green1"] = "#00ff00"
let s:rgb["green2"] = "#00ee00"
let s:rgb["green3"] = "#00cd00"
let s:rgb["green4"] = "#008b00"
let s:rgb["greenyellow"] = "#adff2f"
let s:rgb["grey"] = "#bebebe"
let s:rgb["grey0"] = "#000000"
let s:rgb["grey1"] = "#030303"
let s:rgb["grey10"] = "#1a1a1a"
let s:rgb["grey100"] = "#ffffff"
let s:rgb["grey11"] = "#1c1c1c"
let s:rgb["grey12"] = "#1f1f1f"
let s:rgb["grey13"] = "#212121"
let s:rgb["grey14"] = "#242424"
let s:rgb["grey15"] = "#262626"
let s:rgb["grey16"] = "#292929"
let s:rgb["grey17"] = "#2b2b2b"
let s:rgb["grey18"] = "#2e2e2e"
let s:rgb["grey19"] = "#303030"
let s:rgb["grey2"] = "#050505"
let s:rgb["grey20"] = "#333333"
let s:rgb["grey21"] = "#363636"
let s:rgb["grey22"] = "#383838"
let s:rgb["grey23"] = "#3b3b3b"
let s:rgb["grey24"] = "#3d3d3d"
let s:rgb["grey25"] = "#404040"
let s:rgb["grey26"] = "#424242"
let s:rgb["grey27"] = "#454545"
let s:rgb["grey28"] = "#474747"
let s:rgb["grey29"] = "#4a4a4a"
let s:rgb["grey3"] = "#080808"
let s:rgb["grey30"] = "#4d4d4d"
let s:rgb["grey31"] = "#4f4f4f"
let s:rgb["grey32"] = "#525252"
let s:rgb["grey33"] = "#545454"
let s:rgb["grey34"] = "#575757"
let s:rgb["grey35"] = "#595959"
let s:rgb["grey36"] = "#5c5c5c"
let s:rgb["grey37"] = "#5e5e5e"
let s:rgb["grey38"] = "#616161"
let s:rgb["grey39"] = "#636363"
let s:rgb["grey4"] = "#0a0a0a"
let s:rgb["grey40"] = "#666666"
let s:rgb["grey41"] = "#696969"
let s:rgb["grey42"] = "#6b6b6b"
let s:rgb["grey43"] = "#6e6e6e"
let s:rgb["grey44"] = "#707070"
let s:rgb["grey45"] = "#737373"
let s:rgb["grey46"] = "#757575"
let s:rgb["grey47"] = "#787878"
let s:rgb["grey48"] = "#7a7a7a"
let s:rgb["grey49"] = "#7d7d7d"
let s:rgb["grey5"] = "#0d0d0d"
let s:rgb["grey50"] = "#7f7f7f"
let s:rgb["grey51"] = "#828282"
let s:rgb["grey52"] = "#858585"
let s:rgb["grey53"] = "#878787"
let s:rgb["grey54"] = "#8a8a8a"
let s:rgb["grey55"] = "#8c8c8c"
let s:rgb["grey56"] = "#8f8f8f"
let s:rgb["grey57"] = "#919191"
let s:rgb["grey58"] = "#949494"
let s:rgb["grey59"] = "#969696"
let s:rgb["grey6"] = "#0f0f0f"
let s:rgb["grey60"] = "#999999"
let s:rgb["grey61"] = "#9c9c9c"
let s:rgb["grey62"] = "#9e9e9e"
let s:rgb["grey63"] = "#a1a1a1"
let s:rgb["grey64"] = "#a3a3a3"
let s:rgb["grey65"] = "#a6a6a6"
let s:rgb["grey66"] = "#a8a8a8"
let s:rgb["grey67"] = "#ababab"
let s:rgb["grey68"] = "#adadad"
let s:rgb["grey69"] = "#b0b0b0"
let s:rgb["grey7"] = "#121212"
let s:rgb["grey70"] = "#b3b3b3"
let s:rgb["grey71"] = "#b5b5b5"
let s:rgb["grey72"] = "#b8b8b8"
let s:rgb["grey73"] = "#bababa"
let s:rgb["grey74"] = "#bdbdbd"
let s:rgb["grey75"] = "#bfbfbf"
let s:rgb["grey76"] = "#c2c2c2"
let s:rgb["grey77"] = "#c4c4c4"
let s:rgb["grey78"] = "#c7c7c7"
let s:rgb["grey79"] = "#c9c9c9"
let s:rgb["grey8"] = "#141414"
let s:rgb["grey80"] = "#cccccc"
let s:rgb["grey81"] = "#cfcfcf"
let s:rgb["grey82"] = "#d1d1d1"
let s:rgb["grey83"] = "#d4d4d4"
let s:rgb["grey84"] = "#d6d6d6"
let s:rgb["grey85"] = "#d9d9d9"
let s:rgb["grey86"] = "#dbdbdb"
let s:rgb["grey87"] = "#dedede"
let s:rgb["grey88"] = "#e0e0e0"
let s:rgb["grey89"] = "#e3e3e3"
let s:rgb["grey9"] = "#171717"
let s:rgb["grey90"] = "#e5e5e5"
let s:rgb["grey91"] = "#e8e8e8"
let s:rgb["grey92"] = "#ebebeb"
let s:rgb["grey93"] = "#ededed"
let s:rgb["grey94"] = "#f0f0f0"
let s:rgb["grey95"] = "#f2f2f2"
let s:rgb["grey96"] = "#f5f5f5"
let s:rgb["grey97"] = "#f7f7f7"
let s:rgb["grey98"] = "#fafafa"
let s:rgb["grey99"] = "#fcfcfc"
let s:rgb["honeydew"] = "#f0fff0"
let s:rgb["honeydew1"] = "#f0fff0"
let s:rgb["honeydew2"] = "#e0eee0"
let s:rgb["honeydew3"] = "#c1cdc1"
let s:rgb["honeydew4"] = "#838b83"
let s:rgb["hot pink"] = "#ff69b4"
let s:rgb["hotpink"] = "#ff69b4"
let s:rgb["hotpink1"] = "#ff6eb4"
let s:rgb["hotpink2"] = "#ee6aa7"
let s:rgb["hotpink3"] = "#cd6090"
let s:rgb["hotpink4"] = "#8b3a62"
let s:rgb["indian red"] = "#cd5c5c"
let s:rgb["indianred"] = "#cd5c5c"
let s:rgb["indianred1"] = "#ff6a6a"
let s:rgb["indianred2"] = "#ee6363"
let s:rgb["indianred3"] = "#cd5555"
let s:rgb["indianred4"] = "#8b3a3a"
let s:rgb["ivory"] = "#fffff0"
let s:rgb["ivory1"] = "#fffff0"
let s:rgb["ivory2"] = "#eeeee0"
let s:rgb["ivory3"] = "#cdcdc1"
let s:rgb["ivory4"] = "#8b8b83"
let s:rgb["khaki"] = "#f0e68c"
let s:rgb["khaki1"] = "#fff68f"
let s:rgb["khaki2"] = "#eee685"
let s:rgb["khaki3"] = "#cdc673"
let s:rgb["khaki4"] = "#8b864e"
let s:rgb["lavender blush"] = "#fff0f5"
let s:rgb["lavender"] = "#e6e6fa"
let s:rgb["lavenderblush"] = "#fff0f5"
let s:rgb["lavenderblush1"] = "#fff0f5"
let s:rgb["lavenderblush2"] = "#eee0e5"
let s:rgb["lavenderblush3"] = "#cdc1c5"
let s:rgb["lavenderblush4"] = "#8b8386"
let s:rgb["lawn green"] = "#7cfc00"
let s:rgb["lawngreen"] = "#7cfc00"
let s:rgb["lemon chiffon"] = "#fffacd"
let s:rgb["lemonchiffon"] = "#fffacd"
let s:rgb["lemonchiffon1"] = "#fffacd"
let s:rgb["lemonchiffon2"] = "#eee9bf"
let s:rgb["lemonchiffon3"] = "#cdc9a5"
let s:rgb["lemonchiffon4"] = "#8b8970"
let s:rgb["light blue"] = "#add8e6"
let s:rgb["light coral"] = "#f08080"
let s:rgb["light cyan"] = "#e0ffff"
let s:rgb["light goldenrod yellow"] = "#fafad2"
let s:rgb["light goldenrod"] = "#eedd82"
let s:rgb["light gray"] = "#d3d3d3"
let s:rgb["light green"] = "#90ee90"
let s:rgb["light grey"] = "#d3d3d3"
let s:rgb["light magenta"] = "#ffbbff"
let s:rgb["light pink"] = "#ffb6c1"
let s:rgb["light red"] = "#ffbbbb"
let s:rgb["light salmon"] = "#ffa07a"
let s:rgb["light sea green"] = "#20b2aa"
let s:rgb["light sky blue"] = "#87cefa"
let s:rgb["light slate blue"] = "#8470ff"
let s:rgb["light slate gray"] = "#778899"
let s:rgb["light slate grey"] = "#778899"
let s:rgb["light steel blue"] = "#b0c4de"
let s:rgb["light yellow"] = "#ffffe0"
let s:rgb["lightblue"] = "#add8e6"
let s:rgb["lightblue1"] = "#bfefff"
let s:rgb["lightblue2"] = "#b2dfee"
let s:rgb["lightblue3"] = "#9ac0cd"
let s:rgb["lightblue4"] = "#68838b"
let s:rgb["lightcoral"] = "#f08080"
let s:rgb["lightcyan"] = "#e0ffff"
let s:rgb["lightcyan1"] = "#e0ffff"
let s:rgb["lightcyan2"] = "#d1eeee"
let s:rgb["lightcyan3"] = "#b4cdcd"
let s:rgb["lightcyan4"] = "#7a8b8b"
let s:rgb["lightgoldenrod"] = "#eedd82"
let s:rgb["lightgoldenrod1"] = "#ffec8b"
let s:rgb["lightgoldenrod2"] = "#eedc82"
let s:rgb["lightgoldenrod3"] = "#cdbe70"
let s:rgb["lightgoldenrod4"] = "#8b814c"
let s:rgb["lightgoldenrodyellow"] = "#fafad2"
let s:rgb["lightgray"] = "#d3d3d3"
let s:rgb["lightgreen"] = "#90ee90"
let s:rgb["lightgrey"] = "#d3d3d3"
let s:rgb["lightmagenta"] = "#ffbbff"
let s:rgb["lightpink"] = "#ffb6c1"
let s:rgb["lightpink1"] = "#ffaeb9"
let s:rgb["lightpink2"] = "#eea2ad"
let s:rgb["lightpink3"] = "#cd8c95"
let s:rgb["lightpink4"] = "#8b5f65"
let s:rgb["lightred"] = "#ffbbbb"
let s:rgb["lightsalmon"] = "#ffa07a"
let s:rgb["lightsalmon1"] = "#ffa07a"
let s:rgb["lightsalmon2"] = "#ee9572"
let s:rgb["lightsalmon3"] = "#cd8162"
let s:rgb["lightsalmon4"] = "#8b5742"
let s:rgb["lightseagreen"] = "#20b2aa"
let s:rgb["lightskyblue"] = "#87cefa"
let s:rgb["lightskyblue1"] = "#b0e2ff"
let s:rgb["lightskyblue2"] = "#a4d3ee"
let s:rgb["lightskyblue3"] = "#8db6cd"
let s:rgb["lightskyblue4"] = "#607b8b"
let s:rgb["lightslateblue"] = "#8470ff"
let s:rgb["lightslategray"] = "#778899"
let s:rgb["lightslategrey"] = "#778899"
let s:rgb["lightsteelblue"] = "#b0c4de"
let s:rgb["lightsteelblue1"] = "#cae1ff"
let s:rgb["lightsteelblue2"] = "#bcd2ee"
let s:rgb["lightsteelblue3"] = "#a2b5cd"
let s:rgb["lightsteelblue4"] = "#6e7b8b"
let s:rgb["lightyellow"] = "#ffffe0"
let s:rgb["lightyellow1"] = "#ffffe0"
let s:rgb["lightyellow2"] = "#eeeed1"
let s:rgb["lightyellow3"] = "#cdcdb4"
let s:rgb["lightyellow4"] = "#8b8b7a"
let s:rgb["lime green"] = "#32cd32"
let s:rgb["limegreen"] = "#32cd32"
let s:rgb["linen"] = "#faf0e6"
let s:rgb["magenta"] = "#ff00ff"
let s:rgb["magenta1"] = "#ff00ff"
let s:rgb["magenta2"] = "#ee00ee"
let s:rgb["magenta3"] = "#cd00cd"
let s:rgb["magenta4"] = "#8b008b"
let s:rgb["maroon"] = "#b03060"
let s:rgb["maroon1"] = "#ff34b3"
let s:rgb["maroon2"] = "#ee30a7"
let s:rgb["maroon3"] = "#cd2990"
let s:rgb["maroon4"] = "#8b1c62"
let s:rgb["medium aquamarine"] = "#66cdaa"
let s:rgb["medium blue"] = "#0000cd"
let s:rgb["medium orchid"] = "#ba55d3"
let s:rgb["medium purple"] = "#9370db"
let s:rgb["medium sea green"] = "#3cb371"
let s:rgb["medium slate blue"] = "#7b68ee"
let s:rgb["medium spring green"] = "#00fa9a"
let s:rgb["medium turquoise"] = "#48d1cc"
let s:rgb["medium violet red"] = "#c71585"
let s:rgb["mediumaquamarine"] = "#66cdaa"
let s:rgb["mediumblue"] = "#0000cd"
let s:rgb["mediumorchid"] = "#ba55d3"
let s:rgb["mediumorchid1"] = "#e066ff"
let s:rgb["mediumorchid2"] = "#d15fee"
let s:rgb["mediumorchid3"] = "#b452cd"
let s:rgb["mediumorchid4"] = "#7a378b"
let s:rgb["mediumpurple"] = "#9370db"
let s:rgb["mediumpurple1"] = "#ab82ff"
let s:rgb["mediumpurple2"] = "#9f79ee"
let s:rgb["mediumpurple3"] = "#8968cd"
let s:rgb["mediumpurple4"] = "#5d478b"
let s:rgb["mediumseagreen"] = "#3cb371"
let s:rgb["mediumslateblue"] = "#7b68ee"
let s:rgb["mediumspringgreen"] = "#00fa9a"
let s:rgb["mediumturquoise"] = "#48d1cc"
let s:rgb["mediumvioletred"] = "#c71585"
let s:rgb["midnight blue"] = "#191970"
let s:rgb["midnightblue"] = "#191970"
let s:rgb["mint cream"] = "#f5fffa"
let s:rgb["mintcream"] = "#f5fffa"
let s:rgb["misty rose"] = "#ffe4e1"
let s:rgb["mistyrose"] = "#ffe4e1"
let s:rgb["mistyrose1"] = "#ffe4e1"
let s:rgb["mistyrose2"] = "#eed5d2"
let s:rgb["mistyrose3"] = "#cdb7b5"
let s:rgb["mistyrose4"] = "#8b7d7b"
let s:rgb["moccasin"] = "#ffe4b5"
let s:rgb["navajo white"] = "#ffdead"
let s:rgb["navajowhite"] = "#ffdead"
let s:rgb["navajowhite1"] = "#ffdead"
let s:rgb["navajowhite2"] = "#eecfa1"
let s:rgb["navajowhite3"] = "#cdb38b"
let s:rgb["navajowhite4"] = "#8b795e"
let s:rgb["navy blue"] = "#000080"
let s:rgb["navy"] = "#000080"
let s:rgb["navyblue"] = "#000080"
let s:rgb["old lace"] = "#fdf5e6"
let s:rgb["oldlace"] = "#fdf5e6"
let s:rgb["olive drab"] = "#6b8e23"
let s:rgb["olivedrab"] = "#6b8e23"
let s:rgb["olivedrab1"] = "#c0ff3e"
let s:rgb["olivedrab2"] = "#b3ee3a"
let s:rgb["olivedrab3"] = "#9acd32"
let s:rgb["olivedrab4"] = "#698b22"
let s:rgb["orange red"] = "#ff4500"
let s:rgb["orange"] = "#ffa500"
let s:rgb["orange1"] = "#ffa500"
let s:rgb["orange2"] = "#ee9a00"
let s:rgb["orange3"] = "#cd8500"
let s:rgb["orange4"] = "#8b5a00"
let s:rgb["orangered"] = "#ff4500"
let s:rgb["orangered1"] = "#ff4500"
let s:rgb["orangered2"] = "#ee4000"
let s:rgb["orangered3"] = "#cd3700"
let s:rgb["orangered4"] = "#8b2500"
let s:rgb["orchid"] = "#da70d6"
let s:rgb["orchid1"] = "#ff83fa"
let s:rgb["orchid2"] = "#ee7ae9"
let s:rgb["orchid3"] = "#cd69c9"
let s:rgb["orchid4"] = "#8b4789"
let s:rgb["pale goldenrod"] = "#eee8aa"
let s:rgb["pale green"] = "#98fb98"
let s:rgb["pale turquoise"] = "#afeeee"
let s:rgb["pale violet red"] = "#db7093"
let s:rgb["palegoldenrod"] = "#eee8aa"
let s:rgb["palegreen"] = "#98fb98"
let s:rgb["palegreen1"] = "#9aff9a"
let s:rgb["palegreen2"] = "#90ee90"
let s:rgb["palegreen3"] = "#7ccd7c"
let s:rgb["palegreen4"] = "#548b54"
let s:rgb["paleturquoise"] = "#afeeee"
let s:rgb["paleturquoise1"] = "#bbffff"
let s:rgb["paleturquoise2"] = "#aeeeee"
let s:rgb["paleturquoise3"] = "#96cdcd"
let s:rgb["paleturquoise4"] = "#668b8b"
let s:rgb["palevioletred"] = "#db7093"
let s:rgb["palevioletred1"] = "#ff82ab"
let s:rgb["palevioletred2"] = "#ee799f"
let s:rgb["palevioletred3"] = "#cd6889"
let s:rgb["palevioletred4"] = "#8b475d"
let s:rgb["papaya whip"] = "#ffefd5"
let s:rgb["papayawhip"] = "#ffefd5"
let s:rgb["peach puff"] = "#ffdab9"
let s:rgb["peachpuff"] = "#ffdab9"
let s:rgb["peachpuff1"] = "#ffdab9"
let s:rgb["peachpuff2"] = "#eecbad"
let s:rgb["peachpuff3"] = "#cdaf95"
let s:rgb["peachpuff4"] = "#8b7765"
let s:rgb["peru"] = "#cd853f"
let s:rgb["pink"] = "#ffc0cb"
let s:rgb["pink1"] = "#ffb5c5"
let s:rgb["pink2"] = "#eea9b8"
let s:rgb["pink3"] = "#cd919e"
let s:rgb["pink4"] = "#8b636c"
let s:rgb["plum"] = "#dda0dd"
let s:rgb["plum1"] = "#ffbbff"
let s:rgb["plum2"] = "#eeaeee"
let s:rgb["plum3"] = "#cd96cd"
let s:rgb["plum4"] = "#8b668b"
let s:rgb["powder blue"] = "#b0e0e6"
let s:rgb["powderblue"] = "#b0e0e6"
let s:rgb["purple"] = "#a020f0"
let s:rgb["purple1"] = "#9b30ff"
let s:rgb["purple2"] = "#912cee"
let s:rgb["purple3"] = "#7d26cd"
let s:rgb["purple4"] = "#551a8b"
let s:rgb["red"] = "#ff0000"
let s:rgb["red1"] = "#ff0000"
let s:rgb["red2"] = "#ee0000"
let s:rgb["red3"] = "#cd0000"
let s:rgb["red4"] = "#8b0000"
let s:rgb["rosy brown"] = "#bc8f8f"
let s:rgb["rosybrown"] = "#bc8f8f"
let s:rgb["rosybrown1"] = "#ffc1c1"
let s:rgb["rosybrown2"] = "#eeb4b4"
let s:rgb["rosybrown3"] = "#cd9b9b"
let s:rgb["rosybrown4"] = "#8b6969"
let s:rgb["royal blue"] = "#4169e1"
let s:rgb["royalblue"] = "#4169e1"
let s:rgb["royalblue1"] = "#4876ff"
let s:rgb["royalblue2"] = "#436eee"
let s:rgb["royalblue3"] = "#3a5fcd"
let s:rgb["royalblue4"] = "#27408b"
let s:rgb["saddle brown"] = "#8b4513"
let s:rgb["saddlebrown"] = "#8b4513"
let s:rgb["salmon"] = "#fa8072"
let s:rgb["salmon1"] = "#ff8c69"
let s:rgb["salmon2"] = "#ee8262"
let s:rgb["salmon3"] = "#cd7054"
let s:rgb["salmon4"] = "#8b4c39"
let s:rgb["sandy brown"] = "#f4a460"
let s:rgb["sandybrown"] = "#f4a460"
let s:rgb["sea green"] = "#2e8b57"
let s:rgb["seagreen"] = "#2e8b57"
let s:rgb["seagreen1"] = "#54ff9f"
let s:rgb["seagreen2"] = "#4eee94"
let s:rgb["seagreen3"] = "#43cd80"
let s:rgb["seagreen4"] = "#2e8b57"
let s:rgb["seashell"] = "#fff5ee"
let s:rgb["seashell1"] = "#fff5ee"
let s:rgb["seashell2"] = "#eee5de"
let s:rgb["seashell3"] = "#cdc5bf"
let s:rgb["seashell4"] = "#8b8682"
let s:rgb["sienna"] = "#a0522d"
let s:rgb["sienna1"] = "#ff8247"
let s:rgb["sienna2"] = "#ee7942"
let s:rgb["sienna3"] = "#cd6839"
let s:rgb["sienna4"] = "#8b4726"
let s:rgb["sky blue"] = "#87ceeb"
let s:rgb["skyblue"] = "#87ceeb"
let s:rgb["skyblue1"] = "#87ceff"
let s:rgb["skyblue2"] = "#7ec0ee"
let s:rgb["skyblue3"] = "#6ca6cd"
let s:rgb["skyblue4"] = "#4a708b"
let s:rgb["slate blue"] = "#6a5acd"
let s:rgb["slate gray"] = "#708090"
let s:rgb["slate grey"] = "#708090"
let s:rgb["slateblue"] = "#6a5acd"
let s:rgb["slateblue1"] = "#836fff"
let s:rgb["slateblue2"] = "#7a67ee"
let s:rgb["slateblue3"] = "#6959cd"
let s:rgb["slateblue4"] = "#473c8b"
let s:rgb["slategray"] = "#708090"
let s:rgb["slategray1"] = "#c6e2ff"
let s:rgb["slategray2"] = "#b9d3ee"
let s:rgb["slategray3"] = "#9fb6cd"
let s:rgb["slategray4"] = "#6c7b8b"
let s:rgb["slategrey"] = "#708090"
let s:rgb["snow"] = "#fffafa"
let s:rgb["snow1"] = "#fffafa"
let s:rgb["snow2"] = "#eee9e9"
let s:rgb["snow3"] = "#cdc9c9"
let s:rgb["snow4"] = "#8b8989"
let s:rgb["spring green"] = "#00ff7f"
let s:rgb["springgreen"] = "#00ff7f"
let s:rgb["springgreen1"] = "#00ff7f"
let s:rgb["springgreen2"] = "#00ee76"
let s:rgb["springgreen3"] = "#00cd66"
let s:rgb["springgreen4"] = "#008b45"
let s:rgb["steel blue"] = "#4682b4"
let s:rgb["steelblue"] = "#4682b4"
let s:rgb["steelblue1"] = "#63b8ff"
let s:rgb["steelblue2"] = "#5cacee"
let s:rgb["steelblue3"] = "#4f94cd"
let s:rgb["steelblue4"] = "#36648b"
let s:rgb["tan"] = "#d2b48c"
let s:rgb["tan1"] = "#ffa54f"
let s:rgb["tan2"] = "#ee9a49"
let s:rgb["tan3"] = "#cd853f"
let s:rgb["tan4"] = "#8b5a2b"
let s:rgb["thistle"] = "#d8bfd8"
let s:rgb["thistle1"] = "#ffe1ff"
let s:rgb["thistle2"] = "#eed2ee"
let s:rgb["thistle3"] = "#cdb5cd"
let s:rgb["thistle4"] = "#8b7b8b"
let s:rgb["tomato"] = "#ff6347"
let s:rgb["tomato1"] = "#ff6347"
let s:rgb["tomato2"] = "#ee5c42"
let s:rgb["tomato3"] = "#cd4f39"
let s:rgb["tomato4"] = "#8b3626"
let s:rgb["turquoise"] = "#40e0d0"
let s:rgb["turquoise1"] = "#00f5ff"
let s:rgb["turquoise2"] = "#00e5ee"
let s:rgb["turquoise3"] = "#00c5cd"
let s:rgb["turquoise4"] = "#00868b"
let s:rgb["violet red"] = "#d02090"
let s:rgb["violet"] = "#ee82ee"
let s:rgb["violetred"] = "#d02090"
let s:rgb["violetred1"] = "#ff3e96"
let s:rgb["violetred2"] = "#ee3a8c"
let s:rgb["violetred3"] = "#cd3278"
let s:rgb["violetred4"] = "#8b2252"
let s:rgb["wheat"] = "#f5deb3"
let s:rgb["wheat1"] = "#ffe7ba"
let s:rgb["wheat2"] = "#eed8ae"
let s:rgb["wheat3"] = "#cdba96"
let s:rgb["wheat4"] = "#8b7e66"
let s:rgb["white smoke"] = "#f5f5f5"
let s:rgb["white"] = "#ffffff"
let s:rgb["whitesmoke"] = "#f5f5f5"
let s:rgb["yellow green"] = "#9acd32"
let s:rgb["yellow"] = "#ffff00"
let s:rgb["yellow1"] = "#ffff00"
let s:rgb["yellow2"] = "#eeee00"
let s:rgb["yellow3"] = "#cdcd00"
let s:rgb["yellow4"] = "#8b8b00"
let s:rgb["yellowgreen"] = "#9acd32"
if has('mac') && !has('macunix')
let s:rgb["dark gray"] = "0x808080"
let s:rgb["darkgray"] = "0x808080"
let s:rgb["dark grey"] = "0x808080"
let s:rgb["darkgrey"] = "0x808080"
let s:rgb["gray"] = "0xc0c0c0"
let s:rgb["grey"] = "0xc0c0c0"
let s:rgb["light gray"] = "0xe0e0e0"
let s:rgb["lightgray"] = "0xe0e0e0"
let s:rgb["light grey"] = "0xe0e0e0"
let s:rgb["lightgrey"] = "0xe0e0e0"
let s:rgb["dark red"] = "0x800000"
let s:rgb["darkred"] = "0x800000"
let s:rgb["red"] = "0xdd0806"
let s:rgb["light red"] = "0xffa0a0"
let s:rgb["lightred"] = "0xffa0a0"
let s:rgb["dark blue"] = "0x000080"
let s:rgb["darkblue"] = "0x000080"
let s:rgb["blue"] = "0x0000d4"
let s:rgb["light blue"] = "0xa0a0ff"
let s:rgb["lightblue"] = "0xa0a0ff"
let s:rgb["dark green"] = "0x008000"
let s:rgb["darkgreen"] = "0x008000"
let s:rgb["green"] = "0x006411"
let s:rgb["light green"] = "0xa0ffa0"
let s:rgb["lightgreen"] = "0xa0ffa0"
let s:rgb["dark cyan"] = "0x008080"
let s:rgb["darkcyan"] = "0x008080"
let s:rgb["cyan"] = "0x02abea"
let s:rgb["light cyan"] = "0xa0ffff"
let s:rgb["lightcyan"] = "0xa0ffff"
let s:rgb["dark magenta"] = "0x800080"
let s:rgb["darkmagenta"] = "0x800080"
let s:rgb["magenta"] = "0xf20884"
let s:rgb["light magenta"] = "0xf0a0f0"
let s:rgb["lightmagenta"] = "0xf0a0f0"
let s:rgb["brown"] = "0x804040"
let s:rgb["yellow"] = "0xfcf305"
let s:rgb["light yellow"] = "0xffffa0"
let s:rgb["lightyellow"] = "0xffffa0"
let s:rgb["orange"] = "0xfc8000"
let s:rgb["purple"] = "0xa020f0"
let s:rgb["slateblue"] = "0x6a5acd"
let s:rgb["violet"] = "0x8d38c9"
endif
function! csapprox#rgb()
return s:rgb
endfunction

View File

@ -0,0 +1,78 @@
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
let s:xterm_colors = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ]
let s:eterm_colors = [ 0x00, 0x2A, 0x55, 0x7F, 0xAA, 0xD4 ]
let s:konsole_colors = [ 0x00, 0x33, 0x66, 0x99, 0xCC, 0xFF ]
let s:xterm_greys = [ 0x08, 0x12, 0x1C, 0x26, 0x30, 0x3A,
\ 0x44, 0x4E, 0x58, 0x62, 0x6C, 0x76,
\ 0x80, 0x8A, 0x94, 0x9E, 0xA8, 0xB2,
\ 0xBC, 0xC6, 0xD0, 0xDA, 0xE4, 0xEE ]
let s:urxvt_colors = [ 0x00, 0x8B, 0xCD, 0xFF ]
let s:urxvt_greys = [ 0x2E, 0x5C, 0x73, 0x8B,
\ 0xA2, 0xB9, 0xD0, 0xE7 ]
" Uses &term to determine which cube should be use. If &term is set to
" "xterm" or begins with "screen", the variables g:CSApprox_eterm and
" g:CSApprox_konsole can be used to select a different palette.
function! csapprox#common#PaletteType()
if &t_Co == 88
let type = 'urxvt'
elseif &term ==# 'xterm' || &term =~# '^screen' || &term==# 'builtin_gui'
if exists('g:CSApprox_konsole') && g:CSApprox_konsole
let type = 'konsole'
elseif exists('g:CSApprox_eterm') && g:CSApprox_eterm
let type = 'eterm'
else
let type = 'xterm'
endif
elseif &term =~? '^konsole'
" Konsole only used its own palette up til KDE 4.2.0
if executable('kde4-config') && system('kde4-config --kde-version') =~ '^4\.[10]\.'
let type = 'konsole'
elseif executable('kde-config') && system('kde-config --version') =~# 'KDE: 3\.'
let type = 'konsole'
else
let type = 'xterm'
endif
elseif &term =~? '^eterm'
let type = 'eterm'
else
let type = 'xterm'
endif
return type
endfunction
" Retrieve the list of greyscale ramp colors for the current palette
function! csapprox#common#Greys()
return (&t_Co == 88 ? s:urxvt_greys : s:xterm_greys)
endfunction
" Retrieve the list of non-greyscale ramp colors for the current palette
function! csapprox#common#Colors()
return s:{csapprox#common#PaletteType()}_colors
endfunction

View File

@ -0,0 +1,91 @@
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" Integer comparator used to sort the complete list of possible colors
function! s:IntCompare(i1, i2)
return a:i1 == a:i2 ? 0 : a:i1 > a:i2 ? 1 : -1
endfunc
" Color comparator to find the nearest element to a given one in a given list
function! s:NearestElemInList(elem, list)
let len = len(a:list)
for i in range(len-1)
if (a:elem <= (a:list[i] + a:list[i+1]) / 2)
return a:list[i]
endif
endfor
return a:list[len-1]
endfunction
" Takes 3 decimal values for r, g, and b, and returns the closest cube number.
"
" This approximator considers closeness based upon the individiual components.
" For each of r, g, and b, it finds the closest cube component available on
" the cube. If the three closest matches can combine to form a valid color,
" this color is used, otherwise we repeat the search with the greys removed,
" meaning that the three new matches must make a valid color when combined.
function! csapprox#per_component#Approximate(r,g,b)
let hex = printf("%02x%02x%02x", a:r, a:g, a:b)
let colors = csapprox#common#Colors()
let greys = csapprox#common#Greys()
let type = csapprox#common#PaletteType()
if !exists('s:approximator_cache_'.type)
let s:approximator_cache_{type} = {}
endif
let rv = get(s:approximator_cache_{type}, hex, -1)
if rv != -1
return rv
endif
" Only obtain sorted list once
if !exists("s:".type."_greys_colors")
let s:{type}_greys_colors = sort(greys + colors, "s:IntCompare")
endif
let greys_colors = s:{type}_greys_colors
let r = s:NearestElemInList(a:r, greys_colors)
let g = s:NearestElemInList(a:g, greys_colors)
let b = s:NearestElemInList(a:b, greys_colors)
let len = len(colors)
if (r == g && g == b && index(greys, r) != -1)
let rv = 16 + len * len * len + index(greys, r)
else
let r = s:NearestElemInList(a:r, colors)
let g = s:NearestElemInList(a:g, colors)
let b = s:NearestElemInList(a:b, colors)
let rv = index(colors, r) * len * len
\ + index(colors, g) * len
\ + index(colors, b)
\ + 16
endif
let s:approximator_cache_{type}[hex] = rv
return rv
endfunction

921
CSApprox/plugin/CSApprox.vim Executable file
View File

@ -0,0 +1,921 @@
" CSApprox: Make gvim-only colorschemes Just Work terminal vim
" Maintainer: Matthew Wozniski (godlygeek@gmail.com)
" Date: Fri, 14 Sep 2012 01:12:13 -0400
" Version: 4.00
" History: :help csapprox-changelog
"
" Long Description:
" It's hard to find colorschemes for terminal Vim. Most colorschemes are
" written to only support GVim, and don't work at all in terminal Vim.
"
" This plugin makes GVim-only colorschemes Just Work in terminal Vim, as long
" as the terminal supports 88 or 256 colors - and most do these days. This
" usually requires no user interaction (but see below for what to do if things
" don't Just Work). After getting this plugin happily installed, any time you
" use :colorscheme it will do its magic and make the colorscheme Just Work.
"
" Whenever you change colorschemes using the :colorscheme command this script
" will be executed. It will take the colors that the scheme specified for use
" in the GUI and use an approximation algorithm to try to gracefully degrade
" them to the closest color available in your terminal. If you are running in
" a GUI or if your terminal doesn't support 88 or 256 colors, no changes are
" made. Also, no changes will be made if the colorscheme seems to have been
" high color already.
"
" License:
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" {>1} Basic plugin setup
" {>2} Check preconditions
" Quit if the user doesn't want or need us or is missing the gui feature. We
" need +gui to be able to check the gui color settings; vim doesn't bother to
" store them if it is not built with +gui.
if exists('g:CSApprox_loaded')
finish
elseif !has('gui') && v:version < 703
" Vim versions less than < 7.3.0 need +gui.
" Warn unless the user set g:CSApprox_verbose_level to zero.
if get(g:, 'CSApprox_verbose_level', 1)
echomsg "CSApprox needs gui support - not loading."
echomsg " See :help |csapprox-+gui| for possible workarounds."
endif
finish
endif
" {1} Mark us as loaded, and disable all compatibility options for now.
let g:CSApprox_loaded = 1
let s:savecpo = &cpo
set cpo&vim
" {>1} Collect info for the set highlights
" {>2} Determine if synIDattr is usable
" synIDattr() couldn't support 'guisp' until 7.2.052. This function returns
" true if :redir is needed to find the 'guisp' attribute, false if synIDattr()
" is functional. This test can be overridden by setting the global variable
" g:CSApprox_redirfallback to 1 (to force use of :redir) or to 0 (to force use
" of synIDattr()).
function! s:NeedRedirFallback()
if !exists("g:CSApprox_redirfallback")
let g:CSApprox_redirfallback = (v:version == 702 && !has('patch52'))
\ || v:version < 702
endif
return g:CSApprox_redirfallback
endfunction
" {>2} Collect and store the highlights
" Get a dictionary containing information for every highlight group not merely
" linked to another group. Return value is a dictionary, with highlight group
" numbers for keys and values that are dictionaries with four keys each,
" 'name', 'term', 'cterm', and 'gui'. 'name' holds the group name, and each
" of the others holds highlight information for that particular mode.
function! s:Highlights(modes)
let rv = {}
let i = 0
while 1
let i += 1
" Only interested in groups that exist and aren't linked
if synIDtrans(i) == 0
break
endif
" Handle vim bug allowing groups with name == "" to be created
if synIDtrans(i) != i || len(synIDattr(i, "name")) == 0
continue
endif
let rv[i] = {}
let rv[i].name = synIDattr(i, "name")
for where in a:modes
let rv[i][where] = {}
for attr in s:PossibleAttributes()
let rv[i][where][attr] = synIDattr(i, attr, where)
endfor
for attr in [ "fg", "bg" ]
let rv[i][where][attr] = synIDattr(i, attr.'#', where)
endfor
if where == "gui"
let rv[i][where]["sp"] = s:SynGuiSp(i, rv[i].name)
else
let rv[i][where]["sp"] = -1
endif
for attr in [ "fg", "bg", "sp" ]
if rv[i][where][attr] == -1
let rv[i][where][attr] = ''
endif
endfor
endfor
endwhile
return rv
endfunction
" {>2} Retrieve guisp
" Get guisp using whichever method is specified by _redir_fallback
function! s:SynGuiSp(idx, name)
if !s:NeedRedirFallback()
return s:SynGuiSpAttr(a:idx)
else
return s:SynGuiSpRedir(a:name)
endif
endfunction
" {>3} Implementation for retrieving guisp with redir hack
function! s:SynGuiSpRedir(name)
redir => temp
exe 'sil hi ' . a:name
redir END
let temp = matchstr(temp, 'guisp=\zs.*')
if len(temp) == 0 || temp[0] =~ '\s'
let temp = ""
else
" Make sure we can handle guisp='dark red'
let temp = substitute(temp, '[\x00].*', '', '')
let temp = substitute(temp, '\s*\(c\=term\|gui\).*', '', '')
let temp = substitute(temp, '\s*$', '', '')
endif
return temp
endfunction
" {>3} Implementation for retrieving guisp with synIDattr()
function! s:SynGuiSpAttr(idx)
return synIDattr(a:idx, 'sp#', 'gui')
endfunction
" {>1} Handle color names
" Place to store rgb.txt name to color mappings - lazy loaded if needed
let s:rgb = {}
" {>2} Builtin gui color names
" gui_x11.c and gui_gtk_x11.c have some default colors names that are searched
" if the x server doesn't know about a color. If 'showrgb' is available,
" we'll default to using these color names and values, and overwrite them with
" other values if 'showrgb' tells us about those colors.
let s:rgb_defaults = { "lightred" : "#FFBBBB",
\ "lightgreen" : "#88FF88",
\ "lightmagenta" : "#FFBBFF",
\ "darkcyan" : "#008888",
\ "darkblue" : "#0000BB",
\ "darkred" : "#BB0000",
\ "darkmagenta" : "#BB00BB",
\ "darkgrey" : "#BBBBBB",
\ "darkyellow" : "#BBBB00",
\ "gray10" : "#1A1A1A",
\ "grey10" : "#1A1A1A",
\ "gray20" : "#333333",
\ "grey20" : "#333333",
\ "gray30" : "#4D4D4D",
\ "grey30" : "#4D4D4D",
\ "gray40" : "#666666",
\ "grey40" : "#666666",
\ "gray50" : "#7F7F7F",
\ "grey50" : "#7F7F7F",
\ "gray60" : "#999999",
\ "grey60" : "#999999",
\ "gray70" : "#B3B3B3",
\ "grey70" : "#B3B3B3",
\ "gray80" : "#CCCCCC",
\ "grey80" : "#CCCCCC",
\ "gray90" : "#E5E5E5",
\ "grey90" : "#E5E5E5" }
" {>2} Colors that vim will use by name in one of the default schemes, either
" for bg=light or for bg=dark. This lets us avoid loading the entire rgb.txt
" database when the scheme itself doesn't ask for colors by name.
let s:rgb_presets = { "black" : "#000000",
\ "blue" : "#0000ff",
\ "brown" : "#a52a2a",
\ "cyan" : "#00ffff",
\ "darkblue" : "#00008b",
\ "darkcyan" : "#008b8b",
\ "darkgrey" : "#a9a9a9",
\ "darkmagenta" : "#8b008b",
\ "green" : "#00ff00",
\ "grey" : "#bebebe",
\ "grey40" : "#666666",
\ "grey90" : "#e5e5e5",
\ "lightblue" : "#add8e6",
\ "lightcyan" : "#e0ffff",
\ "lightgrey" : "#d3d3d3",
\ "lightmagenta" : "#ffbbff",
\ "magenta" : "#ff00ff",
\ "red" : "#ff0000",
\ "seagreen" : "#2e8b57",
\ "white" : "#ffffff",
\ "yellow" : "#ffff00" }
" {>2} Find available color names
" Find the valid named colors. By default, use our own rgb list, but try to
" retrieve the system's list if g:CSApprox_use_showrgb is set to true. Store
" the color names and color values to the dictionary s:rgb - the keys are
" color names (in lowercase), the values are strings representing color values
" (as '#rrggbb').
function! s:UpdateRgbHash()
try
if !exists("g:CSApprox_use_showrgb") || !g:CSApprox_use_showrgb
throw "Not using showrgb"
endif
" We want to use the 'showrgb' program, if it's around
let lines = split(system('showrgb'), '\n')
if v:shell_error || !exists('lines') || empty(lines)
throw "'showrgb' didn't give us an rgb.txt"
endif
let s:rgb = copy(s:rgb_defaults)
" fmt is (blanks?)(red)(blanks)(green)(blanks)(blue)(blanks)(name)
let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(\d\+\)\s\+\(.*\)$'
for line in lines
let v = matchlist(line, parsepat)
if len(v) < 0
throw "CSApprox: Bad RGB line: " . string(line)
endif
let s:rgb[tolower(v[4])] = printf("#%02x%02x%02x", v[1], v[2], v[3])
endfor
catch
try
let s:rgb = csapprox#rgb()
catch
echohl ErrorMsg
echomsg "Can't call rgb() from autoload/csapprox.vim"
echomsg "Named colors will not be available!"
echohl None
endtry
endtry
return 0
endfunction
" {>1} Derive and set cterm attributes
" {>2} List of all possible attributes
function! s:PossibleAttributes()
return [ "bold", "italic", "reverse", "underline", "undercurl" ]
endfunction
" {>2} Attribute overrides
" Allow the user to override a specified attribute with another attribute.
" For example, the default is to map 'italic' to 'underline' (since many
" terminals cannot display italic text, and gvim itself will replace italics
" with underlines where italicizing is impossible), and to replace 'sp' with
" 'fg' (since terminals can't use one color for the underline and another for
" the foreground, we color the entire word). This default can of course be
" overridden by the user, by setting g:CSApprox_attr_map. This map must be
" a dictionary of string keys, representing the same attributes that synIDattr
" can look up, to string values, representing the attribute mapped to or an
" empty string to disable the given attribute entirely.
function! s:attr_map(attr)
let rv = get(g:CSApprox_attr_map, a:attr, a:attr)
return rv
endfunction
function! s:NormalizeAttrMap(map)
let old = copy(a:map)
let new = filter(a:map, '0')
let valid_attrs = [ 'bg', 'fg', 'sp' ] + s:PossibleAttributes()
let colorattrs = [ 'fg', 'bg', 'sp' ]
for olhs in keys(old)
if olhs ==? 'inverse'
let nlhs = 'reverse'
endif
let orhs = old[olhs]
if orhs ==? 'inverse'
let nrhs = 'reverse'
endif
let nlhs = tolower(olhs)
let nrhs = tolower(orhs)
try
if index(valid_attrs, nlhs) == -1
echomsg "CSApprox: Bad attr map (removing unrecognized attribute " . olhs . ")"
elseif nrhs != '' && index(valid_attrs, nrhs) == -1
echomsg "CSApprox: Bad attr map (removing unrecognized attribute " . orhs . ")"
elseif nrhs != '' && !!(index(colorattrs, nlhs)+1) != !!(index(colorattrs, nrhs)+1)
echomsg "CSApprox: Bad attr map (removing " . olhs . "; type mismatch with " . orhs . ")"
elseif nrhs == 'sp'
echomsg "CSApprox: Bad attr map (removing " . olhs . "; can't map to 'sp')"
else
let new[nlhs] = nrhs
endif
catch
echo v:exception
endtry
endfor
endfunction
" {>2} Normalize the GUI settings of a highlight group
" If the Normal group is cleared, set it to gvim's default, black on white
" Though this would be a really weird thing for a scheme to do... *shrug*
function! s:FixupGuiInfo(highlights)
if a:highlights[s:hlid_normal].gui.bg == ''
let a:highlights[s:hlid_normal].gui.bg = 'white'
endif
if a:highlights[s:hlid_normal].gui.fg == ''
let a:highlights[s:hlid_normal].gui.fg = 'black'
endif
endfunction
" {>2} Map gui settings to cterm settings
" Given information about a highlight group, replace the cterm settings with
" the mapped gui settings, applying any attribute overrides along the way. In
" particular, this gives special treatment to the 'reverse' attribute and the
" 'guisp' attribute. In particular, if the 'reverse' attribute is set for
" gvim, we unset it for the terminal and instead set ctermfg to match guibg
" and vice versa, since terminals can consider a 'reverse' flag to mean using
" default-bg-on-default-fg instead of current-bg-on-current-fg. We also
" ensure that the 'sp' attribute is never set for cterm, since no terminal can
" handle that particular highlight. If the user wants to display the guisp
" color, he should map it to either 'fg' or 'bg' using g:CSApprox_attr_map.
function! s:FixupCtermInfo(highlights)
for hl in values(a:highlights)
if !has_key(hl, 'cterm')
let hl["cterm"] = {}
endif
" Find attributes to be set in the terminal
for attr in s:PossibleAttributes()
let hl.cterm[attr] = ''
if hl.gui[attr] == 1
if s:attr_map(attr) != ''
let hl.cterm[ s:attr_map(attr) ] = 1
endif
endif
endfor
for color in [ "bg", "fg" ]
let eff_color = color
if hl.cterm['reverse']
let eff_color = (color == 'bg' ? 'fg' : 'bg')
endif
let hl.cterm[color] = get(hl.gui, s:attr_map(eff_color), '')
endfor
if hl.gui['sp'] != '' && s:attr_map('sp') != ''
let hl.cterm[s:attr_map('sp')] = hl.gui['sp']
endif
if exists("g:CSApprox_fake_reverse") && g:CSApprox_fake_reverse
if hl.cterm['reverse'] && hl.cterm.bg == ''
let hl.cterm.bg = 'fg'
endif
if hl.cterm['reverse'] && hl.cterm.fg == ''
let hl.cterm.fg = 'bg'
endif
if hl.cterm['reverse']
let hl.cterm.reverse = ''
endif
endif
endfor
endfunction
" {>2} Kludge around inability to reference autoload functions
function! s:DefaultApproximator(...)
return call('csapprox#per_component#Approximate', a:000)
endfunction
" {>2} Set cterm colors for a highlight group
" Given the information for a single highlight group (ie, the value of
" one of the items in s:Highlights() already normalized with s:FixupCtermInfo
" and s:FixupGuiInfo), handle matching the gvim colors to the closest cterm
" colors by calling the appropriate approximator as specified with the
" g:CSApprox_approximator_function variable and set the colors and attributes
" appropriately to match the gui.
function! s:SetCtermFromGui(hl)
let hl = a:hl
" Set up the default approximator function, if needed
if !exists("g:CSApprox_approximator_function")
let g:CSApprox_approximator_function = function("s:DefaultApproximator")
endif
" Clear existing highlights
exe 'hi ' . hl.name . ' cterm=NONE ctermbg=NONE ctermfg=NONE'
for which in [ 'bg', 'fg' ]
let val = hl.cterm[which]
" Skip unset colors
if val == -1 || val == ""
continue
endif
" Try translating anything but 'fg', 'bg', #rrggbb, and rrggbb from an
" rgb.txt color to a #rrggbb color
if val !~? '^[fb]g$' && val !~ '^#\=\x\{6}$'
try
" First see if it is in our preset-by-vim rgb list
let val = s:rgb_presets[tolower(val)]
catch
" Then try loading and checking our real rgb list
if empty(s:rgb)
call s:UpdateRgbHash()
endif
try
let val = s:rgb[tolower(val)]
catch
" And then barf if we still haven't found it
if &verbose
echomsg "CSApprox: Colorscheme uses unknown color \"" . val . "\""
endif
continue
endtry
endtry
endif
if val =~? '^[fb]g$'
exe 'hi ' . hl.name . ' cterm' . which . '=' . val
let hl.cterm[which] = val
elseif val =~ '^#\=\x\{6}$'
let val = substitute(val, '^#', '', '')
let r = str2nr(val[0:1], 16)
let g = str2nr(val[2:3], 16)
let b = str2nr(val[4:5], 16)
let hl.cterm[which] = g:CSApprox_approximator_function(r, g, b)
exe 'hi ' . hl.name . ' cterm' . which . '=' . hl.cterm[which]
else
throw "Internal error handling color: " . val
endif
endfor
" Finally, set the attributes
let attrs = s:PossibleAttributes()
call filter(attrs, 'hl.cterm[v:val] == 1')
if !empty(attrs)
exe 'hi ' . hl.name . ' cterm=' . join(attrs, ',')
endif
endfunction
" {>1} Top-level control
" Cache the highlight ID of the normal group; it's used often and won't change
let s:hlid_normal = hlID('Normal')
" {>2} Builtin cterm color names above 15
" Vim defines some color name to high color mappings internally (see
" syntax.c:do_highlight). Since we don't want to overwrite a colorscheme that
" was actually written for a high color terminal with our choices, but have no
" way to tell if a colorscheme was written for a high color terminal, we fall
" back on guessing. If any highlight group has a cterm color set to 16 or
" higher, we assume that the user has used a high color colorscheme - unless
" that color is one of the below, which vim can set internally when a color is
" requested by name.
let s:presets_88 = []
let s:presets_88 += [32] " Brown
let s:presets_88 += [72] " DarkYellow
let s:presets_88 += [84] " Gray
let s:presets_88 += [84] " Grey
let s:presets_88 += [82] " DarkGray
let s:presets_88 += [82] " DarkGrey
let s:presets_88 += [43] " LightBlue
let s:presets_88 += [61] " LightGreen
let s:presets_88 += [63] " LightCyan
let s:presets_88 += [74] " LightRed
let s:presets_88 += [75] " LightMagenta
let s:presets_88 += [78] " LightYellow
let s:presets_256 = []
let s:presets_256 += [130] " Brown
let s:presets_256 += [130] " DarkYellow
let s:presets_256 += [248] " Gray
let s:presets_256 += [248] " Grey
let s:presets_256 += [242] " DarkGray
let s:presets_256 += [242] " DarkGrey
let s:presets_256 += [ 81] " LightBlue
let s:presets_256 += [121] " LightGreen
let s:presets_256 += [159] " LightCyan
let s:presets_256 += [224] " LightRed
let s:presets_256 += [225] " LightMagenta
let s:presets_256 += [229] " LightYellow
" {>2} Wrapper around :exe to allow :executing multiple commands.
" "cmd" is the command to be :executed.
" If the variable is a String, it is :executed.
" If the variable is a List, each element is :executed.
function! s:exe(cmd)
if type(a:cmd) == type('')
exe a:cmd
else
for cmd in a:cmd
call s:exe(cmd)
endfor
endif
endfunction
" {>2} Function to handle hooks
" Prototype: HandleHooks(type [, scheme])
" "type" is the type of hook to be executed, ie. "pre" or "post"
" "scheme" is the name of the colorscheme that is currently active, if known
"
" If the variables g:CSApprox_hook_{type} and g:CSApprox_hook_{scheme}_{type}
" exist, this will :execute them in that order. If one does not exist, it
" will silently be ignored.
"
" If the scheme name contains characters that are invalid in a variable name,
" they will simply be removed. Ie, g:colors_name = "123 foo_bar-baz456"
" becomes "foo_barbaz456"
"
" NOTE: Exceptions will be printed out, rather than end processing early. The
" rationale is that it is worse for the user to fix the hook in an editor with
" broken colors. :)
function! s:HandleHooks(type, ...)
let type = a:type
let scheme = (a:0 == 1 ? a:1 : "")
let scheme = substitute(scheme, '[^[:alnum:]_]', '', 'g')
let scheme = substitute(scheme, '^\d\+', '', '')
for cmd in [ 'g:CSApprox_hook_' . type,
\ 'g:CSApprox_' . scheme . '_hook_' . type,
\ 'g:CSApprox_hook_' . scheme . '_' . type ]
if exists(cmd)
try
call s:exe(eval(cmd))
catch
echomsg "Error processing " . cmd . ":"
echomsg v:exception
endtry
endif
endfor
endfunction
" {>2} Main function
" Wrapper around the actual implementation to make it easier to ensure that
" all temporary settings are restored by the time we return, whether or not
" something was thrown. Additionally, sets the 'verbose' option to the max of
" g:CSApprox_verbose_level (default 1) and &verbose for the duration of the
" main function. This allows us to default to a message whenever any error,
" even a recoverable one, occurs, meaning the user quickly finds out when
" something's wrong, but makes it very easy for the user to make us silent.
function! s:CSApprox(...)
try
if a:0 == 1 && a:1
if !exists('s:inhibit_hicolor_test')
let s:inhibit_hicolor_test = 0
endif
let s:inhibit_hicolor_test += 1
endif
let savelz = &lz
set lz
if exists("g:CSApprox_attr_map") && type(g:CSApprox_attr_map) == type({})
call s:NormalizeAttrMap(g:CSApprox_attr_map)
else
let g:CSApprox_attr_map = { 'italic' : 'underline', 'sp' : 'fg' }
endif
" colors_name must be unset and reset, or vim will helpfully reload the
" colorscheme when we set the background for the Normal group.
" See the help entries ':hi-normal-cterm' and 'g:colors_name'
if exists("g:colors_name")
let colors_name = g:colors_name
unlet g:colors_name
endif
" Similarly, the global variable "syntax_cmd" must be set to something vim
" doesn't recognize, lest vim helpfully switch all colors back to the
" default whenever the Normal group is changed (in syncolor.vim)...
if exists("g:syntax_cmd")
let syntax_cmd = g:syntax_cmd
endif
let g:syntax_cmd = "PLEASE DON'T CHANGE ANY COLORS!!!"
" Set up our verbosity level, if needed.
" Default to 1, so the user can know if something's wrong.
if !exists("g:CSApprox_verbose_level")
let g:CSApprox_verbose_level = 1
endif
call s:HandleHooks("pre", (exists("colors_name") ? colors_name : ""))
let old_bg = &bg
" Set 'verbose' set to the maximum of &verbose and CSApprox_verbose_level
exe max([&vbs, g:CSApprox_verbose_level]) 'verbose call s:CSApproxImpl()'
let &bg = old_bg
call s:HandleHooks("post", (exists("colors_name") ? colors_name : ""))
finally
if exists("colors_name")
let g:colors_name = colors_name
endif
unlet g:syntax_cmd
if exists("syntax_cmd")
let g:syntax_cmd = syntax_cmd
endif
let &lz = savelz
if a:0 == 1 && a:1
let s:inhibit_hicolor_test -= 1
if s:inhibit_hicolor_test == 0
unlet s:inhibit_hicolor_test
endif
endif
endtry
endfunction
" {>2} CSApprox implementation
" Verifies that the user has not started the gui, and that vim recognizes his
" terminal as having enough colors for us to go on, then gathers the existing
" highlights and sets the cterm colors to match the gui colors for all those
" highlights (unless the colorscheme was already high-color).
function! s:CSApproxImpl()
" Return if not running in an 88/256 color terminal
if &t_Co != 256 && &t_Co != 88
if &verbose && &t_Co != ''
echomsg "CSApprox skipped; terminal only has" &t_Co "colors, not 88/256"
echomsg "Try checking :help csapprox-terminal for workarounds"
endif
return
endif
" Get the current highlight colors
let highlights = s:Highlights(["gui"])
let hinums = keys(highlights)
" Make sure that the script is not already 256 color by checking to make
" sure that no groups are set to a value above 256, unless the color they're
" set to can be set internally by vim (gotten by scraping
" color_numbers_{88,256} in syntax.c:do_highlight)
"
" XXX: s:inhibit_hicolor_test allows this test to be skipped for snapshots
if !exists("s:inhibit_hicolor_test") || !s:inhibit_hicolor_test
for hlid in hinums
for type in [ 'bg', 'fg' ]
let color = synIDattr(hlid, type, 'cterm')
if color > 15 && index(s:presets_{&t_Co}, str2nr(color)) < 0
" The value is set above 15, and wasn't set by vim.
if &verbose >= 2
echomsg 'CSApprox: Exiting - high' type 'color found for' highlights[hlid].name
endif
return
endif
endfor
endfor
endif
call s:FixupGuiInfo(highlights)
call s:FixupCtermInfo(highlights)
" We need to set the Normal group first so 'bg' and 'fg' work as colors
call insert(hinums, remove(hinums, index(hinums, string(s:hlid_normal))))
" then set each color's cterm attributes to match gui
for hlid in hinums
call s:SetCtermFromGui(highlights[hlid])
endfor
endfunction
" {>2} Write out the current colors to an 88/256 color colorscheme file.
" "file" - destination filename
" "overwrite" - overwrite an existing file
function! s:CSApproxSnapshot(file, overwrite)
let force = a:overwrite
let file = fnamemodify(a:file, ":p")
if empty(file)
throw "Bad file name: \"" . file . "\""
elseif (filewritable(fnamemodify(file, ':h')) != 2)
throw "Cannot write to directory \"" . fnamemodify(file, ':h') . "\""
elseif (glob(file) || filereadable(file)) && !force
" TODO - respect 'confirm' here and prompt if it's set.
echohl ErrorMsg
echomsg "E13: File exists (add ! to override)"
echohl None
return
endif
" Sigh... This is basically a bug, but one that I have no chance of fixing.
" Vim decides that Pmenu should be highlighted in 'LightMagenta' in terminal
" vim and as 'Magenta' in gvim... And I can't ask it what color it actually
" *wants*. As far as I can see, there's no way for me to learn that
" I should output 'Magenta' when 'LightMagenta' is provided by vim for the
" terminal.
if !has('gui_running')
echohl WarningMsg
echomsg "Warning: The written colorscheme may have incorrect colors"
echomsg " when CSApproxSnapshot is used in terminal vim!"
echohl None
endif
let save_t_Co = &t_Co
let s:inhibit_hicolor_test = 1
if exists("g:CSApprox_konsole")
let save_CSApprox_konsole = g:CSApprox_konsole
endif
if exists("g:CSApprox_eterm")
let save_CSApprox_eterm = g:CSApprox_eterm
endif
" Needed just like in CSApprox()
if exists("g:colors_name")
let colors_name = g:colors_name
unlet g:colors_name
endif
" Needed just like in CSApprox()
if exists("g:syntax_cmd")
let syntax_cmd = g:syntax_cmd
endif
let g:syntax_cmd = "PLEASE DON'T CHANGE ANY COLORS!!!"
try
let lines = []
let lines += [ '" This scheme was created by CSApproxSnapshot' ]
let lines += [ '" on ' . strftime("%a, %d %b %Y") ]
let lines += [ '' ]
let lines += [ 'hi clear' ]
let lines += [ 'if exists("syntax_on")' ]
let lines += [ ' syntax reset' ]
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'if v:version < 700' ]
let lines += [ ' let g:colors_name = expand("<sfile>:t:r")' ]
let lines += [ ' command! -nargs=+ CSAHi exe "hi" substitute(substitute(<q-args>, "undercurl", "underline", "g"), "guisp\\S\\+", "", "g")' ]
let lines += [ 'else' ]
let lines += [ ' let g:colors_name = expand("<sfile>:t:r")' ]
let lines += [ ' command! -nargs=+ CSAHi exe "hi" <q-args>' ]
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'function! s:old_kde()' ]
let lines += [ ' " Konsole only used its own palette up til KDE 4.2.0' ]
let lines += [ " if executable('kde4-config') && system('kde4-config --kde-version') =~ '^4\.[10]\.'" ]
let lines += [ ' return 1' ]
let lines += [ " elseif executable('kde-config') && system('kde-config --version') =~# 'KDE: 3\.'" ]
let lines += [ ' return 1' ]
let lines += [ ' else' ]
let lines += [ ' return 0' ]
let lines += [ ' endif' ]
let lines += [ 'endfunction' ]
let lines += [ '' ]
let lines += [ 'if 0' ]
for round in [ 'konsole', 'eterm', 'xterm', 'urxvt' ]
sil! unlet g:CSApprox_eterm
sil! unlet g:CSApprox_konsole
if round == 'konsole'
let g:CSApprox_konsole = 1
elseif round == 'eterm'
let g:CSApprox_eterm = 1
endif
if round == 'urxvt'
set t_Co=88
else
set t_Co=256
endif
call s:CSApprox()
let highlights = s:Highlights(["term", "cterm", "gui"])
call s:FixupGuiInfo(highlights)
if round == 'konsole' || round == 'eterm'
if round == 'konsole'
let term_matches_round = '(&term =~? "^konsole" && s:old_kde())'
else
let term_matches_round = '&term =~? "^' . round . '"'
endif
let lines += [ 'elseif has("gui_running") || (&t_Co == ' . &t_Co
\ . ' && (&term ==# "xterm" || &term =~# "^screen")'
\ . ' && exists("g:CSApprox_' . round . '")'
\ . ' && g:CSApprox_' . round . ')'
\ . ' || ' . term_matches_round ]
else
let lines += [ 'elseif has("gui_running") || &t_Co == ' . &t_Co ]
endif
let hinums = keys(highlights)
call insert(hinums, remove(hinums, index(hinums, string(s:hlid_normal))))
for hlnum in hinums
let hl = highlights[hlnum]
let line = ' CSAHi ' . hl.name
for type in [ 'term', 'cterm', 'gui' ]
let attrs = s:PossibleAttributes()
call filter(attrs, 'hl[type][v:val] == 1')
let line .= ' ' . type . '=' . (empty(attrs) ? 'NONE' : join(attrs, ','))
if type != 'term'
let line .= ' ' . type . 'bg=' . (len(hl[type].bg) ? hl[type].bg : 'bg')
let line .= ' ' . type . 'fg=' . (len(hl[type].fg) ? hl[type].fg : 'fg')
if type == 'gui' && hl.gui.sp !~ '^\s*$'
let line .= ' ' . type . 'sp=' . hl[type].sp
endif
endif
endfor
let lines += [ line ]
endfor
endfor
let lines += [ 'endif' ]
let lines += [ '' ]
let lines += [ 'if 1' ]
let lines += [ ' delcommand CSAHi' ]
let lines += [ 'endif' ]
call writefile(lines, file)
finally
let &t_Co = save_t_Co
if exists("save_CSApprox_konsole")
let g:CSApprox_konsole = save_CSApprox_konsole
endif
if exists("save_CSApprox_eterm")
let g:CSApprox_eterm = save_CSApprox_eterm
endif
if exists("colors_name")
let g:colors_name = colors_name
endif
unlet g:syntax_cmd
if exists("syntax_cmd")
let g:syntax_cmd = syntax_cmd
endif
call s:CSApprox()
unlet s:inhibit_hicolor_test
endtry
endfunction
" {>2} Snapshot user command
command! -bang -nargs=1 -complete=file -bar CSApproxSnapshot
\ call s:CSApproxSnapshot(<f-args>, strlen("<bang>"))
" {>2} Manual updates
command -bang -bar CSApprox call s:CSApprox(strlen("<bang>"))
" {>1} Autocmds
" Set up an autogroup to hook us on the completion of any :colorscheme command
augroup CSApprox
au!
au ColorScheme * call s:CSApprox()
"au User CSApproxPost highlight Normal ctermbg=none | highlight NonText ctermbg=None
augroup END
" {>1} Restore compatibility options
let &cpo = s:savecpo
unlet s:savecpo
" {0} vim:sw=2:sts=2:et:fdm=expr:fde=substitute(matchstr(getline(v\:lnum),'^\\s*"\\s*{\\zs.\\{-}\\ze}'),'^$','=','')

41
Makefile Normal file
View File

@ -0,0 +1,41 @@
SCRIPT=ftplugin/csv.vim
DOC=doc/ft-csv.txt
PLUGIN=csv
VERSION=$(shell sed -n '/Version:/{s/^.*\(\S\.\S\+\)$$/\1/;p}' $(SCRIPT))
.PHONY : csv.vmb csv
all: vimball
release: $(PLUGIN) $(PLUGIN).vmb
clean:
find . -type f \( -name "*.vba" -o -name "*.vmb" -o -name "*.orig" \
-o -name "*.~*" -o -name ".VimballRecord" -o -name ".*.un~" \
-o -name "*.sw*" -o -name tags \) -delete
dist-clean: clean
vimball: $(PLUGIN).vmb install
install:
vim -N -u NONE -i NONE -c 'ru! plugin/vimballPlugin.vim' -c 'ru! vimballPlugin.vim' -c':so %' -c':q!' ${PLUGIN}.vmb
uninstall:
vim -N -u NONE -i NONE -c 'ru! plugin/vimballPlugin.vim' -c 'ru! vimballPlugin.vim' -c':RmVimball ${PLUGIN}.vmb'
undo:
for i in */*.orig; do mv -f "$$i" "$${i%.*}"; done
csv.vmb:
vim -N -u NONE -i NONE -c 'ru! plugin/vimballPlugin.vim' -c ':let g:vimball_home=getcwd()' -c ':call append("0", ["ftplugin/csv.vim", "doc/ft-csv.txt", "syntax/csv.vim", "ftdetect/csv.vim", "plugin/csv.vim"])' -c '$$d' -c ':%MkVimball! ${PLUGIN}' -c':q!'
ln -f $(PLUGIN).vmb $(PLUGIN)-$(VERSION).vmb
csv:
rm -f ${PLUGIN}.vmb
perl -i.orig -pne 'if (/Version:/) {s/\.(\d+)*/sprintf(".%d", 1+$$1)/e}' ${SCRIPT}
perl -i -pne 'if (/GetLatestVimScripts:/) {s/(\d+)\s+:AutoInstall:/sprintf("%d :AutoInstall:", 1+$$1)/e}' ${SCRIPT}
perl -i -pne 'if (/Last Change:/) {s/(:\s+).*\n$$/sprintf(": %s", `date -R`)/e}' ${SCRIPT}
perl -i -pne 'if (/Last Change:/) {s/(:\s+).*\n$$/sprintf(": %s", `LC_TIME=C date +"%a, %d %b %Y"`)/e}' ${DOC}
perl -i.orig -pne 'if (/Version:/) {s/\.(\d+).*/sprintf(".%d", 1+$$1)/e}' ${DOC}
cp -f $(DOC) README

1707
README Normal file

File diff suppressed because it is too large Load Diff

29
after/plugin/CSApprox.vim Executable file
View File

@ -0,0 +1,29 @@
" Copyright (c) 2012, Matthew J. Wozniski
" All rights reserved.
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are met:
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above copyright
" notice, this list of conditions and the following disclaimer in the
" documentation and/or other materials provided with the distribution.
" * The names of the contributors may not be used to endorse or promote
" products derived from this software without specific prior written
" permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ``AS IS'' AND ANY
" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
" DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
" The last thing to do when sourced is to run and actually fix up the colors.
if !has('gui_running') && exists(':CSApprox')
CSApprox
endif

255
autoload/pathogen.vim Executable file
View File

@ -0,0 +1,255 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.0
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" For management of individually installed plugins in ~/.vim/bundle (or
" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your
" .vimrc is the only other setup necessary.
"
" The API is documented inline below. For maximum ease of reading,
" :set foldmethod=marker
if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1
" Point of entry for basic default usage. Give a directory name to invoke
" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path
" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards,
" pathogen#cycle_filetype() is invoked.
function! pathogen#infect(...) abort " {{{1
let source_path = a:0 ? a:1 : 'bundle'
if source_path =~# '[\\/]'
call pathogen#runtime_prepend_subdirectories(source_path)
else
call pathogen#runtime_append_all_bundles(source_path)
endif
call pathogen#cycle_filetype()
return ''
endfunction " }}}1
" Split a path into a list.
function! pathogen#split(path) abort " {{{1
if type(a:path) == type([]) | return a:path | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction " }}}1
" Convert a list to a path.
function! pathogen#join(...) abort " {{{1
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
else
let i = 0
let space = ''
endif
let path = ""
while i < a:0
if type(a:000[i]) == type([])
let list = a:000[i]
let j = 0
while j < len(list)
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
let path .= ',' . escaped
let j += 1
endwhile
else
let path .= "," . a:000[i]
endif
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction " }}}1
" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort " {{{1
return call('pathogen#join',[1] + a:000)
endfunction " }}}1
" Remove duplicates from a list.
function! pathogen#uniq(list) abort " {{{1
let i = 0
let seen = {}
while i < len(a:list)
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
call remove(a:list,i)
elseif a:list[i] ==# ''
let i += 1
let empty = 1
else
let seen[a:list[i]] = 1
let i += 1
endif
endwhile
return a:list
endfunction " }}}1
" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#separator() abort " {{{1
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction " }}}1
" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort " {{{1
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
endfunction "}}}1
" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort " {{{1
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() " {{{1
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction " }}}1
" Checks if a bundle is 'disabled'. A bundle is considered 'disabled' if
" its 'basename()' is included in g:pathogen_disabled[]' or ends in a tilde.
function! pathogen#is_disabled(path) " {{{1
if a:path =~# '\~$'
return 1
elseif !exists("g:pathogen_disabled")
return 0
endif
let sep = pathogen#separator()
return index(g:pathogen_disabled, strpart(a:path, strridx(a:path, sep)+1)) != -1
endfunction "}}}1
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories.
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
let sep = pathogen#separator()
let before = filter(pathogen#glob_directories(a:path.sep."*"), '!pathogen#is_disabled(v:val)')
let after = filter(pathogen#glob_directories(a:path.sep."*".sep."after"), '!pathogen#is_disabled(v:val[0:-7])')
let rtp = pathogen#split(&rtp)
let path = expand(a:path)
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
return &rtp
endfunction " }}}1
" For each directory in rtp, check for a subdirectory named dir. If it
" exists, add all subdirectories of that subdirectory to the rtp, immediately
" after the original directory. If no argument is given, 'bundle' is used.
" Repeated calls with the same arguments are ignored.
function! pathogen#runtime_append_all_bundles(...) " {{{1
let sep = pathogen#separator()
let name = a:0 ? a:1 : 'bundle'
if "\n".s:done_bundles =~# "\\M\n".name."\n"
return ""
endif
let s:done_bundles .= name . "\n"
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name,'').sep.'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
else
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name.sep.'*[^~]'), '!pathogen#is_disabled(v:val)')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction
let s:done_bundles = ''
" }}}1
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() " {{{1
let sep = pathogen#separator()
for dir in pathogen#split(&rtp)
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
helptags `=dir.'/doc'`
endif
endfor
endfunction " }}}1
command! -bar Helptags :call pathogen#helptags()
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) "{{{1
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction " }}}1
" Backport of fnameescape().
function! pathogen#fnameescape(string) " {{{1
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction " }}}1
if exists(':Vedit')
finish
endif
function! s:find(count,cmd,file,lcd) " {{{1
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
elseif a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
return a:cmd.' '.pathogen#fnameescape(a:file)
else
return a:cmd.' '.pathogen#fnameescape(file)
endif
endfunction " }}}1
function! s:Findcomplete(A,L,P) " {{{1
let sep = pathogen#separator()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
\'f': 'ftplugin',
\'i': 'indent',
\'p': 'plugin',
\'s': 'syntax'}
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
let request = cheats[a:A[0]].a:A[1:-1]
else
let request = a:A
endif
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
let found = {}
for path in pathogen#split(&runtimepath)
let path = expand(path, ':p')
let matches = split(glob(path.sep.pattern),"\n")
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
for match in matches
let found[match] = 1
endfor
endfor
return sort(keys(found))
endfunction " }}}1
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2:

1
autoload/vim-pathogen Submodule

@ -0,0 +1 @@
Subproject commit 06da921608b971fb47603671bcafdb2843992eb3

View File

@ -0,0 +1,207 @@
" Maintainer: Robert Melton ( robert -at- robertmelton -dot- com)
" Last Change: 2012 Oct 28th
" default schemes
amenu T&hemes.D&efault.Blue :colo blue<CR>
amenu T&hemes.D&efault.DarkBlue :colo darkblue<CR>
amenu T&hemes.D&efault.Default :colo default<CR>
amenu T&hemes.D&efault.Delek :colo delek<CR>
amenu T&hemes.D&efault.Desert :colo desert<CR>
amenu T&hemes.D&efault.ElfLord :colo elflord<CR>
amenu T&hemes.D&efault.Evening :colo evening<CR>
amenu T&hemes.D&efault.Koehler :colo koehler<CR>
amenu T&hemes.D&efault.Morning :colo morning<CR>
amenu T&hemes.D&efault.Murphy :colo murphy<CR>
amenu T&hemes.D&efault.Pablo :colo pablo<CR>
amenu T&hemes.D&efault.PeachPuff :colo peachpuff<CR>
amenu T&hemes.D&efault.Ron :colo ron<CR>
amenu T&hemes.D&efault.Shine :colo shine<CR>
amenu T&hemes.D&efault.Torte :colo torte<CR>
amenu T&hemes.-s1- :
" New
amenu T&hemes.&New.&Dark.Wombat256 :colo wombat256<CR>
amenu T&hemes.&New.&Dark.Wombat256mod :colo wombat256mod<CR>
amenu T&hemes.&New.&Dark.Zendnb :colo zendnb<CR>
amenu T&hemes.&New.&Dark.Vimhut :colo vimhut<CR>
amenu T&hemes.&New.&Dark.Sorcerer :colo sorcerer<CR>
amenu T&hemes.&New.&Dark.Mizore :colo mizore<CR>
amenu T&hemes.&New.&Dark.Midnight :colo midnight<CR>
amenu T&hemes.&New.&Dark.Midnight2 :colo midnight2<CR>
amenu T&hemes.&New.&Dark.Manuscript :colo manuscript<CR>
amenu T&hemes.&New.&Dark.Luinnar :colo luinnar<CR>
amenu T&hemes.&New.&Dark.LiquidCarbon :colo liquidcarbon<CR>
amenu T&hemes.&New.&Dark.Gentooish :colo gentooish<CR>
amenu T&hemes.&New.&Dark.FU :colo fu<CR>
amenu T&hemes.&New.&Dark.Dejavu :colo dejavu<CR>
amenu T&hemes.&New.&Dark.Blackbeauty :colo blackbeauty<CR>
amenu T&hemes.&New.&Other.Tesla :colo tesla<CR>
amenu T&hemes.&New.&Other.Solarized :colo solarized<CR>
amenu T&hemes.&New.&Other.PSClone :colo psclone<CR>
amenu T&hemes.&New.&Other.Paradox :colo paradox<CR>
amenu T&hemes.&New.&Other.Omen :colo omen<CR>
amenu T&hemes.&New.&Other.NightVision :colo nightvision<CR>
amenu T&hemes.&New.&Other.Masmed :colo masmed<CR>
amenu T&hemes.&New.&Other.Deepblue :colo deepblue<CR>
amenu T&hemes.&New.&Other.Darkburn :colo darkburn<CR>
amenu T&hemes.&New.&Other.Bigbang :colo bigbang<CR>
amenu T&hemes.&New.&Other.Astroboy :colo astroboy<CR>
amenu T&hemes.&New.&Other.Anokha :colo anokha<CR>
amenu T&hemes.&New.&Light.Zenesque :colo zenesque<CR>
amenu T&hemes.&New.&Light.Scame :colo scame<CR>
amenu T&hemes.&New.&Light.Newspaper :colo newspaper<CR>
amenu T&hemes.&New.&Light.Montz :colo montz<CR>
amenu T&hemes.&New.&Light.MickeySoft :colo mickeysoft<CR>
amenu T&hemes.&New.&Light.MayanSmoke :colo mayansmoke<CR>
amenu T&hemes.&New.&Light.IntelliJ :colo intellij<CR>
amenu T&hemes.&New.&Light.Imperial :colo imperial<CR>
amenu T&hemes.&New.&Light.Greyhouse :colo greyhouse<CR>
amenu T&hemes.&New.&Light.Github :colo github<CR>
amenu T&hemes.&New.&Light.Gaea :colo gaea<CR>
amenu T&hemes.&New.&Light.Calmbreeze :colo calmbreeze<CR>
" Updated
amenu T&hemes.&Updated.&Dark.DarkZ :colo darkz<CR>
amenu T&hemes.&Updated.&Dark.DesertEx :colo desertEx<CR>
amenu T&hemes.&Updated.&Dark.Earendel :colo earendel<CR>
amenu T&hemes.&Updated.&Dark.Fruity :colo fruity<CR>
amenu T&hemes.&Updated.&Dark.Jellybeans :colo jellybeans<CR>
amenu T&hemes.&Updated.&Dark.Leo :colo leo<CR>
amenu T&hemes.&Updated.&Dark.Lucius :colo lucius<CR>
amenu T&hemes.&Updated.&Dark.Matrix :colo matrix<CR>
amenu T&hemes.&Updated.&Dark.Metacosm :colo metacosm<CR>
amenu T&hemes.&Updated.&Dark.Moria :colo moria<CR>
amenu T&hemes.&Updated.&Dark.Neverness :colo neverness<CR>
amenu T&hemes.&Updated.&Dark.Railscasts :colo railscasts<CR>
amenu T&hemes.&Updated.&Dark.Synic :colo synic<CR>
amenu T&hemes.&Updated.&Dark.Vividchalk :colo vividchalk<CR>
amenu T&hemes.&Updated.&Dark.Xoria256 :colo xoria256<CR>
amenu T&hemes.&Updated.&Dark.Zenburn :colo zenburn<CR>
amenu T&hemes.&Updated.&Light.Biogoo :colo biogoo<CR>
amenu T&hemes.&Updated.&Light.Print_bw :colo print_bw<CR>
amenu T&hemes.&Updated.&Light.Pyte :colo pyte<CR>
amenu T&hemes.&Updated.&Light.VYLight :colo vylight<CR>
amenu T&hemes.&Updated.&Other.Moss :colo moss<CR>
amenu T&hemes.&Updated.&Other.Peaksea :colo peaksea<CR>
" Themepack Themes
amenu T&hemes.&Dark.Adaryn :colo adaryn<CR>
amenu T&hemes.&Dark.Adrian :colo adrian<CR>
amenu T&hemes.&Dark.Anotherdark :colo anotherdark<CR>
amenu T&hemes.&Dark.Asu1dark :colo asu1dark<CR>
amenu T&hemes.&Dark.BlackSea :colo blacksea<CR>
amenu T&hemes.&Dark.Brookstream :colo brookstream<CR>
amenu T&hemes.&Dark.Calmar256-dark :colo calmar256-dark<CR>
amenu T&hemes.&Dark.Camo :colo camo<CR>
amenu T&hemes.&Dark.Candy :colo candy<CR>
amenu T&hemes.&Dark.Candycode :colo candycode<CR>
amenu T&hemes.&Dark.Colorer :colo colorer<CR>
amenu T&hemes.&Dark.Dante :colo dante<CR>
amenu T&hemes.&Dark.Darkbone :colo darkbone<CR>
amenu T&hemes.&Dark.Darkspectrum :colo darkspectrum<CR>
amenu T&hemes.&Dark.Desert256 :colo desert256<CR>
amenu T&hemes.&Dark.Dusk :colo dusk<CR>
amenu T&hemes.&Dark.DwBlue :colo dw_blue<CR>
amenu T&hemes.&Dark.DwCyan :colo dw_cyan<CR>
amenu T&hemes.&Dark.DwGreen :colo dw_green<CR>
amenu T&hemes.&Dark.DwOrange :colo dw_orange<CR>
amenu T&hemes.&Dark.DwPurple :colo dw_purple<CR>
amenu T&hemes.&Dark.DwRed :colo dw_red<CR>
amenu T&hemes.&Dark.DwYellow :colo dw_yellow<CR>
amenu T&hemes.&Dark.Ekvoli :colo ekvoli<CR>
amenu T&hemes.&Dark.Fnaqevan :colo fnaqevan<CR>
amenu T&hemes.&Dark.Freya :colo freya<CR>
amenu T&hemes.&Dark.Golden :colo golden<CR>
amenu T&hemes.&Dark.Herald :colo herald<CR>
amenu T&hemes.&Dark.Inkpot :colo inkpot<CR>
amenu T&hemes.&Dark.Jammy :colo jammy<CR>
amenu T&hemes.&Dark.Kellys :colo kellys<CR>
amenu T&hemes.&Dark.Lettuce :colo lettuce<CR>
amenu T&hemes.&Dark.Manxome :colo manxome<CR>
amenu T&hemes.&Dark.Maroloccio :colo maroloccio<CR>
amenu T&hemes.&Dark.Molokai :colo molokai<CR>
amenu T&hemes.&Dark.Motus :colo motus<CR>
amenu T&hemes.&Dark.Mustang :colo mustang<CR>
amenu T&hemes.&Dark.Neon :colo neon<CR>
amenu T&hemes.&Dark.Northland :colo northland<CR>
amenu T&hemes.&Dark.Oceanblack :colo oceanblack<CR>
amenu T&hemes.&Dark.Railscasts2 :colo railscasts2<CR>
amenu T&hemes.&Dark.Rdark :colo rdark<CR>
amenu T&hemes.&Dark.Relaxedgreen :colo relaxedgreen<CR>
amenu T&hemes.&Dark.Rootwater :colo rootwater<CR>
amenu T&hemes.&Dark.Tango :colo tango<CR>
amenu T&hemes.&Dark.Tango2 :colo tango2<CR>
amenu T&hemes.&Dark.TIRBlack :colo tir_black<CR>
amenu T&hemes.&Dark.Twilight :colo twilight<CR>
amenu T&hemes.&Dark.Two2Tango :colo two2tango<CR>
amenu T&hemes.&Dark.Vibrantink :colo vibrantink<CR>
amenu T&hemes.&Dark.Wombat :colo wombat<CR>
amenu T&hemes.&Dark.Wuye :colo wuye<CR>
amenu T&hemes.&Dark.Zmrok :colo zmrok<CR>
amenu T&hemes.&Light.Autumn :colo autumn<CR>
amenu T&hemes.&Light.Autumn2 :colo autumn2<CR>
amenu T&hemes.&Light.Autumnleaf :colo autumnleaf<CR>
amenu T&hemes.&Light.Baycomb :colo baycomb<CR>
amenu T&hemes.&Light.BClear :colo bclear<CR>
amenu T&hemes.&Light.Buttercream :colo buttercream<CR>
amenu T&hemes.&Light.Calmar256-light :colo calmar256-light<CR>
amenu T&hemes.&Light.Chela_light :colo chela_light<CR>
amenu T&hemes.&Light.Dawn :colo dawn<CR>
amenu T&hemes.&Light.Eclipse :colo eclipse<CR>
amenu T&hemes.&Light.Fine_blue :colo fine_blue<CR>
amenu T&hemes.&Light.Fog :colo fog<CR>
amenu T&hemes.&Light.Fruit :colo fruit<CR>
amenu T&hemes.&Light.Habilight :colo habilight<CR>
amenu T&hemes.&Light.Impact :colo impact<CR>
amenu T&hemes.&Light.Ironman :colo ironman<CR>
amenu T&hemes.&Light.Martin_krischik :colo martin_krischik<CR>
amenu T&hemes.&Light.Nuvola :colo nuvola<CR>
amenu T&hemes.&Light.Oceanlight :colo oceanlight<CR>
amenu T&hemes.&Light.PapayaWhip :colo PapayaWhip<CR>
amenu T&hemes.&Light.Satori :colo satori<CR>
amenu T&hemes.&Light.Sienna :colo sienna<CR>
amenu T&hemes.&Light.Silent :colo silent<CR>
amenu T&hemes.&Light.Simpleandfriendly :colo simpleandfriendly<CR>
amenu T&hemes.&Light.SoSo :colo soso<CR>
amenu T&hemes.&Light.Spring :colo spring<CR>
amenu T&hemes.&Light.SummerFruit256 :colo summerfruit256<CR>
amenu T&hemes.&Light.TAqua :colo taqua<CR>
amenu T&hemes.&Light.TCSoft :colo tcsoft<CR>
amenu T&hemes.&Light.Tolerable :colo tolerable<CR>
amenu T&hemes.&Light.Vc :colo vc<CR>
amenu T&hemes.&Light.Winter :colo winter<CR>
amenu T&hemes.&Other.Aiseered :colo aiseered<CR>
amenu T&hemes.&Other.Aqua :colo aqua<CR>
amenu T&hemes.&Other.Astronaut :colo astronaut<CR>
amenu T&hemes.&Other.Bluegreen :colo bluegreen<CR>
amenu T&hemes.&Other.Borland :colo borland<CR>
amenu T&hemes.&Other.Breeze :colo breeze<CR>
amenu T&hemes.&Other.Chocolateliquor :colo chocolateliquor<CR>
amenu T&hemes.&Other.Clarity :colo clarity<CR>
amenu T&hemes.&Other.CleanPHP :colo cleanphp<CR>
amenu T&hemes.&Other.Darkblue2 :colo darkblue2<CR>
amenu T&hemes.&Other.Darkslategray :colo darkslategray<CR>
amenu T&hemes.&Other.Denim :colo denim<CR>
amenu T&hemes.&Other.Guardian :colo guardian<CR>
amenu T&hemes.&Other.Marklar :colo marklar<CR>
amenu T&hemes.&Other.Navajo-night :colo navajo-night<CR>
amenu T&hemes.&Other.Navajo :colo navajo<CR>
amenu T&hemes.&Other.Night :colo night<CR>
amenu T&hemes.&Other.Nightshimmer :colo nightshimmer<CR>
amenu T&hemes.&Other.NoQuarter :colo no_quarter<CR>
amenu T&hemes.&Other.Oceandeep :colo oceandeep<CR>
amenu T&hemes.&Other.Olive :colo olive<CR>
amenu T&hemes.&Other.RobinHood :colo robinhood<CR>
amenu T&hemes.&Other.Sea :colo sea<CR>
amenu T&hemes.&Other.Settlemyer :colo settlemyer<CR>
amenu T&hemes.&Other.SoftBlue :colo softblue<CR>
amenu T&hemes.&Other.Tabula :colo tabula<CR>
amenu T&hemes.&Other.Wood :colo wood<CR>
amenu T&hemes.&Other.Xemacs :colo xemacs<CR>

34
bundle/gundo/README.markdown Executable file
View File

@ -0,0 +1,34 @@
<a href="http://flattr.com/thing/74149/Gundo-vim" target="_blank">
<img src="http://api.flattr.com/button/button-compact-static-100x17.png" alt="Flattr this" title="Flattr this" border="0" /></a>
Gundo.vim is Vim plugin to visualize your Vim undo tree.
Preview
-------
Screencast:
### [http://screenr.com/M9l](http://screenr.com/M9l)
Screenshot:
<a href="http://www.flickr.com/photos/sjl7678/5093114605/" title="gundo by stevelosh, on Flickr"><img src="http://farm5.static.flickr.com/4113/5093114605_ebc46d6494.jpg" width="487" height="500" alt="gundo" /></a>
Requirements
------------
* Vim 7.3+
* Python support for Vim
* Python 2.4+
Installation and Usage
----------------------
Check out the [project site][] for installation instructions.
[project site]: http://sjl.bitbucket.org/gundo.vim/
License
-------
GPLv2+, just like Mercurial.

577
bundle/gundo/autoload/gundo.py Executable file
View File

@ -0,0 +1,577 @@
# ============================================================================
# File: gundo.py
# Description: vim global plugin to visualize your undo tree
# Maintainer: Steve Losh <steve@stevelosh.com>
# License: GPLv2+ -- look it up.
# Notes: Much of this code was thiefed from Mercurial, and the rest was
# heavily inspired by scratch.vim and histwin.vim.
#
# ============================================================================
import difflib
import itertools
import sys
import time
import vim
# Mercurial's graphlog code --------------------------------------------------------
def asciiedges(seen, rev, parents):
"""adds edge info to changelog DAG walk suitable for ascii()"""
if rev not in seen:
seen.append(rev)
nodeidx = seen.index(rev)
knownparents = []
newparents = []
for parent in parents:
if parent in seen:
knownparents.append(parent)
else:
newparents.append(parent)
ncols = len(seen)
seen[nodeidx:nodeidx + 1] = newparents
edges = [(nodeidx, seen.index(p)) for p in knownparents]
if len(newparents) > 0:
edges.append((nodeidx, nodeidx))
if len(newparents) > 1:
edges.append((nodeidx, nodeidx + 1))
nmorecols = len(seen) - ncols
return nodeidx, edges, ncols, nmorecols
def get_nodeline_edges_tail(
node_index, p_node_index, n_columns, n_columns_diff, p_diff, fix_tail):
if fix_tail and n_columns_diff == p_diff and n_columns_diff != 0:
# Still going in the same non-vertical direction.
if n_columns_diff == -1:
start = max(node_index + 1, p_node_index)
tail = ["|", " "] * (start - node_index - 1)
tail.extend(["/", " "] * (n_columns - start))
return tail
else:
return ["\\", " "] * (n_columns - node_index - 1)
else:
return ["|", " "] * (n_columns - node_index - 1)
def draw_edges(edges, nodeline, interline):
for (start, end) in edges:
if start == end + 1:
interline[2 * end + 1] = "/"
elif start == end - 1:
interline[2 * start + 1] = "\\"
elif start == end:
interline[2 * start] = "|"
else:
nodeline[2 * end] = "+"
if start > end:
(start, end) = (end, start)
for i in range(2 * start + 1, 2 * end):
if nodeline[i] != "+":
nodeline[i] = "-"
def fix_long_right_edges(edges):
for (i, (start, end)) in enumerate(edges):
if end > start:
edges[i] = (start, end + 1)
def ascii(buf, state, type, char, text, coldata):
"""prints an ASCII graph of the DAG
takes the following arguments (one call per node in the graph):
- Somewhere to keep the needed state in (init to asciistate())
- Column of the current node in the set of ongoing edges.
- Type indicator of node data == ASCIIDATA.
- Payload: (char, lines):
- Character to use as node's symbol.
- List of lines to display as the node's text.
- Edges; a list of (col, next_col) indicating the edges between
the current node and its parents.
- Number of columns (ongoing edges) in the current revision.
- The difference between the number of columns (ongoing edges)
in the next revision and the number of columns (ongoing edges)
in the current revision. That is: -1 means one column removed;
0 means no columns added or removed; 1 means one column added.
"""
idx, edges, ncols, coldiff = coldata
assert -2 < coldiff < 2
if coldiff == -1:
# Transform
#
# | | | | | |
# o | | into o---+
# |X / |/ /
# | | | |
fix_long_right_edges(edges)
# add_padding_line says whether to rewrite
#
# | | | | | | | |
# | o---+ into | o---+
# | / / | | | # <--- padding line
# o | | | / /
# o | |
add_padding_line = (len(text) > 2 and coldiff == -1 and
[x for (x, y) in edges if x + 1 < y])
# fix_nodeline_tail says whether to rewrite
#
# | | o | | | | o | |
# | | |/ / | | |/ /
# | o | | into | o / / # <--- fixed nodeline tail
# | |/ / | |/ /
# o | | o | |
fix_nodeline_tail = len(text) <= 2 and not add_padding_line
# nodeline is the line containing the node character (typically o)
nodeline = ["|", " "] * idx
nodeline.extend([char, " "])
nodeline.extend(
get_nodeline_edges_tail(idx, state[1], ncols, coldiff,
state[0], fix_nodeline_tail))
# shift_interline is the line containing the non-vertical
# edges between this entry and the next
shift_interline = ["|", " "] * idx
if coldiff == -1:
n_spaces = 1
edge_ch = "/"
elif coldiff == 0:
n_spaces = 2
edge_ch = "|"
else:
n_spaces = 3
edge_ch = "\\"
shift_interline.extend(n_spaces * [" "])
shift_interline.extend([edge_ch, " "] * (ncols - idx - 1))
# draw edges from the current node to its parents
draw_edges(edges, nodeline, shift_interline)
# lines is the list of all graph lines to print
lines = [nodeline]
if add_padding_line:
lines.append(get_padding_line(idx, ncols, edges))
lines.append(shift_interline)
# make sure that there are as many graph lines as there are
# log strings
while len(text) < len(lines):
text.append("")
if len(lines) < len(text):
extra_interline = ["|", " "] * (ncols + coldiff)
while len(lines) < len(text):
lines.append(extra_interline)
# print lines
indentation_level = max(ncols, ncols + coldiff)
for (line, logstr) in zip(lines, text):
ln = "%-*s %s" % (2 * indentation_level, "".join(line), logstr)
buf.write(ln.rstrip() + '\n')
# ... and start over
state[0] = coldiff
state[1] = idx
def generate(dag, edgefn, current):
seen, state = [], [0, 0]
buf = Buffer()
for node, parents in list(dag):
if node.time:
age_label = age(int(node.time))
else:
age_label = 'Original'
line = '[%s] %s' % (node.n, age_label)
if node.n == current:
char = '@'
else:
char = 'o'
ascii(buf, state, 'C', char, [line], edgefn(seen, node, parents))
return buf.b
# Mercurial age function -----------------------------------------------------------
agescales = [("year", 3600 * 24 * 365),
("month", 3600 * 24 * 30),
("week", 3600 * 24 * 7),
("day", 3600 * 24),
("hour", 3600),
("minute", 60),
("second", 1)]
def age(ts):
'''turn a timestamp into an age string.'''
def plural(t, c):
if c == 1:
return t
return t + "s"
def fmt(t, c):
return "%d %s" % (c, plural(t, c))
now = time.time()
then = ts
if then > now:
return 'in the future'
delta = max(1, int(now - then))
if delta > agescales[0][1] * 2:
return time.strftime('%Y-%m-%d', time.gmtime(float(ts)))
for t, s in agescales:
n = delta // s
if n >= 2 or s == 1:
return '%s ago' % fmt(t, n)
# Python Vim utility functions -----------------------------------------------------
normal = lambda s: vim.command('normal %s' % s)
MISSING_BUFFER = "Cannot find Gundo's target buffer (%s)"
MISSING_WINDOW = "Cannot find window (%s) for Gundo's target buffer (%s)"
def _check_sanity():
'''Check to make sure we're not crazy.
Does the following things:
* Make sure the target buffer still exists.
'''
b = int(vim.eval('g:gundo_target_n'))
if not vim.eval('bufloaded(%d)' % b):
vim.command('echo "%s"' % (MISSING_BUFFER % b))
return False
w = int(vim.eval('bufwinnr(%d)' % b))
if w == -1:
vim.command('echo "%s"' % (MISSING_WINDOW % (w, b)))
return False
return True
def _goto_window_for_buffer(b):
w = int(vim.eval('bufwinnr(%d)' % int(b)))
vim.command('%dwincmd w' % w)
def _goto_window_for_buffer_name(bn):
b = vim.eval('bufnr("%s")' % bn)
return _goto_window_for_buffer(b)
def _undo_to(n):
n = int(n)
if n == 0:
vim.command('silent earlier %s' % (int(vim.eval('&undolevels')) + 1))
else:
vim.command('silent undo %d' % n)
INLINE_HELP = '''\
" Gundo for %s (%d)
" j/k - move between undo states
" p - preview diff of selected and current states
" <cr> - revert to selected state
'''
# Python undo tree data structures and functions -----------------------------------
class Buffer(object):
def __init__(self):
self.b = ''
def write(self, s):
self.b += s
class Node(object):
def __init__(self, n, parent, time, curhead):
self.n = int(n)
self.parent = parent
self.children = []
self.curhead = curhead
self.time = time
def _make_nodes(alts, nodes, parent=None):
p = parent
for alt in alts:
curhead = 'curhead' in alt
node = Node(n=alt['seq'], parent=p, time=alt['time'], curhead=curhead)
nodes.append(node)
if alt.get('alt'):
_make_nodes(alt['alt'], nodes, p)
p = node
def make_nodes():
ut = vim.eval('undotree()')
entries = ut['entries']
root = Node(0, None, False, 0)
nodes = []
_make_nodes(entries, nodes, root)
nodes.append(root)
nmap = dict((node.n, node) for node in nodes)
return nodes, nmap
def changenr(nodes):
_curhead_l = list(itertools.dropwhile(lambda n: not n.curhead, nodes))
if _curhead_l:
current = _curhead_l[0].parent.n
else:
current = int(vim.eval('changenr()'))
return current
# Gundo rendering ------------------------------------------------------------------
# Rendering utility functions
def _fmt_time(t):
return time.strftime('%Y-%m-%d %I:%M:%S %p', time.localtime(float(t)))
def _output_preview_text(lines):
_goto_window_for_buffer_name('__Gundo_Preview__')
vim.command('setlocal modifiable')
vim.current.buffer[:] = lines
vim.command('setlocal nomodifiable')
def _generate_preview_diff(current, node_before, node_after):
_goto_window_for_buffer(vim.eval('g:gundo_target_n'))
if not node_after.n: # we're at the original file
before_lines = []
_undo_to(0)
after_lines = vim.current.buffer[:]
before_name = 'n/a'
before_time = ''
after_name = 'Original'
after_time = ''
elif not node_before.n: # we're at a pseudo-root state
_undo_to(0)
before_lines = vim.current.buffer[:]
_undo_to(node_after.n)
after_lines = vim.current.buffer[:]
before_name = 'Original'
before_time = ''
after_name = node_after.n
after_time = _fmt_time(node_after.time)
else:
_undo_to(node_before.n)
before_lines = vim.current.buffer[:]
_undo_to(node_after.n)
after_lines = vim.current.buffer[:]
before_name = node_before.n
before_time = _fmt_time(node_before.time)
after_name = node_after.n
after_time = _fmt_time(node_after.time)
_undo_to(current)
return list(difflib.unified_diff(before_lines, after_lines,
before_name, after_name,
before_time, after_time))
def _generate_change_preview_diff(current, node_before, node_after):
_goto_window_for_buffer(vim.eval('g:gundo_target_n'))
_undo_to(node_before.n)
before_lines = vim.current.buffer[:]
_undo_to(node_after.n)
after_lines = vim.current.buffer[:]
before_name = node_before.n or 'Original'
before_time = node_before.time and _fmt_time(node_before.time) or ''
after_name = node_after.n or 'Original'
after_time = node_after.time and _fmt_time(node_after.time) or ''
_undo_to(current)
return list(difflib.unified_diff(before_lines, after_lines,
before_name, after_name,
before_time, after_time))
def GundoRenderGraph():
if not _check_sanity():
return
nodes, nmap = make_nodes()
for node in nodes:
node.children = [n for n in nodes if n.parent == node]
def walk_nodes(nodes):
for node in nodes:
if node.parent:
yield (node, [node.parent])
else:
yield (node, [])
dag = sorted(nodes, key=lambda n: int(n.n), reverse=True)
current = changenr(nodes)
result = generate(walk_nodes(dag), asciiedges, current).rstrip().splitlines()
result = [' ' + l for l in result]
target = (vim.eval('g:gundo_target_f'), int(vim.eval('g:gundo_target_n')))
if int(vim.eval('g:gundo_help')):
header = (INLINE_HELP % target).splitlines()
else:
header = []
vim.command('call s:GundoOpenGraph()')
vim.command('setlocal modifiable')
vim.current.buffer[:] = (header + result)
vim.command('setlocal nomodifiable')
i = 1
for line in result:
try:
line.split('[')[0].index('@')
i += 1
break
except ValueError:
pass
i += 1
vim.command('%d' % (i+len(header)-1))
def GundoRenderPreview():
if not _check_sanity():
return
target_state = vim.eval('s:GundoGetTargetState()')
# Check that there's an undo state. There may not be if we're talking about
# a buffer with no changes yet.
if target_state == None:
_goto_window_for_buffer_name('__Gundo__')
return
else:
target_state = int(target_state)
_goto_window_for_buffer(vim.eval('g:gundo_target_n'))
nodes, nmap = make_nodes()
current = changenr(nodes)
node_after = nmap[target_state]
node_before = node_after.parent
vim.command('call s:GundoOpenPreview()')
_output_preview_text(_generate_preview_diff(current, node_before, node_after))
_goto_window_for_buffer_name('__Gundo__')
def GundoRenderChangePreview():
if not _check_sanity():
return
target_state = vim.eval('s:GundoGetTargetState()')
# Check that there's an undo state. There may not be if we're talking about
# a buffer with no changes yet.
if target_state == None:
_goto_window_for_buffer_name('__Gundo__')
return
else:
target_state = int(target_state)
_goto_window_for_buffer(vim.eval('g:gundo_target_n'))
nodes, nmap = make_nodes()
current = changenr(nodes)
node_after = nmap[target_state]
node_before = nmap[current]
vim.command('call s:GundoOpenPreview()')
_output_preview_text(_generate_change_preview_diff(current, node_before, node_after))
_goto_window_for_buffer_name('__Gundo__')
# Gundo undo/redo
def GundoRevert():
if not _check_sanity():
return
target_n = int(vim.eval('s:GundoGetTargetState()'))
back = vim.eval('g:gundo_target_n')
_goto_window_for_buffer(back)
_undo_to(target_n)
vim.command('GundoRenderGraph')
_goto_window_for_buffer(back)
if int(vim.eval('g:gundo_close_on_revert')):
vim.command('GundoToggle')
def GundoPlayTo():
if not _check_sanity():
return
target_n = int(vim.eval('s:GundoGetTargetState()'))
back = int(vim.eval('g:gundo_target_n'))
vim.command('echo "%s"' % back)
_goto_window_for_buffer(back)
normal('zR')
nodes, nmap = make_nodes()
start = nmap[changenr(nodes)]
end = nmap[target_n]
def _walk_branch(origin, dest):
rev = origin.n < dest.n
nodes = []
if origin.n > dest.n:
current, final = origin, dest
else:
current, final = dest, origin
while current.n >= final.n:
if current.n == final.n:
break
nodes.append(current)
current = current.parent
else:
return None
nodes.append(current)
if rev:
return reversed(nodes)
else:
return nodes
branch = _walk_branch(start, end)
if not branch:
vim.command('unsilent echo "No path to that node from here!"')
return
for node in branch:
_undo_to(node.n)
vim.command('GundoRenderGraph')
normal('zz')
_goto_window_for_buffer(back)
vim.command('redraw')
vim.command('sleep 60m')
def initPythonModule():
if sys.version_info[:2] < (2, 4):
vim.command('let s:has_supported_python = 0')

469
bundle/gundo/autoload/gundo.vim Executable file
View File

@ -0,0 +1,469 @@
" ============================================================================
" File: gundo.vim
" Description: vim global plugin to visualize your undo tree
" Maintainer: Steve Losh <steve@stevelosh.com>
" License: GPLv2+ -- look it up.
" Notes: Much of this code was thiefed from Mercurial, and the rest was
" heavily inspired by scratch.vim and histwin.vim.
"
" ============================================================================
"{{{ Init
if v:version < '703'"{{{
function! s:GundoDidNotLoad()
echohl WarningMsg|echomsg "Gundo unavailable: requires Vim 7.3+"|echohl None
endfunction
command! -nargs=0 GundoToggle call s:GundoDidNotLoad()
finish
endif"}}}
if !exists('g:gundo_width')"{{{
let g:gundo_width = 45
endif"}}}
if !exists('g:gundo_preview_height')"{{{
let g:gundo_preview_height = 15
endif"}}}
if !exists('g:gundo_preview_bottom')"{{{
let g:gundo_preview_bottom = 0
endif"}}}
if !exists('g:gundo_right')"{{{
let g:gundo_right = 0
endif"}}}
if !exists('g:gundo_help')"{{{
let g:gundo_help = 1
endif"}}}
if !exists("g:gundo_map_move_older")"{{{
let g:gundo_map_move_older = 'j'
endif"}}}
if !exists("g:gundo_map_move_newer")"{{{
let g:gundo_map_move_newer = 'k'
endif"}}}
if !exists("g:gundo_close_on_revert")"{{{
let g:gundo_close_on_revert = 0
endif"}}}
if !exists("g:gundo_prefer_python3")"{{{
let g:gundo_prefer_python3 = 0
endif"}}}
if !exists("g:gundo_auto_preview")"{{{
let g:gundo_auto_preview = 1
endif"}}}
let s:has_supported_python = 0
if g:gundo_prefer_python3 && has('python3')"{{{
let s:has_supported_python = 2
elseif has('python')"
let s:has_supported_python = 1
endif
if !s:has_supported_python
function! s:GundoDidNotLoad()
echohl WarningMsg|echomsg "Gundo requires Vim to be compiled with Python 2.4+"|echohl None
endfunction
command! -nargs=0 GundoToggle call s:GundoDidNotLoad()
finish
endif"}}}
let s:plugin_path = escape(expand('<sfile>:p:h'), '\')
"}}}
"{{{ Gundo utility functions
function! s:GundoGetTargetState()"{{{
let target_line = matchstr(getline("."), '\v\[[0-9]+\]')
return matchstr(target_line, '\v[0-9]+')
endfunction"}}}
function! s:GundoGoToWindowForBufferName(name)"{{{
if bufwinnr(bufnr(a:name)) != -1
exe bufwinnr(bufnr(a:name)) . "wincmd w"
return 1
else
return 0
endif
endfunction"}}}
function! s:GundoIsVisible()"{{{
if bufwinnr(bufnr("__Gundo__")) != -1 || bufwinnr(bufnr("__Gundo_Preview__")) != -1
return 1
else
return 0
endif
endfunction"}}}
function! s:GundoInlineHelpLength()"{{{
if g:gundo_help
return 6
else
return 0
endif
endfunction"}}}
"}}}
"{{{ Gundo buffer settings
function! s:GundoMapGraph()"{{{
exec 'nnoremap <script> <silent> <buffer> ' . g:gundo_map_move_older . " :call <sid>GundoMove(1)<CR>"
exec 'nnoremap <script> <silent> <buffer> ' . g:gundo_map_move_newer . " :call <sid>GundoMove(-1)<CR>"
nnoremap <script> <silent> <buffer> <CR> :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> o :call <sid>GundoRevert()<CR>
nnoremap <script> <silent> <buffer> <down> :call <sid>GundoMove(1)<CR>
nnoremap <script> <silent> <buffer> <up> :call <sid>GundoMove(-1)<CR>
nnoremap <script> <silent> <buffer> gg gg:call <sid>GundoMove(1)<CR>
nnoremap <script> <silent> <buffer> P :call <sid>GundoPlayTo()<CR>
nnoremap <script> <silent> <buffer> p :call <sid>GundoRenderChangePreview()<CR>
nnoremap <script> <silent> <buffer> r :call <sid>GundoRenderPreview()<CR>
nnoremap <script> <silent> <buffer> q :call <sid>GundoClose()<CR>
cabbrev <script> <silent> <buffer> q call <sid>GundoClose()
cabbrev <script> <silent> <buffer> quit call <sid>GundoClose()
nnoremap <script> <silent> <buffer> <2-LeftMouse> :call <sid>GundoMouseDoubleClick()<CR>
endfunction"}}}
function! s:GundoMapPreview()"{{{
nnoremap <script> <silent> <buffer> q :call <sid>GundoClose()<CR>
cabbrev <script> <silent> <buffer> q call <sid>GundoClose()
cabbrev <script> <silent> <buffer> quit call <sid>GundoClose()
endfunction"}}}
function! s:GundoSettingsGraph()"{{{
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
setlocal nobuflisted
setlocal nomodifiable
setlocal filetype=gundo
setlocal nolist
setlocal nonumber
setlocal norelativenumber
setlocal nowrap
call s:GundoSyntaxGraph()
call s:GundoMapGraph()
endfunction"}}}
function! s:GundoSettingsPreview()"{{{
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal noswapfile
setlocal nobuflisted
setlocal nomodifiable
setlocal filetype=diff
setlocal nonumber
setlocal norelativenumber
setlocal nowrap
setlocal foldlevel=20
setlocal foldmethod=diff
call s:GundoMapPreview()
endfunction"}}}
function! s:GundoSyntaxGraph()"{{{
let b:current_syntax = 'gundo'
syn match GundoCurrentLocation '@'
syn match GundoHelp '\v^".*$'
syn match GundoNumberField '\v\[[0-9]+\]'
syn match GundoNumber '\v[0-9]+' contained containedin=GundoNumberField
hi def link GundoCurrentLocation Keyword
hi def link GundoHelp Comment
hi def link GundoNumberField Comment
hi def link GundoNumber Identifier
endfunction"}}}
"}}}
"{{{ Gundo buffer/window management
function! s:GundoResizeBuffers(backto)"{{{
call s:GundoGoToWindowForBufferName('__Gundo__')
exe "vertical resize " . g:gundo_width
call s:GundoGoToWindowForBufferName('__Gundo_Preview__')
exe "resize " . g:gundo_preview_height
exe a:backto . "wincmd w"
endfunction"}}}
function! s:GundoOpenGraph()"{{{
let existing_gundo_buffer = bufnr("__Gundo__")
if existing_gundo_buffer == -1
call s:GundoGoToWindowForBufferName('__Gundo_Preview__')
exe "new __Gundo__"
if g:gundo_preview_bottom
if g:gundo_right
wincmd L
else
wincmd H
endif
endif
call s:GundoResizeBuffers(winnr())
else
let existing_gundo_window = bufwinnr(existing_gundo_buffer)
if existing_gundo_window != -1
if winnr() != existing_gundo_window
exe existing_gundo_window . "wincmd w"
endif
else
call s:GundoGoToWindowForBufferName('__Gundo_Preview__')
if g:gundo_preview_bottom
if g:gundo_right
exe "botright vsplit +buffer" . existing_gundo_buffer
else
exe "topleft vsplit +buffer" . existing_gundo_buffer
endif
else
exe "split +buffer" . existing_gundo_buffer
endif
call s:GundoResizeBuffers(winnr())
endif
endif
if exists("g:gundo_tree_statusline")
let &l:statusline = g:gundo_tree_statusline
endif
endfunction"}}}
function! s:GundoOpenPreview()"{{{
let existing_preview_buffer = bufnr("__Gundo_Preview__")
if existing_preview_buffer == -1
if g:gundo_preview_bottom
exe "botright new __Gundo_Preview__"
else
if g:gundo_right
exe "botright vnew __Gundo_Preview__"
else
exe "topleft vnew __Gundo_Preview__"
endif
endif
else
let existing_preview_window = bufwinnr(existing_preview_buffer)
if existing_preview_window != -1
if winnr() != existing_preview_window
exe existing_preview_window . "wincmd w"
endif
else
if g:gundo_preview_bottom
exe "botright split +buffer" . existing_preview_buffer
else
if g:gundo_right
exe "botright vsplit +buffer" . existing_preview_buffer
else
exe "topleft vsplit +buffer" . existing_preview_buffer
endif
endif
endif
endif
if exists("g:gundo_preview_statusline")
let &l:statusline = g:gundo_preview_statusline
endif
endfunction"}}}
function! s:GundoClose()"{{{
if s:GundoGoToWindowForBufferName('__Gundo__')
quit
endif
if s:GundoGoToWindowForBufferName('__Gundo_Preview__')
quit
endif
exe bufwinnr(g:gundo_target_n) . "wincmd w"
endfunction"}}}
function! s:GundoOpen()"{{{
if !exists('g:gundo_py_loaded')
if s:has_supported_python == 2 && g:gundo_prefer_python3
exe 'py3file ' . s:plugin_path . '/gundo.py'
python3 initPythonModule()
else
exe 'pyfile ' . s:plugin_path . '/gundo.py'
python initPythonModule()
endif
if !s:has_supported_python
function! s:GundoDidNotLoad()
echohl WarningMsg|echomsg "Gundo unavailable: requires Vim 7.3+"|echohl None
endfunction
command! -nargs=0 GundoToggle call s:GundoDidNotLoad()
call s:GundoDidNotLoad()
return
endif"
let g:gundo_py_loaded = 1
endif
" Save `splitbelow` value and set it to default to avoid problems with
" positioning new windows.
let saved_splitbelow = &splitbelow
let &splitbelow = 0
call s:GundoOpenPreview()
exe bufwinnr(g:gundo_target_n) . "wincmd w"
call s:GundoRenderGraph()
call s:GundoRenderPreview()
" Restore `splitbelow` value.
let &splitbelow = saved_splitbelow
endfunction"}}}
function! s:GundoToggle()"{{{
if s:GundoIsVisible()
call s:GundoClose()
else
let g:gundo_target_n = bufnr('')
let g:gundo_target_f = @%
call s:GundoOpen()
endif
endfunction"}}}
function! s:GundoShow()"{{{
if !s:GundoIsVisible()
let g:gundo_target_n = bufnr('')
let g:gundo_target_f = @%
call s:GundoOpen()
endif
endfunction"}}}
function! s:GundoHide()"{{{
if s:GundoIsVisible()
call s:GundoClose()
endif
endfunction"}}}
"}}}
"{{{ Gundo mouse handling
function! s:GundoMouseDoubleClick()"{{{
let start_line = getline('.')
if stridx(start_line, '[') == -1
return
else
call s:GundoRevert()
endif
endfunction"}}}
"}}}
"{{{ Gundo movement
function! s:GundoMove(direction) range"{{{
let start_line = getline('.')
if v:count1 == 0
let move_count = 1
else
let move_count = v:count1
endif
let distance = 2 * move_count
" If we're in between two nodes we move by one less to get back on track.
if stridx(start_line, '[') == -1
let distance = distance - 1
endif
let target_n = line('.') + (distance * a:direction)
" Bound the movement to the graph.
if target_n <= s:GundoInlineHelpLength() - 1
call cursor(s:GundoInlineHelpLength(), 0)
else
call cursor(target_n, 0)
endif
let line = getline('.')
" Move to the node, whether it's an @ or an o
let idx1 = stridx(line, '@')
let idx2 = stridx(line, 'o')
if idx1 != -1
call cursor(0, idx1 + 1)
else
call cursor(0, idx2 + 1)
endif
if g:gundo_auto_preview == 1
call s:GundoRenderPreview()
endif
endfunction"}}}
"}}}
"{{{ Gundo rendering
function! s:GundoRenderGraph()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
python3 GundoRenderGraph()
else
python GundoRenderGraph()
endif
endfunction"}}}
function! s:GundoRenderPreview()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
python3 GundoRenderPreview()
else
python GundoRenderPreview()
endif
endfunction"}}}
function! s:GundoRenderChangePreview()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
python3 GundoRenderChangePreview()
else
python GundoRenderChangePreview()
endif
endfunction"}}}
"}}}
"{{{ Gundo undo/redo
function! s:GundoRevert()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
python3 GundoRevert()
else
python GundoRevert()
endif
endfunction"}}}
function! s:GundoPlayTo()"{{{
if s:has_supported_python == 2 && g:gundo_prefer_python3
python3 GundoPlayTo()
else
python GundoPlayTo()
endif
endfunction"}}}
"}}}
"{{{ Misc
function! gundo#GundoToggle()"{{{
call s:GundoToggle()
endfunction"}}}
function! gundo#GundoShow()"{{{
call s:GundoShow()
endfunction"}}}
function! gundo#GundoHide()"{{{
call s:GundoHide()
endfunction"}}}
function! gundo#GundoRenderGraph()"{{{
call s:GundoRenderGraph()
endfunction"}}}
augroup GundoAug
autocmd!
autocmd BufNewFile __Gundo__ call s:GundoSettingsGraph()
autocmd BufNewFile __Gundo_Preview__ call s:GundoSettingsPreview()
augroup END
"}}}

283
bundle/gundo/doc/gundo.txt Executable file
View File

@ -0,0 +1,283 @@
*gundo.txt* Graph your undo tree so you can actually USE it.
Making Vim's undo tree usable by humans.
==============================================================================
CONTENTS *Gundo-contents*
1. Intro ........................... |GundoIntro|
2. Usage ........................... |GundoUsage|
3. Configuration ................... |GundoConfig|
3.1 gundo_width ............... |gundo_width|
3.2 gundo_preview_height ...... |gundo_preview_height|
3.3 gundo_preview_bottom ...... |gundo_preview_bottom|
3.4 gundo_right ............... |gundo_right|
3.5 gundo_help ................ |gundo_help|
3.6 gundo_disable ............. |gundo_disable|
3.7 gundo_map_move_older ...... |gundo_map_move_older|
gundo_map_move_newer ...... |gundo_map_move_newer|
3.8 gundo_close_on_revert ..... |gundo_close_on_revert|
3.9 gundo_preview_statusline .. |gundo_preview_statusline|
gundo_tree_statusline ..... |gundo_tree_statusline|
3.10 gundo_auto_preview ........ |gundo_auto_preview|
4. License ......................... |GundoLicense|
5. Bugs ............................ |GundoBugs|
6. Contributing .................... |GundoContributing|
7. Changelog ....................... |GundoChangelog|
8. Credits ......................... |GundoCredits|
==============================================================================
1. Intro *GundoIntro*
You know that Vim lets you undo changes like any text editor. What you might
not know is that it doesn't just keep a list of your changes -- it keeps
a goddamed |:undo-tree| of them.
Say you make a change (call it X), undo that change, and then make another
change (call it Y). With most editors, change X is now gone forever. With Vim
you can get it back.
The problem is that trying to do this in the real world is painful. Vim gives
you an |:undolist| command that shows you the leaves of the tree. Good luck
finding the change you want in that list.
Gundo is a plugin to make browsing this ridiculously powerful undo tree less
painful.
==============================================================================
2. Usage *GundoUsage*
We'll get to the technical details later, but if you're a human the first
thing you need to do is add a mapping to your |:vimrc| to toggle the undo
graph: >
nnoremap <F5> :GundoToggle<CR>
Change the mapped key to suit your taste. We'll stick with F5 because that's
what the author uses.
Now you can press F5 to toggle the undo graph and preview pane, which will
look something like this: >
Undo graph File
+-----------------------------------+------------------------------------+
| " Gundo for something.txt [1] |one |
| " j/k - move between undo states |two |
| " <cr> - revert to that state |three |
| |five |
| @ [5] 3 hours ago | |
| | | |
| | o [4] 4 hours ago | |
| | | | |
| o | [3] 4 hours ago | |
| | | | |
| o | [2] 4 hours ago | |
| |/ | |
| o [1] 4 hours ago | |
| | | |
| o [0] Original | |
+-----------------------------------+ |
| --- 3 2010-10-12 06:27:35 PM | |
| +++ 5 2010-10-12 07:38:37 PM | |
| @@ -1,3 +1,4 | |
| one | |
| two | |
| three | |
| +five | |
+-----------------------------------+------------------------------------+
Preview pane
Your current position in the undo tree is marked with an '@' character. Other
nodes are marked with an 'o' character.
When you toggle open the graph Gundo will put your cursor on your current
position in the tree. You can move up and down the graph with the j and
k keys.
You can move to the top of the graph (the newest state) with gg and to the
bottom of the graph (the oldest state) with G.
As you move between undo states the preview pane will show you a unified diff
of the change that state made.
Pressing enter on a state (or double clicking on it) will revert the contents
of the file to match that state.
You can use p on a state to make the preview window show the diff between
your current state and the selected state, instead of a preview of what the
selected state changed.
Pressing P while on a state will initiate "play to" mode targeted at that
state. This will replay all the changes between your current state and the
target, with a slight pause after each change. It's mostly useless, but can be
fun to watch and see where your editing lags -- that might be a good place to
define a new mapping to speed up your editing.
Pressing q while in the undo graph will close it. You can also just press your
toggle mapping key.
==============================================================================
3. Configuration *GundoConfig*
You can tweak the behavior of Gundo by setting a few variables in your :vimrc
file. For example: >
let g:gundo_width = 60
let g:gundo_preview_height = 40
let g:gundo_right = 1
------------------------------------------------------------------------------
3.1 g:gundo_width *gundo_width*
Set the horizontal width of the Gundo graph (and preview).
Default: 45
------------------------------------------------------------------------------
3.2 g:gundo_preview_height *gundo_preview_height*
Set the vertical height of the Gundo preview.
Default: 15
------------------------------------------------------------------------------
3.3 g:gundo_preview_bottom *gundo_preview_bottom*
Force the preview window below current windows instead of below the graph.
This gives the preview window more space to show the unified diff.
Example:
+--------+ +--------+
!g! ! ! !g!
!g! ! or ! !g!
!g!______! !______!g!
!g!pppppp! !pppppp!g!
+--------+ +--------+
Default: 0
------------------------------------------------------------------------------
3.4 g:gundo_right *gundo_right*
Set this to 1 to make the Gundo graph (and preview) open on the right side
instead of the left.
Default: 0 (off, open on the left side)
------------------------------------------------------------------------------
3.5 g:gundo_help *gundo_help*
Set this to 0 to disable the help text in the Gundo graph window.
Default: 1 (show the help)
------------------------------------------------------------------------------
3.6 g:gundo_disable *gundo_disable*
Set this to 1 to disable Gundo entirely.
Useful if you use the same ~/.vim folder on multiple machines, and some of
them may not have Python support.
Default: 0 (Gundo is enabled as usual)
------------------------------------------------------------------------------
3.7 g:gundo_map_move_older, g:gundo_map_move_newer *gundo_map_move_older*
*gundo_map_move_newer*
These options let you change the keys that navigate the undo graph. This is
useful if you use a Dvorak keyboard and have changed your movement keys.
Default: gundo_map_move_older = "j"
gundo_map_move_newer = "k"
------------------------------------------------------------------------------
3.8 g:gundo_close_on_revert *gundo_close_on_revert*
Set this to 1 to automatically close the Gundo windows when reverting.
Default: 0 (windows do not automatically close)
------------------------------------------------------------------------------
3.9 g:gundo_preview_statusline *gundo_preview_statusline*
g:gundo_tree_statusline *gundo_tree_statusline*
Set these to a string to display it as the status line for each Gundo window.
Default: unset (windows use the default statusline)
------------------------------------------------------------------------------
3.10 g:gundo_auto_preview *gundo_auto_preview*
Set this to 0 to disable automatically rendering preview diffs as you move
through the undo tree (you can still render a specific diff with r). This can
be useful on large files and undo trees to speed up Gundo.
Default: 1 (automatically preview diffs)
==============================================================================
4. License *GundoLicense*
GPLv2+. Look it up.
==============================================================================
5. Bugs *GundoBugs*
If you find a bug please post it on the issue tracker:
http://bitbucket.org/sjl/gundo.vim/issues?status=new&status=open
==============================================================================
6. Contributing *GundoContributing*
Think you can make this plugin better? Awesome. Fork it on BitBucket or GitHub
and send a pull request.
BitBucket: http://bitbucket.org/sjl/gundo.vim/
GitHub: http://github.com/sjl/gundo.vim/
==============================================================================
7. Changelog *GundoChangelog*
v2.4.0
* Add auto preview option.
* Add 'r' mapping to preview current state.
* Add public gundo#GundoShow() and gundo#GundoHide() functions.
v2.3.0
* Add statusline configuration.
v2.2.2
* More performance improvements.
v2.2.1
* Refactoring and performance improvements.
v2.2.0
* Add the g:gundo_close_on_revert setting.
* Fix a bug with the splitbelow setting.
v2.1.1
* Fix a bug with the movement key mappings.
v2.1.0
* Warnings about having an incompatible Vim and/or Python installation
are now deferred until the first time you try to use Gundo, instead
of being displayed on launch.
* The <j> and <k> mappings are now configurable with
g:gundo_map_move_older and g:gundo_map_move_newer.
* The o, <Up> and <Down> keys are now mapped in the Gundo pane.
* Improve and add several unit tests for Gundo.
v2.0.0
* Make GundoToggle close the Gundo windows if they're visible but not the
current window, instead of moving to them.
* Add the g:gundo_help setting.
* Add the g:gundo_disable setting.
* Add the 'p' mapping to preview the result of reverting to the selected
state.
* Fix movement commands with counts in the graph.
v1.0.0
* Initial stable release.
==============================================================================
8. Credits *GundoCredits*
The graphing code was all taken from Mercurial, hence the GPLv2+ license.
The plugin was heavily inspired by histwin.vim, and the code for scratch.vim
helped the author get started.
==============================================================================

22
bundle/gundo/doc/tags Normal file
View File

@ -0,0 +1,22 @@
Gundo-contents gundo.txt /*Gundo-contents*
GundoBugs gundo.txt /*GundoBugs*
GundoChangelog gundo.txt /*GundoChangelog*
GundoConfig gundo.txt /*GundoConfig*
GundoContributing gundo.txt /*GundoContributing*
GundoCredits gundo.txt /*GundoCredits*
GundoIntro gundo.txt /*GundoIntro*
GundoLicense gundo.txt /*GundoLicense*
GundoUsage gundo.txt /*GundoUsage*
gundo.txt gundo.txt /*gundo.txt*
gundo_auto_preview gundo.txt /*gundo_auto_preview*
gundo_close_on_revert gundo.txt /*gundo_close_on_revert*
gundo_disable gundo.txt /*gundo_disable*
gundo_help gundo.txt /*gundo_help*
gundo_map_move_newer gundo.txt /*gundo_map_move_newer*
gundo_map_move_older gundo.txt /*gundo_map_move_older*
gundo_preview_bottom gundo.txt /*gundo_preview_bottom*
gundo_preview_height gundo.txt /*gundo_preview_height*
gundo_preview_statusline gundo.txt /*gundo_preview_statusline*
gundo_right gundo.txt /*gundo_right*
gundo_tree_statusline gundo.txt /*gundo_tree_statusline*
gundo_width gundo.txt /*gundo_width*

24
bundle/gundo/plugin/gundo.vim Executable file
View File

@ -0,0 +1,24 @@
" ============================================================================
" File: gundo.vim
" Description: vim global plugin to visualize your undo tree
" Maintainer: Steve Losh <steve@stevelosh.com>
" License: GPLv2+ -- look it up.
" Notes: Much of this code was thiefed from Mercurial, and the rest was
" heavily inspired by scratch.vim and histwin.vim.
"
" ============================================================================
"{{{ Init
if !exists('g:gundo_debug') && (exists('g:gundo_disable') || exists('loaded_gundo') || &cp)"{{{
finish
endif
let loaded_gundo = 1"}}}
"}}}
"{{{ Misc
command! -nargs=0 GundoToggle call gundo#GundoToggle()
command! -nargs=0 GundoShow call gundo#GundoShow()
command! -nargs=0 GundoHide call gundo#GundoHide()
command! -nargs=0 GundoRenderGraph call gundo#GundoRenderGraph()
"}}}

View File

@ -0,0 +1,226 @@
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" Script File: mimicpak.vim
" Last Change: 2009-10-17 [21:23:56]
" Version: 115
" License: Public Domain, Free / Frei / Gratis / Libre.
" Author: Jaime Wottrich, <jaime.wottrich@gmail.com>
" Description: Defines the menu entries for the "MimicPak" colorschemes.
" Creates a submenu "MimicPak" under the "Themes" menu,
" which is also used by the Robert Melton's ColorSamplerPack.
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" Setup {{{1
"~~~~~~~
if exists("g:loaded_mimicpak") || !has("menu") || version < 600
finish
endif
let g:loaded_mimicpak = 115
" need the "<>", so store & reset compatible options
let s:saved_cpo = &cpo
set cpo&vim
" Script Functions {{{1
"~~~~~~~~~~~~~~~~~~
" Function: s:MakeMenu(name, cmd, ...) {{{2
" Creates a menu for all modes and with an optional tooltip.
" Parameters:
" name--the menu name as displayed on screen, can also contain submenus.
" Spaces are escaped.
" cmd--the command that this menu executes. Doesn't need the starting ":"
" and the ending "<CR>".
" a:1--the tooltip for this menu (is only set for X11 & Win32 GUI).
" Example:
" call s:MakeMenu( "Menu.-separator-", "")
" call s:MakeMenu( "Menu.Sub&Menu.What's up doc" ,
" \ "echo 'Whats up doc'",
" \ "Greets you..." )
"
function! s:MakeMenu(name, cmd, ...)
let name = escape(a:name, "\ ")
execute "amenu " . name . " :" . a:cmd . "<CR>"
if 0 < a:0 && (has("x11") || has("gui_win32"))
execute "tmenu " . name . " " . a:1
endif
endfunction "}}}2
"}}}1
" Create the menus {{{1
"~~~~~~~~~~~~~~~~~~
" font style selection menu {{{2
call s:MakeMenu("T&hemes.&MimicPak.Choose &Font style.&None<Tab>(default)",
\ "unlet! g:mimic_font_style",
\ "MimicPak colorschemes won't use bold nor italic fonts." )
call s:MakeMenu("T&hemes.&MimicPak.Choose &Font style.Use &Bolds",
\ "let g:mimic_font_style=1",
\ "MimicPak colorschemes will use bold fonts.")
call s:MakeMenu("T&hemes.&MimicPak.Choose &Font style.Use &Italics",
\ "let g:mimic_font_style=2",
\ "MimicPak colorschemes will use italic fonts.")
call s:MakeMenu("T&hemes.&MimicPak.Choose &Font style.Use Bolds &and Italics",
\ "let g:mimic_font_style=3",
\ "MimicPak colorschemes will use italic and bold fonts.")
" colorize GUI? menu {{{2
if has("gui_running") && !(has("gui_win32") || has("gui_win32s"))
call s:MakeMenu("T&hemes.&MimicPak.&Colorize GUI?.&Yes",
\ "let g:mimic_colorize_gui=1",
\ "MimicPak colorschemes will set colors for Toolbar, Scrollbar, Menu.")
call s:MakeMenu("T&hemes.&MimicPak.&Colorize GUI?.&No<TAB>(default)",
\ "unlet! g:mimic_colorize_gui",
\ "MimicPak colorschemes will NOT set colors for Toolbar, Scrollbar, Menu.")
endif
" black/almost-black schemes {{{2
call s:MakeMenu("T&hemes.&MimicPak.-spMMPblack-", "")
" Astroboy, the clone of astronaut.vim {{{3
" grey20 and black
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.bgcolor == &grey20 [almost black]<TAB>(default)",
\ "unlet! g:mimic_astroboy_dark g:mimic_astroboy_alt<BAR>color astroboy",
\ "astroboy.vim: astronaut.vim clone (see ':h astroboy.vim')")
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.bgcolor == &black",
\ "unlet! g:mimic_astroboy_alt<BAR>let g:mimic_astroboy_dark=1<BAR>color astroboy",
\ "astroboy.vim: astronaut.vim clone (see ':h astroboy.vim')")
" blue and darkblue backgrounds
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.bgcolor == b&lue",
\ "unlet! g:mimic_astroboy_dark<BAR>let g:mimic_astroboy_alt=1<BAR>color astroboy",
\ "astroboy.vim: astronaut.vim clone (see ':h astroboy.vim')")
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.bgcolor == &darkblue",
\ "let g:mimic_astroboy_alt=1<BAR>let g:mimic_astroboy_dark=1<BAR>color astroboy",
\ "astroboy.vim: astronaut.vim clone (see ':h astroboy.vim')")
" help
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.-spMMPAstroboy000-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Astroboy.&Help<tab>:h astroboy",
\ "help astroboy.vim",
\ "Shows the help for the AstroBoy colorscheme.")
" }}}3
" Big Bang, (Feuer Frei! Bang! Bang!) {{{3
" grey20 and black
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.bgcolor == &grey20 [almost black]<TAB>(default)",
\ "unlet! g:mimic_bigbang_dark g:mimic_bigbang_alt<BAR>color bigbang",
\ "bigbang.vim: experimental colorscheme (see ':h bigbang.vim')")
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.bgcolor == &black",
\ "unlet! g:mimic_bigbang_alt<BAR>let g:mimic_bigbang_dark=1<BAR>color bigbang",
\ "bigbang.vim: experimental colorscheme (see ':h bigbang.vim')")
" blue and darkblue backgrounds
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.bgcolor == b&lue",
\ "unlet! g:mimic_bigbang_dark<BAR>let g:mimic_bigbang_alt=1<BAR>color bigbang",
\ "bigbang.vim: experimental colorscheme (see ':h bigbang.vim')")
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.bgcolor == &darkblue",
\ "let g:mimic_bigbang_alt=1<BAR>let g:mimic_bigbang_dark=1<BAR>color bigbang",
\ "bigbang.vim: experimental colorscheme (see ':h bigbang.vim')")
" help
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.-spMMPBigBan000-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Big Bang.&Help<tab>:h bigbang",
\ "help bigbang.vim",
\ "How did everything begin? Shows help for Big Bang colorscheme.")
" }}}3
" Dejavu... could have been called DNB, but it's called Dejavu {{{3
" for dark backgrounds, defaults
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Dark bg (bgcolor == &grey20 [almost black])",
\ "unlet! g:mimic_dejavu_dark g:mimic_dejavu_alt<BAR>set bg=dark<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Dark bg (bgcolor == &black) ",
\ "unlet! g:mimic_dejavu_alt<BAR>let g:mimic_dejavu_dark=1<BAR>set bg=dark<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
" for dark backgrounds, blue background
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Dark bg (bgcolor == b&lue)",
\ "unlet! g:mimic_dejavu_dark<BAR>let g:mimic_dejavu_alt=1<BAR>set bg=dark<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Dark bg (bgcolor == &darkblue) ",
\ "let g:mimic_dejavu_alt=1<BAR>let g:mimic_dejavu_dark=1<BAR>set bg=dark<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
" for light backgrounds
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.-spMMPDejaVu001-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Light bg (bgcolor == &white)",
\ "unlet! g:mimic_dejavu_dark<BAR>set bg=light<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.for Light bg (bgcolor == &lightgray)",
\ "let g:mimic_dejavu_dark=1<BAR>set bg=light<BAR>color dejavu",
\ "dejavu.vim: scheme with nice options (see ':h dejavu.vim' to know them)")
" help
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.-spMMPDejaVu002-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Deja Vu.&Help<tab>:h dejavu",
\ "help dejavu.vim",
\ "Shows the help for the dejavu colorscheme.")
"}}}3
" peaksea (aka "ps_color") clone
call s:MakeMenu("T&hemes.&MimicPak.&PS Clone",
\ "color psclone",
\ "psclone.vim: scheme cloned from peaksea (ps_color) but with smoother colors")
" strange thingy
call s:MakeMenu("T&hemes.&MimicPak.&Zen DNB",
\ "color zendnb",
\ "zendnb.vim: a dark colorscheme for VIM/GVIM (try it with Italic fonts)")
" blue/purple schemes {{{2
call s:MakeMenu("T&hemes.&MimicPak.-spMMPblue-", "")
call s:MakeMenu("T&hemes.&MimicPak.Deep &Blue",
\ "color deepblue",
\ "deepblue.vim: colors for people who love Dark Blue backgrounds.")
call s:MakeMenu("T&hemes.&MimicPak.&MAsmEd's originals.bgcolor == dark &purple<TAB>(default)",
\ "unlet! g:mimic_masmed_alt<BAR>color masmed",
\ "masmed.vim: the original defaults from the cool MAsmEd (IDE for MASM, windoze)")
call s:MakeMenu("T&hemes.&MimicPak.&MAsmEd's originals.bgcolor == &grey20 (almost black)",
\ "let g:mimic_masmed_alt=1<BAR>color masmed",
\ "masmed.vim: MAsmEd's defaults on a Grey20 bg.")
" green/cyan schemes {{{2
call s:MakeMenu("T&hemes.&MimicPak.-spMMPgreen-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Anokha.bgcolor == dark &teal<TAB>(default)",
\ "unlet! g:mimic_anokha_alt<BAR>color anokha",
\ "anokha.vim: colors from the lisp editor J, uses a Dark Teal bg")
call s:MakeMenu("T&hemes.&MimicPak.&Anokha.bgcolor == dark &green",
\ "let g:mimic_anokha_alt=1<BAR>color anokha",
\ "anokha.vim: colors from the lisp editor J, uses a Dark Green bg")
call s:MakeMenu("T&hemes.&MimicPak.Parado&x.bgcolor == dark &teal<TAB>(default)",
\ "unlet! g:mimic_paradox_alt<BAR>color paradox",
\ "paradox.vim: colors from MAsmEd. Looks like old Emacs (try Italics fonts)")
call s:MakeMenu("T&hemes.&MimicPak.Parado&x.bgcolor == &grey20 (almost black)",
\ "let g:mimic_paradox_alt=1<BAR>color paradox",
\ "paradox.vim: colors from MAsmEd on an almost black bg.")
" white/lightgray schemes {{{2
call s:MakeMenu("T&hemes.&MimicPak.-spMMPlight-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Grey House",
\ "color greyhouse",
\ "greyhouse.vim: a scheme from MAsmEd, uses a Gray bg (try it with Bold fonts)")
call s:MakeMenu("T&hemes.&MimicPak.&Gaea",
\ "color gaea",
\ "gaea.vim: natural colors (try it with Bold+Italics)")
call s:MakeMenu("T&hemes.&MimicPak.Imperia&l",
\ "color imperial",
\ "imperial.vim: royal colors for GVIM (try it with Bold+Italics)")
call s:MakeMenu("T&hemes.&MimicPak.&IntelliJ",
\ "color intellij",
\ "intellij.vim: default IntelliJIDEA's colors (try it with Bold+Italics)")
call s:MakeMenu("T&hemes.&MimicPak.Mickey$oft",
\ "color mickeysoft",
\ "mickeysoft.vim: yet another M$ scheme (try it with Bold+Italics fonts)")
call s:MakeMenu("T&hemes.&MimicPak.&Omen",
\ "color omen",
\ "omen.vim: simple red/black scheme (try it with Bold+Italics fonts)")
call s:MakeMenu("T&hemes.&MimicPak.&SCAME (EMACS)",
\ "color scame",
\ "scame.vim: EMACS' default colorscheme")
call s:MakeMenu("T&hemes.&MimicPak.&Vim Hut.for &Dark bg",
\ "set bg=dark<BAR>color vimhut",
\ "vimhut.vim: gVim default colors for dark backgrounds (try it with Italic fonts)")
call s:MakeMenu("T&hemes.&MimicPak.&Vim Hut.for &Light bg",
\ "set bg=light<BAR>color vimhut",
\ "vimhut.vim: gVim default colors, but with more Gray (try it with Bold fonts)")
" help {{{2
call s:MakeMenu("T&hemes.&MimicPak.-spMMPhelp-", "")
call s:MakeMenu("T&hemes.&MimicPak.&Help<tab>:h mimicpak",
\ "help mimicpak",
\ "Shows the MimicPak colorschemes' help.")
"}}}1
" Cleanup {{{1
"~~~~~~~~~
delfunction s:MakeMenu
" restore user settings
let &cpo = s:saved_cpo
unlet s:saved_cpo
" vim:et:sw=2:ts=2:tw=78:nowrap:
" vim600:fdc=2:fdm=marker:

View File

@ -0,0 +1,47 @@
" Vim plugin for putting crosshairs on cursor when on a paren
" Maintainer: Bryan Richter <at the googles>
" Last Change: 2012
" License: WTFPL
if exists("g:loaded_paren_crosshairs") || &cp || !exists("##CursorMoved")
finish
endif
let g:loaded_paren_crosshairs = 1
augroup TargetMatchpairs
au!
au WinEnter,CmdwinEnter,CursorMoved,CursorMovedI * call s:targetMatchpairs()
au WinLeave * call s:suspendTargeting()
augroup END
func! s:targetMatchpairs()
if !exists('w:targetAcquired')
let w:targetAcquired = 0
endif
" Global to buffer:
if !exists('b:matchPairs')
" '[:],{,},(,)' --> '[]{}()'
let b:matchPairs = substitute(&matchpairs, "[,:]", "", "g")
endif
let curChar = getline('.')[col('.') - 1]
let targetInReticule =
\len(curChar) > 0 && stridx(b:matchPairs, curChar) >= 0
if targetInReticule && !w:targetAcquired
let w:disengage = "set " . (&cuc ? "cuc" : "nocuc")
\. ' ' . (&cul ? "cul" : "nocul")
set cuc cul
let w:targetAcquired = 1
elseif !targetInReticule && w:targetAcquired
exec w:disengage
let w:targetAcquired = 0
endif
endfu
func! s:suspendTargeting()
if w:targetAcquired
exec w:disengage
let w:targetAcquired = 0
endif
endfu

View File

@ -0,0 +1,152 @@
" vim: set sw=4 sts=4 et ft=vim :
" Script: securemodelines.vim
" Author: Ciaran McCreesh <ciaran.mccreesh at googlemail.com>
" Homepage: http://github.com/ciaranm/securemodelines
" Requires: Vim 7
" License: Redistribute under the same terms as Vim itself
" Purpose: A secure alternative to modelines
if &compatible || v:version < 700 || exists('g:loaded_securemodelines')
finish
endif
let g:loaded_securemodelines = 1
if (! exists("g:secure_modelines_allowed_items"))
let g:secure_modelines_allowed_items = [
\ "textwidth", "tw",
\ "softtabstop", "sts",
\ "tabstop", "ts",
\ "shiftwidth", "sw",
\ "expandtab", "et", "noexpandtab", "noet",
\ "filetype", "ft",
\ "foldmethod", "fdm",
\ "readonly", "ro", "noreadonly", "noro",
\ "rightleft", "rl", "norightleft", "norl",
\ "cindent", "cin", "nocindent", "nocin",
\ "smartindent", "si", "nosmartindent", "nosi",
\ "autoindent", "ai", "noautoindent", "noai",
\ "spell",
\ "spelllang"
\ ]
endif
if (! exists("g:secure_modelines_verbose"))
let g:secure_modelines_verbose = 0
endif
if (! exists("g:secure_modelines_modelines"))
let g:secure_modelines_modelines=5
endif
if (! exists("g:secure_modelines_leave_modeline"))
if &modeline
set nomodeline
if g:secure_modelines_verbose
echohl WarningMsg
echo "Forcibly disabling internal modelines for securemodelines.vim"
echohl None
endif
endif
endif
fun! <SID>IsInList(list, i) abort
for l:item in a:list
if a:i == l:item
return 1
endif
endfor
return 0
endfun
fun! <SID>DoOne(item) abort
let l:matches = matchlist(a:item, '^\([a-z]\+\)\%([-+^]\?=[a-zA-Z0-9_\-.]\+\)\?$')
if len(l:matches) > 0
if <SID>IsInList(g:secure_modelines_allowed_items, l:matches[1])
exec "setlocal " . a:item
elseif g:secure_modelines_verbose
echohl WarningMsg
echo "Ignoring '" . a:item . "' in modeline"
echohl None
endif
endif
endfun
fun! <SID>DoNoSetModeline(line) abort
for l:item in split(a:line, '[ \t:]')
call <SID>DoOne(l:item)
endfor
endfun
fun! <SID>DoSetModeline(line) abort
for l:item in split(a:line)
call <SID>DoOne(l:item)
endfor
endfun
fun! <SID>CheckVersion(op, ver) abort
if a:op == "="
return v:version != a:ver
elseif a:op == "<"
return v:version < a:ver
elseif a:op == ">"
return v:version >= a:ver
else
return 0
endif
endfun
fun! <SID>DoModeline(line) abort
let l:matches = matchlist(a:line, '\%(\S\@<!\%(vi\|vim\([<>=]\?\)\([0-9]\+\)\?\)\|\sex\):\s*\%(set\s\+\)\?\([^:]\+\):\S\@!')
if len(l:matches) > 0
let l:operator = ">"
if len(l:matches[1]) > 0
let l:operator = l:matches[1]
endif
if len(l:matches[2]) > 0
if <SID>CheckVersion(l:operator, l:matches[2]) ? 0 : 1
return
endif
endif
return <SID>DoSetModeline(l:matches[3])
endif
let l:matches = matchlist(a:line, '\%(\S\@<!\%(vi\|vim\([<>=]\?\)\([0-9]\+\)\?\)\|\sex\):\(.\+\)')
if len(l:matches) > 0
let l:operator = ">"
if len(l:matches[1]) > 0
let l:operator = l:matches[1]
endif
if len(l:matches[2]) > 0
if <SID>CheckVersion(l:operator, l:matches[2]) ? 0 : 1
return
endif
endif
return <SID>DoNoSetModeline(l:matches[3])
endif
endfun
fun! <SID>DoModelines() abort
if line("$") > g:secure_modelines_modelines
let l:lines={ }
call map(filter(getline(1, g:secure_modelines_modelines) +
\ getline(line("$") - g:secure_modelines_modelines, "$"),
\ 'v:val =~ ":"'), 'extend(l:lines, { v:val : 0 } )')
for l:line in keys(l:lines)
call <SID>DoModeline(l:line)
endfor
else
for l:line in getline(1, "$")
call <SID>DoModeline(l:line)
endfor
endif
endfun
fun! SecureModelines_DoModelines() abort
call <SID>DoModelines()
endfun
aug SecureModeLines
au!
au BufRead,StdinReadPost * :call <SID>DoModelines()
aug END

1
bundle/xmledit Submodule

@ -0,0 +1 @@
Subproject commit 1335d79a5501b92f43e2540f555045809b409ca5

57
colors/Mustang.vim Executable file
View File

@ -0,0 +1,57 @@
" Maintainer: Henrique C. Alves (hcarvalhoalves@gmail.com)
" Version: 1.0
" Last Change: September 25 2008
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "mustang"
" Vim >= 7.0 specific colors
if version >= 700
hi CursorLine guibg=#2d2d2d ctermbg=236
hi CursorColumn guibg=#2d2d2d ctermbg=236
hi MatchParen guifg=#d0ffc0 guibg=#2f2f2f gui=bold ctermfg=157 ctermbg=237 cterm=bold
hi Pmenu guifg=#ffffff guibg=#444444 ctermfg=255 ctermbg=238
hi PmenuSel guifg=#000000 guibg=#b1d631 ctermfg=0 ctermbg=148
endif
" General colors
hi Cursor guifg=NONE guibg=#626262 gui=none ctermbg=241
hi Normal guifg=#e2e2e5 guibg=#202020 gui=none ctermfg=253 ctermbg=234
hi NonText guifg=#808080 guibg=#303030 gui=none ctermfg=244 ctermbg=235
hi LineNr guifg=#808080 guibg=#000000 gui=none ctermfg=244 ctermbg=232
hi StatusLine guifg=#d3d3d5 guibg=#444444 gui=italic ctermfg=253 ctermbg=238 cterm=italic
hi StatusLineNC guifg=#939395 guibg=#444444 gui=none ctermfg=246 ctermbg=238
hi VertSplit guifg=#444444 guibg=#444444 gui=none ctermfg=238 ctermbg=238
hi Folded guibg=#384048 guifg=#a0a8b0 gui=none ctermbg=4 ctermfg=248
hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=254 cterm=bold
hi Visual guifg=#faf4c6 guibg=#3c414c gui=none ctermfg=254 ctermbg=4
hi SpecialKey guifg=#808080 guibg=#343434 gui=none ctermfg=244 ctermbg=236
" Syntax highlighting
hi Comment guifg=#808080 gui=italic ctermfg=244
hi Todo guifg=#8f8f8f gui=italic ctermfg=245
hi Boolean guifg=#b1d631 gui=none ctermfg=148
hi String guifg=#b1d631 gui=italic ctermfg=148
hi Identifier guifg=#b1d631 gui=none ctermfg=148
hi Function guifg=#ffffff gui=bold ctermfg=255
hi Type guifg=#7e8aa2 gui=none ctermfg=103
hi Statement guifg=#7e8aa2 gui=none ctermfg=103
hi Keyword guifg=#ff9800 gui=none ctermfg=208
hi Constant guifg=#ff9800 gui=none ctermfg=208
hi Number guifg=#ff9800 gui=none ctermfg=208
hi Special guifg=#ff9800 gui=none ctermfg=208
hi PreProc guifg=#faf4c6 gui=none ctermfg=230
hi Todo guifg=#000000 guibg=#e6ea50 gui=italic
" Code-specific colors
hi pythonOperator guifg=#7e8aa2 gui=none ctermfg=103
hi Search guifg=white guibg=NONE cterm=NONE gui=underline

72
colors/adaryn.vim Executable file
View File

@ -0,0 +1,72 @@
" Vim color file
" Maintainer: Glenn T. Norton <gtnorton@adaryn.com>
" Last Change: 2003-04-11
" adaryn - A color scheme named after my daughter, Adaryn. (A-da-rin)
" I like deep, sharp colors and this scheme is inspired by
" Bohdan Vlasyuk's darkblue.
" The cterm background is black since the dark blue was just too light.
" Also the cterm colors are very close to an old Borland C++ color setup.
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "adaryn"
hi Normal guifg=#fffff0 guibg=#00003F ctermfg=white ctermbg=Black
hi ErrorMsg guifg=#ffffff guibg=#287eff ctermfg=white ctermbg=red
hi Visual guifg=#8080ff guibg=fg gui=reverse ctermfg=blue ctermbg=fg cterm=reverse
hi VisualNOS guifg=#8080ff guibg=fg gui=reverse,underline ctermfg=lightblue ctermbg=fg cterm=reverse,underline
hi Todo guifg=#d14a14 guibg=#1248d1 ctermfg=red ctermbg=darkblue
hi Search guifg=#90fff0 guibg=#2050d0 ctermfg=white ctermbg=darkblue cterm=underline term=underline
hi IncSearch guifg=#b0ffff guibg=#2050d0 ctermfg=darkblue ctermbg=gray
hi SpecialKey guifg=cyan ctermfg=darkcyan
hi Directory guifg=cyan ctermfg=cyan
hi Title guifg=#BDD094 gui=none ctermfg=magenta cterm=bold
hi WarningMsg guifg=red ctermfg=red
hi WildMenu guifg=yellow guibg=black ctermfg=yellow ctermbg=black cterm=none term=none
hi ModeMsg guifg=#22cce2 ctermfg=lightblue
hi MoreMsg ctermfg=darkgreen ctermfg=darkgreen
hi Question guifg=green gui=none ctermfg=green cterm=none
hi NonText guifg=#0030ff ctermfg=darkblue
hi StatusLine guifg=blue guibg=darkgray gui=none ctermfg=blue ctermbg=gray term=none cterm=none
hi StatusLineNC guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
hi VertSplit guifg=black guibg=darkgray gui=none ctermfg=black ctermbg=gray term=none cterm=none
hi Folded guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
hi FoldColumn guifg=#808080 guibg=#000040 ctermfg=darkgrey ctermbg=black cterm=bold term=bold
hi LineNr guifg=#90f020 ctermfg=green cterm=none
hi DiffAdd guibg=darkblue ctermbg=darkblue term=none cterm=none
hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none
hi DiffDelete ctermfg=blue ctermbg=cyan gui=bold guifg=Blue guibg=DarkCyan
hi DiffText cterm=bold ctermbg=red gui=bold guibg=Red
hi Cursor guifg=#000020 guibg=#ffaf38 ctermfg=bg ctermbg=brown
hi lCursor guifg=#ffffff guibg=#000000 ctermfg=bg ctermbg=darkgreen
hi Comment guifg=yellow ctermfg=Yellow
hi Constant ctermfg=green guifg=green cterm=none
hi Special ctermfg=White guifg=#FFFFFF cterm=none gui=none
hi Identifier ctermfg=DarkRed guifg=#BDD094 cterm=none
hi Statement ctermfg=LightCyan cterm=none guifg=#A9A900 gui=none
hi PreProc ctermfg=DarkRed guifg=#ffffff gui=none cterm=none
hi type ctermfg=LightCyan guifg=LightBlue gui=none cterm=none
hi Underlined cterm=underline term=underline
hi Ignore guifg=bg ctermfg=bg

97
colors/adrian.vim Executable file
View File

@ -0,0 +1,97 @@
" Vim colorscheme file
" Maintainer: Adrian Nagle <vim@naglenet.org>
" Last Change: 2001-09-25 07:48:15 Mountain Daylight Time
" URL: http://www.naglenet.org/vim/syntax/adrian.vim
" MAIN URL: http://www.naglenet.org/vim
" This is my custom syntax file to override the defaults provided with Vim.
" This file should be located in $HOME/vimfiles/colors.
" This file should automatically be sourced by $RUNTIMEPATH.
" NOTE(S):
" *(1)
" The color definitions assumes and is intended for a black or dark
" background.
" *(2)
" This file is specifically in Unix style EOL format so that I can simply
" copy this file between Windows and Unix systems. VIM can source files in
" with the UNIX EOL format (only <NL> instead of <CR><NR> for DOS) in any
" operating system if the 'fileformats' is not empty and there is no <CR>
" just before the <NL> on the first line. See ':help :source_crnl' and
" ':help fileformats'.
"
" *(3)
" Move this file to adrian.vim for vim6.0aw.
"
hi clear
set background=dark
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "adrian"
" Normal is for the normal (unhighlighted) text and background.
" NonText is below the last line (~ lines).
highlight Normal guibg=Black guifg=Green
highlight Cursor guibg=Grey70 guifg=White
highlight NonText guibg=Grey80
highlight StatusLine gui=bold guibg=DarkGrey guifg=Orange
highlight StatusLineNC guibg=DarkGrey guifg=Orange
highlight Comment term=bold ctermfg=LightGrey guifg=#d1ddff
highlight Constant term=underline ctermfg=White guifg=#ffa0a0
"highlight Number term=underline ctermfg=Yellow guifg=Yellow
highlight Identifier term=underline ctermfg=Cyan guifg=#40ffff
highlight Statement term=bold ctermfg=Yellow gui=bold guifg=#ffff60
highlight PreProc term=underline ctermfg=Blue guifg=#ff4500
highlight Type term=underline ctermfg=DarkGrey gui=bold guifg=#7d96ff
highlight Special term=bold ctermfg=Magenta guifg=Orange
highlight Ignore ctermfg=black guifg=bg
highlight Error ctermfg=White ctermbg=Red guifg=White guibg=Red
highlight Todo ctermfg=Blue ctermbg=Yellow guifg=Blue guibg=Yellow
" Change the highlight of search matches (for use with :set hls).
highlight Search ctermfg=Black ctermbg=Yellow guifg=Black guibg=Yellow
" Change the highlight of visual highlight.
highlight Visual cterm=NONE ctermfg=Black ctermbg=LightGrey gui=NONE guifg=Black guibg=Grey70
highlight Float ctermfg=Blue guifg=#88AAEE
highlight Exception ctermfg=Red ctermbg=White guifg=Red guibg=White
highlight Typedef ctermfg=White ctermbg=Blue gui=bold guifg=White guibg=Blue
highlight SpecialChar ctermfg=Black ctermbg=White guifg=Black guibg=White
highlight Delimiter ctermfg=White ctermbg=Black guifg=White guibg=Black
highlight SpecialComment ctermfg=Black ctermbg=Green guifg=Black guibg=Green
" Common groups that link to default highlighting.
" You can specify other highlighting easily.
highlight link String Constant
highlight link Character Constant
highlight link Number Constant
highlight link Boolean Statement
"highlight link Float Number
highlight link Function Identifier
highlight link Conditional Type
highlight link Repeat Type
highlight link Label Type
highlight link Operator Type
highlight link Keyword Type
"highlight link Exception Type
highlight link Include PreProc
highlight link Define PreProc
highlight link Macro PreProc
highlight link PreCondit PreProc
highlight link StorageClass Type
highlight link Structure Type
"highlight link Typedef Type
"highlight link SpecialChar Special
highlight link Tag Special
"highlight link Delimiter Special
"highlight link SpecialComment Special
highlight link Debug Special

37
colors/aiseered.vim Executable file
View File

@ -0,0 +1,37 @@
" gVim color file for working with files in GDL/VCG format.
" Works nice in conjunction with gdl.vim
" (see www.vim.org or www.aisee.com)
" Works fine for C/C++, too.
" Author : Alexander A. Evstyugov-Babaev <alex@absint.com>
" Version: 0.2 for gVim/Linux,
" tested with gVim 6.3.25 under Ubuntu Linux (Warty)
" by Jo Vermeulen <jo@lumumba.luc.ac.be>
" Date : January 25th 2005
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name="aiseered"
hi Normal guifg=lightred guibg=#600000
hi Cursor guifg=bg guibg=fg
hi ErrorMsg guibg=red ctermfg=1
hi Search term=reverse ctermfg=darkred ctermbg=lightred guibg=lightred guifg=#060000
hi Comment guifg=#ffffff
hi Constant guifg=#88ddee
hi String guifg=#ffcc88
hi Character guifg=#ffaa00
hi Number guifg=#88ddee
hi Identifier guifg=#cfcfcf
hi Statement guifg=#eeff99 gui=bold
hi PreProc guifg=firebrick1 gui=italic
hi Type guifg=#88ffaa gui=none
hi Special guifg=#ffaa00
hi SpecialChar guifg=#ffaa00
hi StorageClass guifg=#ddaacc
hi Error guifg=red guibg=white

283
colors/anokha.vim Executable file
View File

@ -0,0 +1,283 @@
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" ColorScheme: anokha.vim
" Last Change: 2009-10-17 [16:36:52]
" Version: 110
" License: Public Domain, Free / Frei / Gratis / Libre.
" Author: Jaime Wottrich, <jaime.wottrich@gmail.com>
" Online Help: :h anokha.vim
" :h anokha-options
" :h mimicpak
" :h mimicpak-options
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" Setup {{{1
"~~~~~~~
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "anokha"
" Function: s:GetValue(var, ...) {{{2
" Looks up the value of a variable in this order (by default):
" buffer, window, tabpage and global.
" The one that exists first is returned, or 0 if none of them exists.
" Optional Args:
" a:1 value to return if variable doesn't exist.
" a:2 string with comma separated variable prefixes. Examples:
" "b:,t:,g:" - search for buffer, tabpage and global variables
" "w:,t:" - search for window and tabpage variables
" "g:" - search for global variables only
function s:GetValue(var, ...)
let l:defvalue = 0 < a:0 ? a:1 : 0
let l:prefixes = 1 < a:0 ? a:2 . "" : "b:,w:,t:,g:"
let l:start = 0
let l:i = stridx(l:prefixes, ",")
while 1
" track down the comma position, and handle special cases:
" - only one prefix without commas, and
" - after the last encountered comma.
let l:end = l:i < 0 ? strlen(l:prefixes) : l:i
let l:prefix = strpart(l:prefixes, l:start, l:end - l:start)
if exists(prefix . a:var)
return {prefix . a:var}
endif
" after last comma (or one prefix only without commas),
" and variable not found
if l:i < 0
return l:defvalue
endif
" update needle and get next comma position
let l:start = l:i + 1
let l:i = stridx(l:prefixes, ",", l:start)
endwhile
endfunction "}}}2
" get the values (if any) for the options
let s:mimic_font_style = s:GetValue("mimic_font_style")
let s:mimic_colorize_gui = s:GetValue("mimic_colorize_gui")
let s:mimic_anokha_alt = s:GetValue("mimic_anokha_alt")
" cleanup
delfunction s:GetValue
" Default Highlight {{{1
"~~~~~~~~~~~~~~~~~~~
if !s:mimic_anokha_alt
hi Normal guifg=#ffffff guibg=#003333 gui=NONE
else
hi Normal guifg=#ffffff guibg=#003300 gui=NONE
endif
hi Cursor guifg=bg guibg=#ccffcc gui=NONE
hi CursorIM guifg=bg guibg=#ffffcc gui=NONE
hi MatchParen guifg=bg guibg=#66ffff gui=NONE
" search
hi Search guifg=bg guibg=#00ff00 gui=NONE
hi IncSearch guifg=bg guibg=#ffff00 gui=NONE
" visual mode
if version < 700
hi Visual guifg=fg guibg=#006600 gui=NONE
hi VisualNOS guifg=fg guibg=#006666 gui=NONE
else
hi Visual guibg=#006600 gui=NONE
hi VisualNOS guibg=#006666 gui=NONE
endif
if !s:mimic_anokha_alt
" line numbers and folding
hi LineNr guifg=#336666 guibg=bg gui=NONE
hi NonText guifg=#336666 guibg=bg gui=NONE
hi Folded guifg=#229966 guibg=#002222 gui=NONE
hi FoldColumn guifg=#229966 guibg=#002222 gui=NONE
hi SignColumn guifg=#33cc99 guibg=#114444 gui=NONE
" windows, statusline
hi StatusLine guifg=#002222 guibg=#00cc99 gui=NONE
hi StatusLineNC guifg=#00ffcc guibg=#002222 gui=NONE
hi VertSplit guifg=#00ffcc guibg=#002222 gui=NONE
hi WildMenu guifg=#00ffcc guibg=#002222 gui=underline
else
" line numbers and folding
hi LineNr guifg=#336633 guibg=bg gui=NONE
hi NonText guifg=#336633 guibg=bg gui=NONE
hi Folded guifg=#66ff66 guibg=#006600 gui=NONE
hi FoldColumn guifg=#33cc33 guibg=#002200 gui=NONE
hi SignColumn guifg=#66cccc guibg=#002200 gui=NONE
" windows, statusline
hi StatusLine guifg=#002200 guibg=#55cc55 gui=NONE
hi StatusLineNC guifg=#66ff66 guibg=#002200 gui=NONE
hi VertSplit guifg=#66ff66 guibg=#002200 gui=NONE
hi WildMenu guifg=#66ff66 guibg=#002200 gui=underline
endif
" colors for GUI
if 0 < s:mimic_colorize_gui
" will be set for everyone but Windows.
" Athena, Motif, Mac, Photon or GTK GUI.
if has("gui_running") && !(has("gui_win32") || has("gui_win32s"))
if !s:mimic_anokha_alt
hi Menu guifg=#00ffcc guibg=#002222
hi Scrollbar guifg=#00ffcc guibg=#002222
hi Tooltip guifg=#002222 guibg=#00cc99
else
hi Menu guifg=#66ff66 guibg=#002200
hi Scrollbar guifg=#66ff66 guibg=#002200
hi Tooltip guifg=#002200 guibg=#33cc33
endif
endif
endif
" vim >= 7.0 only
if version >= 700
if !s:mimic_anokha_alt
hi CursorLine guibg=#225555 gui=NONE
hi CursorColumn guibg=#225555 gui=NONE
" tab pages
hi TabLine guifg=#00ddad guibg=#002222 gui=underline
hi TabLineFill guifg=#00ddad guibg=#002222 gui=underline
hi TabLineSel guifg=#002222 guibg=#00ddad gui=NONE
" popup completion menu
hi Pmenu guifg=#002222 guibg=#66cccc gui=NONE
hi PmenuSel guifg=#33ffcc guibg=#003333 gui=NONE
hi PmenuSbar guifg=#336666 guibg=#336666 gui=NONE
hi PmenuThumb guifg=#447777 guibg=#447777 gui=NONE
else
hi CursorLine guibg=#225522 gui=NONE
hi CursorColumn guibg=#225522 gui=NONE
" tab pages
hi TabLine guifg=#44cc44 guibg=#002200 gui=underline
hi TabLineFill guifg=#44cc44 guibg=#002200 gui=underline
hi TabLineSel guifg=#002200 guibg=#55cc55 gui=NONE
" popup completion menu
hi Pmenu guifg=#002200 guibg=#55cc55 gui=NONE
hi PmenuSel guifg=#66ff66 guibg=#002200 gui=NONE
hi PmenuSbar guifg=#225522 guibg=#225522 gui=NONE
hi PmenuThumb guifg=#447744 guibg=#447744 gui=NONE
endif
" spell checking
hi SpellBad guisp=#ff0000 guibg=#441111 gui=undercurl
hi SpellCap guisp=#0000ff guibg=#111144 gui=undercurl
hi SpellLocal guisp=#00ffff guibg=#114444 gui=undercurl
hi SpellRare guisp=#ff00ff guibg=#441144 gui=undercurl
endif
" other texts
hi Question guifg=#99cc99 guibg=bg gui=NONE
hi WarningMsg guifg=#ff6666 guibg=bg gui=NONE
hi ErrorMsg guifg=#ffffff guibg=#cc0000 gui=NONE
hi Title guifg=#99ff00 guibg=bg gui=NONE
hi Directory guifg=#ff9900 guibg=bg gui=NONE
hi MoreMsg guifg=#66cc66 guibg=bg gui=NONE
hi ModeMsg guifg=#99cc99 guibg=bg gui=NONE
hi SpecialKey guifg=#00ff99 guibg=bg gui=NONE
" diff
hi DiffAdd guifg=#000000 guibg=#33ff33 gui=NONE
hi DiffChange guifg=#000000 guibg=#33cccc gui=NONE
if !s:mimic_anokha_alt
hi DiffDelete guifg=#006666 guibg=bg gui=NONE
else
hi DiffDelete guifg=#006600 guibg=bg gui=NONE
endif
hi DiffText guifg=#000000 guibg=#66ffff gui=NONE
" Default Syntax Highlight {{{1
"~~~~~~~~~~~~~~~~~~~~~~~~~~
if !s:mimic_anokha_alt
hi Comment guifg=#669999 guibg=bg gui=NONE
hi Todo guifg=bg guibg=#00ff99 gui=NONE
hi Ignore guifg=#004444 guibg=bg gui=NONE
else
hi Comment guifg=#55b055 guibg=bg gui=NONE
hi Todo guifg=bg guibg=#66ff66 gui=NONE
hi Ignore guifg=#004400 guibg=bg gui=NONE
endif
hi SpecialComment guifg=#999966 guibg=bg gui=NONE
hi Constant guifg=#ffcc00 guibg=bg gui=NONE
hi Character guifg=#66cc99 guibg=bg gui=NONE
hi String guifg=#99cc99 guibg=bg gui=NONE
hi link Number Constant
hi link Boolean Constant
hi link Float Constant
hi Identifier guifg=#ffcc00 guibg=bg gui=NONE
hi Function guifg=#ffcc00 guibg=bg gui=NONE
hi Statement guifg=#ff9900 guibg=bg gui=NONE
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
hi PreProc guifg=#66ff66 guibg=bg gui=NONE
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi Type guifg=#00ccff guibg=bg gui=NONE
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi Special guifg=#efef00 guibg=bg gui=NONE
hi link SpecialChar Special
hi link Delimiter Special
hi Tag guifg=#ffcc00 guibg=bg gui=NONE
hi Debug guifg=#cccccc guibg=bg gui=NONE
hi Underlined guifg=#dddd00 guibg=bg gui=underline
hi Error guifg=#ffffff guibg=#cc0000 gui=underline
" Font Style {{{1
"~~~~~~~~~~~~
if 0 < s:mimic_font_style
" Function: s:MultiHi {{{2
" Sets highlight option(s) for all its arguments.
" Parameters:
" option -- a string in the form of "key=value", like "gui=NONE". Can also
" be repeated: "key1=value1 key2=value2 ... keyN=valueN".
" ... -- the highlight group names.
function s:MultiHi(option, ...)
let l:i = 1
while l:i <= a:0
silent execute "hi " . a:{l:i} . " " . a:option
let l:i = l:i + 1
endwhile
endfunction "}}}2
" set the bold only options, including the "bold & italics" groups.
if 1 == s:mimic_font_style || 3 <= s:mimic_font_style
call s:MultiHi("gui=bold", "WildMenu", "TabLineSel", "StatusLine", "MoreMsg", "ModeMsg", "Title", "Constant", "Statement", "PreProc", "Type", "Identifier", "Special", "SpecialChar", "Todo")
endif
" set the italic only options
if 2 == s:mimic_font_style || 3 <= s:mimic_font_style
call s:MultiHi("gui=italic", "StatusLineNC", "Comment", "SpecialComment", "Question")
endif
" set the bold & italic options
if 3 <= s:mimic_font_style
call s:MultiHi("gui=bold,italic", "MoreMsg", "Title", "Identifier", "Todo")
endif
" Cleanup
delfunction s:MultiHi
endif
" Cleanup {{{1
"~~~~~~~~~
unlet s:mimic_font_style s:mimic_colorize_gui s:mimic_anokha_alt
" vim:noet:sw=22:ts=22:tw=0:nowrap:
" vim600:fdc=2:fdm=marker:

108
colors/anotherdark.vim Executable file
View File

@ -0,0 +1,108 @@
" Vim color file
" Maintainer: Hans Fugal <hans@fugal.net>
" Last Change: $Date: 2003/05/06 16:37:49 $
" Last Change: $Date: 2003/06/02 19:40:21 $
" URL: http://hans.fugal.net/vim/colors/desert.vim
" Version: $Id: desert.vim,v 1.6 2003/06/02 19:40:21 fugalh Exp $
" cool help screens
" :he group-name
" :he highlight-groups
" :he cterm-colors
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name="anotherdark"
hi Normal guifg=White guibg=grey20
" highlight groups
hi Cursor guibg=khaki guifg=slategrey
"hi CursorIM
"hi Directory
"hi DiffAdd
"hi DiffChange
"hi DiffDelete
"hi DiffText
"hi ErrorMsg
hi VertSplit guibg=#c2bfa5 guifg=grey50 gui=none
hi Folded guibg=grey30 guifg=gold
hi FoldColumn guibg=grey30 guifg=tan
hi IncSearch guifg=slategrey guibg=khaki
"hi LineNr
hi ModeMsg guifg=goldenrod
hi MoreMsg guifg=SeaGreen
hi NonText guifg=LightBlue guibg=grey30
hi Question guifg=springgreen
hi Search guibg=peru guifg=wheat
hi SpecialKey guifg=yellowgreen
hi StatusLine guibg=#c2bfa5 guifg=black gui=none
hi StatusLineNC guibg=#c2bfa5 guifg=grey50 gui=none
hi Title guifg=indianred
hi Visual gui=none guifg=khaki guibg=olivedrab
"hi VisualNOS
hi WarningMsg guifg=salmon
"hi WildMenu
"hi Menu
"hi Scrollbar
"hi Tooltip
" syntax highlighting groups
hi Comment guifg=orange
hi Constant guifg=#ffa0a0
hi Identifier guifg=palegreen
hi Statement guifg=khaki
hi PreProc guifg=indianred
hi Type guifg=darkkhaki
hi Special guifg=navajowhite
"hi Underlined
hi Ignore guifg=grey40
"hi Error
hi Todo guifg=orangered guibg=yellow2
" color terminal definitions
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkblue
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
hi Search cterm=NONE ctermfg=grey ctermbg=blue
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=3
hi Question ctermfg=green
hi StatusLine cterm=bold,reverse
hi StatusLineNC cterm=reverse
hi VertSplit cterm=reverse
hi Title ctermfg=5
hi Visual cterm=reverse
hi VisualNOS cterm=bold,underline
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=darkgrey ctermbg=NONE
hi FoldColumn ctermfg=darkgrey ctermbg=NONE
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=lightblue
hi Constant ctermfg=darkred
hi Special ctermfg=red
hi Identifier ctermfg=6
hi Statement ctermfg=3
hi PreProc ctermfg=5
hi Type ctermfg=2
hi Underlined cterm=underline ctermfg=5
hi Ignore cterm=bold ctermfg=7
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1
"vim: sw=4

44
colors/aqua.vim Executable file
View File

@ -0,0 +1,44 @@
" Vim color file
" Maintainer: tranquility@portugalmail.pt
" Last Change: 6 Apr 2002
" cool help screens
" :he group-name
" :he highlight-groups
" :he cterm-colors
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name="aqua"
hi Normal guibg=steelblue guifg=linen
hi Cursor guibg=lightblue3 guifg=black gui=bold
hi VertSplit guifg=white guibg=navyblue gui=none
hi Folded guibg=darkblue guifg=white
hi FoldColumn guibg=lightgray guifg=navyblue
hi ModeMsg guifg=black guibg=steelblue1
hi MoreMsg guifg=black guibg=steelblue1
hi NonText guifg=white guibg=steelblue4 gui=none
hi Question guifg=snow
hi Search guibg=#FFFFFF guifg=midnightblue gui=bold
hi SpecialKey guifg=navyblue
hi StatusLine guibg=skyblue3 guifg=black gui=none
hi StatusLineNC guibg=skyblue1 guifg=black gui=none
hi Title guifg=bisque3
hi Subtitle guifg=black
hi Visual guifg=white guibg=royalblue4 gui=none
hi WarningMsg guifg=salmon4 guibg=gray60 gui=bold
hi Comment guifg=lightskyblue
hi Constant guifg=turquoise gui=bold
hi Identifier guifg=lightcyan
hi Statement guifg=royalblue4
hi PreProc guifg=black gui=bold
hi Type guifg=lightgreen
hi Special guifg=navajowhite
hi Ignore guifg=grey29
hi Todo guibg=black guifg=white
hi WildMenu guibg=aquamarine

326
colors/astroboy.vim Executable file
View File

@ -0,0 +1,326 @@
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" ColorScheme: astroboy.vim
" Last Change: 2009-10-17 [21:17:50]
" Version: 110
" License: Public Domain, Free / Frei / Gratis / Libre.
" Author: Jaime Wottrich, <jaime.wottrich@gmail.com>
" Help: :h astroboy.vim
" :h astroboy-options
" :h astroboy-variants
" :h mimicpak
" :h mimicpak-options
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" Setup {{{1
"~~~~~~~
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "astroboy"
" Function: s:GetValue(var, ...) {{{2
" Looks up the value of a variable in this order (by default):
" buffer, window, tabpage and global.
" The one that exists first is returned, or 0 if none of them exists.
" Optional Args:
" a:1 value to return if variable doesn't exist.
" a:2 string with comma separated variable prefixes. Examples:
" "b:,t:,g:" - search for buffer, tabpage and global variables
" "w:,t:" - search for window and tabpage variables
" "g:" - search for global variables only
function s:GetValue(var, ...)
let l:defvalue = 0 < a:0 ? a:1 : 0
let l:prefixes = 1 < a:0 ? a:2 . "" : "b:,w:,t:,g:"
let l:start = 0
let l:i = stridx(l:prefixes, ",")
while 1
" track down the comma position, and handle special cases:
" - only one prefix without commas, and
" - after the last encountered comma.
let l:end = l:i < 0 ? strlen(l:prefixes) : l:i
let l:prefix = strpart(l:prefixes, l:start, l:end - l:start)
if exists(prefix . a:var)
return {prefix . a:var}
endif
" after last comma (or one prefix only without commas),
" and variable not found
if l:i < 0
return l:defvalue
endif
" update needle and get next comma position
let l:start = l:i + 1
let l:i = stridx(l:prefixes, ",", l:start)
endwhile
endfunction "}}}2
" get the values (if any) for the options
let s:mimic_font_style = s:GetValue("mimic_font_style")
let s:mimic_colorize_gui = s:GetValue("mimic_colorize_gui")
let s:mimic_astroboy_alt = s:GetValue("mimic_astroboy_alt")
let s:mimic_astroboy_dark = s:GetValue("mimic_astroboy_dark")
" cleanup
delfunction s:GetValue
" Default Highlight {{{1
if !s:mimic_astroboy_dark
if !s:mimic_astroboy_alt
hi Normal guifg=#88f888 guibg=#333333 gui=NONE
else
hi Normal guifg=#88f888 guibg=#000078 gui=NONE
endif
else "darker colors, black and darkblue
if !s:mimic_astroboy_alt
hi Normal guifg=#88f888 guibg=#000000 gui=NONE
else
hi Normal guifg=#88f888 guibg=#000040 gui=NONE
endif
endif
hi Cursor guifg=bg guibg=#66ff66 gui=NONE
hi CursorIM guifg=bg guibg=#66ccff gui=NONE
hi MatchParen guifg=bg guibg=#66ffff gui=NONE
" search
hi Search guifg=#f9f999 guibg=#3333f9 gui=NONE
hi IncSearch guifg=#000000 guibg=fg gui=NONE
" visual mode
if version < 700
hi LineNr guifg=#f8f888 guibg=bg gui=NONE
hi Visual guifg=fg guibg=#007000 gui=NONE
hi VisualNOS guifg=fg guibg=#000070 gui=NONE
" diff
hi DiffAdd guifg=#000000 guibg=#68f868 gui=NONE
hi DiffChange guifg=#000000 guibg=#68ccf8 gui=NONE
hi DiffDelete guifg=#000000 guibg=#f8f868 gui=NONE
hi DiffText guifg=#000000 guibg=#68f8f8 gui=NONE
else
hi LineNr guifg=#f8f888 gui=NONE
hi Visual guibg=#007000 gui=NONE
hi VisualNOS guibg=#000070 gui=NONE
" diff
hi DiffAdd guibg=#004800 gui=NONE
hi DiffChange guibg=#0000a8 gui=NONE
hi DiffDelete guifg=bg guibg=#989800 gui=NONE
hi DiffText guibg=#006888 gui=NONE
endif
" line numbers and folding
hi NonText guifg=#666666 guibg=bg gui=NONE
if !s:mimic_astroboy_dark
" color for grey20 and blue {{{2
if !s:mimic_astroboy_alt
hi Folded guifg=#f888f8 guibg=#131313 gui=NONE
hi FoldColumn guifg=#38f8f8 guibg=#131313 gui=NONE
hi SignColumn guifg=#88f888 guibg=#131313 gui=NONE
" other text
hi SpecialKey guifg=#f888f8 guibg=#131313 gui=NONE
hi ModeMsg guifg=#88f8c8 guibg=#131313 gui=NONE
else
hi Folded guifg=#f888f8 guibg=#000040 gui=NONE
hi FoldColumn guifg=#38f8f8 guibg=#000040 gui=NONE
hi SignColumn guifg=#88f888 guibg=#000040 gui=NONE
" other text
hi SpecialKey guifg=#f888f8 guibg=#000040 gui=NONE
hi ModeMsg guifg=#88f8c8 guibg=#000040 gui=NONE
endif "}}}2
else
" colors for black and darkblue {{{2
if !s:mimic_astroboy_alt
hi Folded guifg=#f888f8 guibg=#232323 gui=NONE
hi FoldColumn guifg=#38f8f8 guibg=#232323 gui=NONE
hi SignColumn guifg=#88f888 guibg=#232323 gui=NONE
" other text
hi SpecialKey guifg=#f888f8 guibg=#232323 gui=NONE
hi ModeMsg guifg=#88f8c8 guibg=#232323 gui=NONE
else
hi Folded guifg=#f888f8 guibg=#000078 gui=NONE
hi FoldColumn guifg=#38f8f8 guibg=#000078 gui=NONE
hi SignColumn guifg=#88f888 guibg=#000078 gui=NONE
" other text
hi SpecialKey guifg=#f888f8 guibg=#000078 gui=NONE
hi ModeMsg guifg=#88f8c8 guibg=#000078 gui=NONE
endif "}}}2
endif
" windows, statusline
hi StatusLine guifg=#000000 guibg=#68f8f8 gui=NONE
hi StatusLineNC guifg=#000000 guibg=#68f868 gui=NONE
hi VertSplit guifg=#000000 guibg=#68f868 gui=NONE
hi WildMenu guifg=#78f8c8 guibg=bg gui=underline
" colors for GUI
if 0 < s:mimic_colorize_gui
" will be set for everyone but Windows.
" Athena, Motif, Mac, Photon or GTK GUI.
if has("gui_running") && !(has("gui_win32") || has("gui_win32s"))
hi Menu guifg=fg guibg=bg
hi Scrollbar guifg=bg guibg=#68f8f8
hi Tooltip guifg=bg guibg=fg
endif
endif
" vim >= 7.0 only
if version >= 700
" tab pages
hi TabLine guifg=#000000 guibg=#68f8f8 gui=NONE
hi TabLineFill guifg=#000000 guibg=#68f8f8 gui=NONE
hi TabLineSel guifg=#78f8c8 guibg=bg gui=underline
if !s:mimic_astroboy_dark
" color for grey20 and blue {{{2
if !s:mimic_astroboy_alt
" current line, column
hi CursorLine guibg=#131313 gui=NONE
hi CursorColumn guibg=#131313 gui=NONE
else
" current line, column
hi CursorLine guibg=#000040 gui=NONE
hi CursorColumn guibg=#000040 gui=NONE
endif "}}}2
else
" color for black and darkblue {{{2
if !s:mimic_astroboy_alt
" current line, column
hi CursorLine guibg=#232323 gui=NONE
hi CursorColumn guibg=#232323 gui=NONE
else
" current line, column
hi CursorLine guibg=#000078 gui=NONE
hi CursorColumn guibg=#000078 gui=NONE
endif "}}}2
endif
" popup completion menu
hi Pmenu guifg=bg guibg=#68f8f8 gui=NONE
hi PmenuSel guifg=bg guibg=#f8f888 gui=underline
hi PmenuSbar guifg=#68f868 guibg=#68f868 gui=NONE
hi PmenuThumb guifg=#68f8f8 guibg=#68f8f8 gui=NONE
" spell checking
hi SpellBad guisp=#f87878 gui=undercurl
hi SpellCap guisp=#4888f8 gui=undercurl
hi SpellLocal guisp=#38f8f8 gui=undercurl
hi SpellRare guisp=#f838f8 gui=undercurl
endif
" other texts
hi Question guifg=#f8f888 guibg=bg gui=NONE
hi WarningMsg guifg=bg guibg=#f8f888 gui=NONE
hi ErrorMsg guifg=#e8e8e8 guibg=#c80000 gui=NONE
hi Title guifg=#e8e8e8 guibg=bg gui=NONE
hi Directory guifg=#e8e8e8 guibg=bg gui=NONE
hi MoreMsg guifg=#88f8c8 guibg=bg gui=NONE
" Default Syntax Highlight {{{1
"~~~~~~~~~~~~~~~~~~~~~~~~~~
hi Comment guifg=#d8d8d8 guibg=bg gui=NONE
hi link SpecialComment Comment
hi Constant guifg=#f8f888 guibg=bg gui=NONE
hi Character guifg=#f8f888 guibg=bg gui=NONE
hi String guifg=#f8f888 guibg=bg gui=NONE
hi link Number Constant
hi link Boolean Constant
hi link Float Constant
hi Identifier guifg=#f888f8 guibg=bg gui=NONE
hi Function guifg=#38f8f8 guibg=bg gui=NONE
hi Statement guifg=#38f8f8 guibg=bg gui=NONE
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
if !s:mimic_astroboy_dark
" colors for grey20 and blue {{{2
if !s:mimic_astroboy_alt
hi PreProc guifg=#d8d8d8 guibg=#131313 gui=NONE
hi Special guifg=#68f8f8 guibg=#131313 gui=NONE
hi Tag guifg=#f888f8 guibg=#131313 gui=NONE
else
hi PreProc guifg=#d8d8d8 guibg=#000040 gui=NONE
hi Special guifg=#68f8f8 guibg=#000040 gui=NONE
hi Tag guifg=#f888f8 guibg=#000040 gui=NONE
endif "}}}2
else
" colors for black and darkblue {{{2
if !s:mimic_astroboy_alt
hi PreProc guifg=#d8d8d8 guibg=#232323 gui=NONE
hi Special guifg=#68f8f8 guibg=#232323 gui=NONE
hi Tag guifg=#f888f8 guibg=#232323 gui=NONE
else
hi PreProc guifg=#d8d8d8 guibg=#000078 gui=NONE
hi Special guifg=#68f8f8 guibg=#000078 gui=NONE
hi Tag guifg=#f888f8 guibg=#000078 gui=NONE
endif "}}}2
endif
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi Type guifg=#78f8c8 guibg=bg gui=underline
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link SpecialChar Special
hi Delimiter guifg=#e8e8e8 guibg=bg gui=NONE
hi Debug guifg=#f888f8 guibg=bg gui=NONE
hi Underlined guifg=#f8f888 guibg=bg gui=underline
hi Ignore guifg=bg guibg=bg gui=NONE
hi Error guifg=#e8e8e8 guibg=#c80000 gui=NONE
hi Todo guifg=bg guibg=#f888f8 gui=NONE
" Font Style {{{1
"~~~~~~~~~~~~
if has("gui_running") && 0 < s:mimic_font_style
" Function: s:MultiHi {{{2
" Sets highlight option(s) on all its arguments.
" Parameters:
" option -- a string in the form of "key1=value1 key2=value2 ... keyN=valueN".
" ... -- the highlight group names.
function s:MultiHi(option, ...)
let l:i = 1
while l:i <= a:0
silent execute "hi " . a:{l:i} . " " . a:option
let l:i = l:i + 1
endwhile
endfunction "}}}2
" set the bold only options, including the "bold & italics" groups.
if 1 == s:mimic_font_style || 3 <= s:mimic_font_style
call s:MultiHi("gui=bold", "Directory", "StatusLine", "MoreMsg", "ModeMsg", "Title", "Constant", "Character", "Statement", "PreProc", "Identifier", "Function", "Special", "Tag", "Delimiter", "Todo")
call s:MultiHi("gui=underline,bold", "WildMenu", "TablineSel", "Type")
endif
" set the italic only options
if 2 == s:mimic_font_style || 3 <= s:mimic_font_style
call s:MultiHi("gui=italic", "TabLine", "StatusLineNC", "Folded", "Question", "Comment", "Identifier", "Function")
endif
" set the bold & italic options
if 3 <= s:mimic_font_style
call s:MultiHi("gui=bold,italic", "MoreMsg", "Title", "Identifier", "Function", "Todo")
endif
" cleanup
delfunction s:MultiHi
endif
" Cleanup {{{1
"~~~~~~~~~
unlet s:mimic_font_style s:mimic_colorize_gui s:mimic_astroboy_alt s:mimic_astroboy_dark
" vim:noet:sw=24:ts=24:tw=0:nowrap:
" vim600:fdc=2:fdm=marker:

164
colors/astronaut.vim Executable file
View File

@ -0,0 +1,164 @@
" astronaut.vim: a colorscheme
" Maintainer: Charles E. Campbell, Jr. <charles.e.campbell.1@gsfc.nasa.gov>
" Date: Feb 21, 2006
" Version: 7
"
" Usage:
" Put into your <.vimrc> file:
" color astronaut
"
" Optional Modifiers:
" let g:astronaut_bold=1 : term, cterm, and gui receive bold modifier
" let g:astronaut_dark=1 : dark colors used (otherwise some terminals
" make everything bold, which can be all one
" color)
" let g:astronaut_underline=1 : assume that underlining works on your terminal
" let g:astronaut_italic=1 : allows italic to be used in gui
" Examples:
" iris : let astronaut_dark=1
" Linux xterm: no modifiers needed
"
" GetLatestVimScripts: 122 1 :AutoInstall: astronaut.vim
set background=dark
hi clear
if exists( "syntax_on" )
syntax reset
endif
let g:colors_name = "astronaut"
let g:loaded_astronaut = "v7"
" ---------------------------------------------------------------------
" Default option values
if !exists("g:astronaut_bold")
" on some machines, notably SGIs, a bold qualifier means everything is
" one color (SGIs: yellow)
let g:astronaut_bold= 0
endif
if !exists("g:astronaut_dark")
" this option, if true, means darkcolor (ex. darkred, darkmagenta, etc)
" is understood and wanted
let g:astronaut_dark= 0
endif
if !exists("g:astronaut_underline")
let g:astronaut_underline= 1
endif
if !exists("g:astronaut_italic")
let g:astronaut_italic= 0
endif
" ---------------------------------------------------------------------
" Settings based on options
if g:astronaut_bold != 0
let s:bold=",bold"
else
let s:bold=""
endif
if g:astronaut_italic != 0
let s:italic= ",italic"
else
let s:italic= ""
endif
if g:astronaut_dark != 0
let s:black = "black"
let s:red = "darkred"
let s:green = "darkgreen"
let s:yellow = "darkyellow"
let s:blue = "darkblue"
let s:magenta = "darkmagenta"
let s:cyan = "darkcyan"
let s:white = "white"
else
let s:black = "black"
let s:red = "red"
let s:green = "green"
let s:yellow = "yellow"
let s:blue = "blue"
let s:magenta = "magenta"
let s:cyan = "cyan"
let s:white = "white"
endif
if g:astronaut_underline != 0
let s:underline= ",underline"
let s:ulbg = ""
else
let s:underline= "none"
if exists("g:astronaut_dark")
let s:ulbg = "ctermbg=darkmagenta guibg=magenta4"
else
let s:ulbg = "ctermbg=magenta guibg=magenta"
endif
endif
" ---------------------------------------------------------------------
exe "hi Blue start= stop= ctermfg=".s:blue." guifg=blue guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Comment start= stop= ctermfg=".s:white." guifg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Conceal ctermfg=".s:blue." ctermbg=".s:black." guifg=Blue guibg=Black term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Constant start= stop= ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Cursor guifg=blue guibg=green term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Cyan start= stop= ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Debug start= stop= ctermfg=".s:magenta." ctermbg=".s:black." guifg=magenta guibg=black term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Delimiter start= stop= ctermfg=".s:white." guifg=white guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi DiffAdd ctermfg=".s:white." ctermbg=".s:magenta." guifg=White guibg=Magenta term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi DiffChange ctermfg=".s:yellow." ctermbg=".s:blue." guifg=Yellow guibg=Blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi DiffDelete ctermfg=".s:white." ctermbg=".s:blue." guifg=White guibg=Blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi DiffText ctermfg=".s:white." ctermbg=".s:red." guifg=White guibg=Red term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Directory start= stop= ctermfg=".s:white." guifg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Error start= stop= ctermfg=".s:white." ctermbg=".s:red." guifg=white guibg=red term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi ErrorMsg ctermfg=".s:white." ctermbg=".s:red." guifg=White guibg=Red term=standout".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi FoldColumn start= stop= ctermfg=".s:cyan." ctermbg=".s:black." guifg=Cyan guibg=Brown term=standout".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Folded start= stop= ctermfg=".s:magenta." ctermbg=".s:black." guifg=magenta guibg=black term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Function start= stop= ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Green start= stop= ctermfg=".s:green." guifg=green guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Identifier start= stop= ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Ignore ctermfg=".s:black ." guifg=bg term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi IncSearch start= stop= ctermfg=".s:black ." ctermbg=".s:green." guifg=black guibg=green term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi LineNr ctermfg=".s:yellow." ".s:ulbg." guifg=Yellow term=none".s:underline.s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Magenta start= stop= ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Menu guifg=black guibg=gray75 term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi ModeMsg ctermfg=".s:green." guifg=SeaGreen term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi MoreMsg ctermfg=".s:green." guifg=SeaGreen term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi NonText ctermfg=".s:blue." guifg=Blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Normal start= stop= ctermfg=".s:green." guifg=green guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi PreProc start= stop= ctermfg=".s:white." ctermbg=".s:blue." guifg=white guibg=blue3 term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Question start= stop= ctermfg=".s:yellow." guifg=yellow term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Red start= stop= ctermfg=".s:red." guifg=red guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Scrollbar guifg=gray80 guibg=gray70 term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Search start= stop= ctermfg=".s:yellow." ctermbg=".s:blue." guifg=yellow guibg=blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Special start= stop= ctermfg=".s:green." ctermbg=".s:blue." guifg=green guibg=blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi SpecialKey start= stop= ctermfg=".s:black." ctermbg=".s:magenta." guifg=black guibg=magenta term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Statement start= stop= ctermfg=".s:cyan." guifg=cyan guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi StatusLine start= stop= ctermfg=".s:black." ctermbg=".s:cyan." guifg=black guibg=cyan term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi StatusLineNC start= stop= ctermfg=".s:black." ctermbg=".s:green." guifg=black guibg=green term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi String start= stop= ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Subtitle start= stop= ctermfg=".s:magenta." guifg=magenta guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
if v:version >= 700
exe "hi TabLine start= stop= ctermfg=".s:black." ctermbg=".s:blue." guifg=black guibg=blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold.s:underline.s:italic
exe "hi TabLineSel start= stop= ctermfg=".s:green." ctermbg=".s:blue." guifg=green guibg=blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold.s:underline.s:italic
exe "hi TabLineFill start= stop= ctermfg=".s:blue." ctermbg=".s:blue." guifg=blue guibg=blue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
endif
exe "hi Tags start= stop= ctermfg=".s:yellow." ctermbg=".s:blue." guifg=yellow guibg=blue3 term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Title start= stop= ctermfg=".s:white." guifg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Todo start= stop= ctermfg=".s:white." ctermbg=".s:magenta." guifg=white guibg=magenta term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Type start= stop= ctermfg=".s:green." ".s:ulbg." guifg=seagreen1 term=none".s:underline.s:bold." cterm=none".s:bold.s:underline." gui=none".s:bold.s:underline
exe "hi Underlined ctermfg=".s:green." ".s:ulbg." guifg=green term=none".s:underline.s:bold." cterm=none".s:bold.s:underline." gui=none".s:bold.s:underline
exe "hi Unique start= stop= ctermfg=".s:blue." ctermbg=".s:white." guifg=blue3 guibg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi AltUnique start= stop= ctermfg=".s:magenta." ctermbg=".s:white." guifg=magenta guibg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi AltAltUnique start= stop= ctermfg=".s:black." ctermbg=".s:white." guifg=black guibg=white term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi VertSplit start= stop= ctermfg=".s:black." ctermbg=".s:green." guifg=black guibg=green term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Visual start= stop= ctermfg=black ctermbg=green guifg=Grey guibg=fg term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi VisualNOS ".s:ulbg." term=none".s:underline.s:bold." cterm=none".s:bold.s:underline." gui=none".s:bold.s:underline
exe "hi WarningMsg start= stop= ctermfg=".s:black." ctermbg=".s:yellow." guifg=black guibg=yellow term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi White start= stop= ctermfg=".s:white." guifg=white guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi WildMenu ctermfg=".s:black." ctermbg=".s:yellow." guifg=Black guibg=Yellow term=standout".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi Yellow start= stop= ctermfg=".s:yellow." guifg=yellow guibg=navyblue term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi lCursor guifg=bg guibg=fg term=none".s:bold." cterm=none".s:bold." gui=none".s:bold
exe "hi AltConstant start= stop= ctermfg=".s:yellow." ctermbg=".s:black." guifg=yellow guibg=black term=none".s:bold." cterm=none".s:bold." gui=none".s:bold.s:italic
exe "hi AltFunction start= stop= ctermfg=".s:green." ctermbg=".s:black." guifg=green guibg=black term=none".s:bold." cterm=none".s:bold." gui=none".s:bold.s:italic
exe "hi AltType start= stop= ctermfg=".s:green." ctermbg=".s:black." guifg=seagreen1 guibg=black term=none".s:underline.s:bold." cterm=none".s:bold.s:underline." gui=none".s:bold.s:underline.s:italic
exe "hi User1 ctermfg=".s:white." ctermbg=".s:blue." guifg=white guibg=blue"
exe "hi User2 ctermfg=".s:cyan." ctermbg=".s:blue." guifg=cyan guibg=blue"
" vim: nowrap

59
colors/asu1dark.vim Executable file
View File

@ -0,0 +1,59 @@
" Vim color file
" Maintainer: A. Sinan Unur
" Last Change: 2001/10/04
" Dark color scheme
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name="asu1dark"
" Console Color Scheme
hi Normal term=NONE cterm=NONE ctermfg=LightGray ctermbg=Black
hi NonText term=NONE cterm=NONE ctermfg=Brown ctermbg=Black
hi Function term=NONE cterm=NONE ctermfg=DarkCyan ctermbg=Black
hi Statement term=BOLD cterm=BOLD ctermfg=DarkBlue ctermbg=Black
hi Special term=NONE cterm=NONE ctermfg=DarkGreen ctermbg=Black
hi SpecialChar term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black
hi Constant term=NONE cterm=NONE ctermfg=Blue ctermbg=Black
hi Comment term=NONE cterm=NONE ctermfg=DarkGray ctermbg=Black
hi Preproc term=NONE cterm=NONE ctermfg=DarkGreen ctermbg=Black
hi Type term=NONE cterm=NONE ctermfg=DarkMagenta ctermbg=Black
hi Identifier term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black
hi StatusLine term=BOLD cterm=NONE ctermfg=Yellow ctermbg=DarkBlue
hi StatusLineNC term=NONE cterm=NONE ctermfg=Black ctermbg=Gray
hi Visual term=NONE cterm=NONE ctermfg=White ctermbg=DarkCyan
hi Search term=NONE cterm=NONE ctermbg=Yellow ctermfg=DarkBlue
hi VertSplit term=NONE cterm=NONE ctermfg=Black ctermbg=Gray
hi Directory term=NONE cterm=NONE ctermfg=Green ctermbg=Black
hi WarningMsg term=NONE cterm=NONE ctermfg=Blue ctermbg=Yellow
hi Error term=NONE cterm=NONE ctermfg=DarkRed ctermbg=Gray
hi Cursor ctermfg=Black ctermbg=Cyan
hi LineNr term=NONE cterm=NONE ctermfg=Red ctermbg=Black
" GUI Color Scheme
hi Normal gui=NONE guifg=White guibg=#110022
hi NonText gui=NONE guifg=#ff9999 guibg=#444444
hi Function gui=NONE guifg=#7788ff guibg=#110022
hi Statement gui=BOLD guifg=Yellow guibg=#110022
hi Special gui=NONE guifg=Cyan guibg=#110022
hi Constant gui=NONE guifg=#ff9900 guibg=#110022
hi Comment gui=NONE guifg=#99cc99 guibg=#110022
hi Preproc gui=NONE guifg=#33ff66 guibg=#110022
hi Type gui=NONE guifg=#ff5577 guibg=#110022
hi Identifier gui=NONE guifg=Cyan guibg=#110022
hi StatusLine gui=BOLD guifg=White guibg=#336600
hi StatusLineNC gui=NONE guifg=Black guibg=#cccccc
hi Visual gui=NONE guifg=White guibg=#00aa33
hi Search gui=BOLD guibg=Yellow guifg=DarkBlue
hi VertSplit gui=NONE guifg=White guibg=#666666
hi Directory gui=NONE guifg=Green guibg=#110022
hi WarningMsg gui=STANDOUT guifg=#0000cc guibg=Yellow
hi Error gui=NONE guifg=White guibg=Red
hi Cursor guifg=White guibg=#00ff33
hi LineNr gui=NONE guifg=#cccccc guibg=#334444
hi ModeMsg gui=NONE guifg=Blue guibg=White
hi Question gui=NONE guifg=#66ff99 guibg=#110022

69
colors/autumn.vim Executable file
View File

@ -0,0 +1,69 @@
" Vim color file
" Maintainer: Tiza
" Last Change: 2002/10/14 Mon 16:41.
" version: 1.0
" This color scheme uses a light background.
set background=light
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "autumn"
hi Normal guifg=#404040 guibg=#fff4e8
" Search
hi IncSearch gui=UNDERLINE guifg=#404040 guibg=#e0e040
hi Search gui=NONE guifg=#544060 guibg=#f0c0ff
" Messages
hi ErrorMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff
hi WarningMsg gui=BOLD guifg=#f8f8f8 guibg=#4040ff
hi ModeMsg gui=NONE guifg=#d06000 guibg=NONE
hi MoreMsg gui=NONE guifg=#0090a0 guibg=NONE
hi Question gui=NONE guifg=#8000ff guibg=NONE
" Split area
hi StatusLine gui=BOLD guifg=#f8f8f8 guibg=#904838
hi StatusLineNC gui=BOLD guifg=#c0b0a0 guibg=#904838
hi VertSplit gui=NONE guifg=#f8f8f8 guibg=#904838
hi WildMenu gui=BOLD guifg=#f8f8f8 guibg=#ff3030
" Diff
hi DiffText gui=NONE guifg=#2850a0 guibg=#c0d0f0
hi DiffChange gui=NONE guifg=#208040 guibg=#c0f0d0
hi DiffDelete gui=NONE guifg=#ff2020 guibg=#eaf2b0
hi DiffAdd gui=NONE guifg=#ff2020 guibg=#eaf2b0
" Cursor
hi Cursor gui=NONE guifg=#ffffff guibg=#0080f0
hi lCursor gui=NONE guifg=#ffffff guibg=#8040ff
hi CursorIM gui=NONE guifg=#ffffff guibg=#8040ff
" Fold
hi Folded gui=NONE guifg=#804030 guibg=#ffc0a0
hi FoldColumn gui=NONE guifg=#a05040 guibg=#f8d8c4
" Other
hi Directory gui=NONE guifg=#7050ff guibg=NONE
hi LineNr gui=NONE guifg=#e0b090 guibg=NONE
hi NonText gui=BOLD guifg=#a05040 guibg=#ffe4d4
hi SpecialKey gui=NONE guifg=#0080ff guibg=NONE
hi Title gui=BOLD guifg=fg guibg=NONE
hi Visual gui=NONE guifg=#804020 guibg=#ffc0a0
" hi VisualNOS gui=NONE guifg=#604040 guibg=#e8dddd
" Syntax group
hi Comment gui=NONE guifg=#ff5050 guibg=NONE
hi Constant gui=NONE guifg=#00884c guibg=NONE
hi Error gui=BOLD guifg=#f8f8f8 guibg=#4040ff
hi Identifier gui=NONE guifg=#b07800 guibg=NONE
hi Ignore gui=NONE guifg=bg guibg=NONE
hi PreProc gui=NONE guifg=#0090a0 guibg=NONE
hi Special gui=NONE guifg=#8040f0 guibg=NONE
hi Statement gui=BOLD guifg=#80a030 guibg=NONE
hi Todo gui=BOLD,UNDERLINE guifg=#0080f0 guibg=NONE
hi Type gui=BOLD guifg=#b06c58 guibg=NONE
hi Underlined gui=UNDERLINE guifg=blue guibg=NONE

88
colors/autumn2.vim Executable file
View File

@ -0,0 +1,88 @@
" Vim colour file
" Maintainer: Antony Scriven <ad_scriven@postmaster.co.uk>
" Last Change: 2003-06-12
"
set background=light
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "autumn"
hi Normal term=none cterm=none ctermfg=black ctermbg=White gui=none guifg=Black guibg=#f0f2f0
hi Cursor term=none cterm=none ctermfg=white ctermbg=darkgrey gui=none guifg=black guibg=red
hi DiffAdd term=bold cterm=none ctermfg=white ctermbg=DarkBlue gui=none guifg=#aaeeaa guibg=#447744
hi DiffChange term=bold cterm=none ctermfg=white ctermbg=DarkMagenta gui=none guifg=lightyellow guibg=#ddbb55
hi DiffDelete term=bold cterm=none ctermfg=blue ctermbg=darkcyan gui=none guifg=#336633 guibg=#aaccaa
hi difftext term=reverse cterm=bold ctermfg=white ctermbg=red gui=none guifg=lightyellow guibg=#cc7733
hi Directory term=none cterm=none ctermfg=Red ctermbg=white gui=none guifg=Red guibg=bg
hi ErrorMsg term=standout cterm=none ctermfg=white ctermbg=DarkRed gui=none guifg=white guibg=DarkRed
hi Folded term=reverse cterm=none ctermfg=darkblue ctermbg=lightgrey gui=none guifg=darkblue guibg=lightgrey
"8 col term
hi FoldColumn term=reverse cterm=none ctermfg=darkblue ctermbg=grey gui=none guifg=darkblue guibg=grey
hi IncSearch term=reverse cterm=none ctermfg=yellow ctermbg=darkgreen gui=none guifg=yellow guibg=#449944
hi lCursor term=reverse cterm=none ctermfg=black ctermbg=cyan gui=none guifg=black guibg=Cyan
hi LineNr term=reverse cterm=none ctermfg=darkred ctermbg=grey gui=none guifg=brown guibg=lightgrey
hi ModeMsg term=bold cterm=none ctermfg=green ctermbg=darkgreen gui=none guifg=#007700 guibg=#aaccaa
hi MoreMsg term=bold cterm=none ctermfg=darkGreen ctermbg=white gui=none guifg=darkgreen guibg=bg
hi Question term=bold cterm=none ctermfg=darkGreen ctermbg=white gui=none guifg=darkgreen guibg=bg
hi Search term=reverse cterm=none ctermfg=black ctermbg=yellow gui=none guifg=black guibg=yellow
hi SpecialKey term=italic cterm=none ctermfg=lightgrey ctermbg=white gui=none guifg=lightblue guibg=bg
hi NonText term=bold cterm=none ctermfg=lightgrey ctermbg=white gui=none guifg=#c6c6c6 guibg=bg
hi StatusLine term=reverse cterm=none ctermfg=white ctermbg=black gui=none guifg=#80624d guibg=#ddd9b8
hi Title term=bold cterm=none ctermfg=DarkMagenta ctermbg=white gui=none guifg=DarkMagenta guibg=bg
if has("gui_running") || &t_Co > 8
hi Visual term=reverse cterm=none ctermfg=black ctermbg=lightgrey gui=none guifg=black guibg=lightgreen
hi VertSplit term=reverse cterm=none ctermfg=darkgrey ctermbg=darkgrey gui=none guifg=#c7c7c2 guibg=#d7d7d2
hi StatusLineNC term=reverse cterm=none ctermfg=white ctermbg=darkgrey gui=none guifg=darkgrey guibg=#d7d7d2
hi Comment term=italic cterm=none ctermfg=grey ctermbg=white gui=none guifg=#ccaaaa guibg=bg
else
hi Visual term=reverse cterm=none ctermfg=green ctermbg=darkgreen gui=none guifg=black guibg=lightgreen
hi VertSplit term=reverse cterm=none ctermfg=darkcyan ctermbg=darkblue gui=none guifg=darkgrey guibg=darkgrey
hi StatusLineNC term=reverse cterm=none ctermfg=white ctermbg=darkblue gui=none guifg=white guibg=darkgrey
hi Comment term=italic cterm=none ctermfg=darkcyan ctermbg=white gui=none guifg=#ccaaaa guibg=bg
endif
hi VisualNOS term=bold cterm=none ctermfg=grey ctermbg=black gui=none guifg=grey guibg=black
hi WarningMsg term=standout cterm=none ctermfg=Red ctermbg=white gui=none guifg=Red guibg=bg
hi WildMenu term=bold cterm=none ctermfg=darkblue ctermbg=yellow gui=none guifg=black guibg=lightyellow
hi Constant term=underline cterm=none ctermfg=darkred ctermbg=bg gui=none guifg=#bb6666 guibg=bg
hi Special term=bold cterm=none ctermfg=darkcyan ctermbg=white gui=none guifg=darkcyan guibg=bg
hi identifier term=underline cterm=none ctermfg=darkmagenta ctermbg=white gui=none guifg=darkcyan guibg=bg
hi statement term=bold cterm=none ctermfg=darkgreen ctermbg=white gui=none guifg=#44aa44 guibg=bg
hi preproc term=underline cterm=none ctermfg=darkgrey ctermbg=white gui=none guifg=darkgrey guibg=bg
hi type term=none cterm=none ctermfg=brown ctermbg=white gui=none guifg=#bb9900 guibg=bg
hi underlined term=underline cterm=underline ctermfg=darkmagenta ctermbg=white gui=underline guifg=darkmagenta guibg=bg
hi Ignore term=italic cterm=none ctermfg=lightgrey ctermbg=white gui=none guifg=grey guibg=bg
"hi todo term=underline cterm=bold ctermfg=yellow ctermbg=brown gui=none guifg=#333333 guibg=#ddee33
hi todo term=bold cterm=none ctermfg=yellow ctermbg=brown gui=bold guifg=#229900 guibg=#ddd9b8
hi function term=bold cterm=none ctermfg=blue ctermbg=white gui=none guifg=#0055cc guibg=bg
hi link String Constant
hi link Character Constant
hi link Number Constant
hi link Boolean Constant
hi link Float Number
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link Tag Special
hi link SpecialChar Special
hi link Delimiter Special
hi link SpecialComment Special
hi link Debug Special
hi link vimfunction function
" vim: set ts=8 sw=8 et sts=8 tw=72 fo-=t ff=unix :

154
colors/autumnleaf.vim Executable file
View File

@ -0,0 +1,154 @@
" Vim color file
" Maintainer: Anders Korte
" Last Change: 17 Oct 2004
" AutumnLeaf color scheme 1.0
set background=light
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name="AutumnLeaf"
" Colors for the User Interface.
hi Cursor guibg=#aa7733 guifg=#ffeebb gui=bold
hi Normal guibg=#fffdfa guifg=black gui=none
hi NonText guibg=#eafaea guifg=#000099 gui=bold
hi Visual guibg=#fff8cc guifg=black gui=none
" hi VisualNOS
hi Linenr guibg=bg guifg=#999999 gui=none
" Uncomment these if you use Diff...??
" hi DiffText guibg=#cc0000 guifg=white gui=none
" hi DiffAdd guibg=#0000cc guifg=white gui=none
" hi DiffChange guibg=#990099 guifg=white gui=none
" hi DiffDelete guibg=#888888 guifg=#333333 gui=none
hi Directory guibg=bg guifg=#337700 gui=none
hi IncSearch guibg=#c8e8ff guifg=black gui=none
hi Search guibg=#c8e8ff guifg=black gui=none
hi SpecialKey guibg=bg guifg=fg gui=none
hi Titled guibg=bg guifg=fg gui=none
hi ErrorMsg guibg=bg guifg=#cc0000 gui=bold
hi ModeMsg guibg=bg guifg=#003399 gui=none
hi link MoreMsg ModeMsg
hi link Question ModeMsg
hi WarningMsg guibg=bg guifg=#cc0000 gui=bold
hi StatusLine guibg=#ffeebb guifg=black gui=bold
hi StatusLineNC guibg=#aa8866 guifg=#f8e8cc gui=none
hi VertSplit guibg=#aa8866 guifg=#ffe0bb gui=none
" hi Folded
" hi FoldColumn
" hi SignColumn
" Colors for Syntax Highlighting.
hi Comment guibg=#ddeedd guifg=#002200 gui=none
hi Constant guibg=bg guifg=#003399 gui=bold
hi String guibg=bg guifg=#003399 gui=italic
hi Character guibg=bg guifg=#003399 gui=italic
hi Number guibg=bg guifg=#003399 gui=bold
hi Boolean guibg=bg guifg=#003399 gui=bold
hi Float guibg=bg guifg=#003399 gui=bold
hi Identifier guibg=bg guifg=#003399 gui=none
hi Function guibg=bg guifg=#0055aa gui=bold
hi Statement guibg=bg guifg=#003399 gui=none
hi Conditional guibg=bg guifg=#aa7733 gui=bold
hi Repeat guibg=bg guifg=#aa5544 gui=bold
hi link Label Conditional
hi Operator guibg=bg guifg=#aa7733 gui=bold
hi link Keyword Statement
hi Exception guibg=bg guifg=#228877 gui=bold
hi PreProc guibg=bg guifg=#aa7733 gui=bold
hi Include guibg=bg guifg=#558811 gui=bold
hi link Define Include
hi link Macro Include
hi link PreCondit Include
hi Type guibg=bg guifg=#007700 gui=bold
hi link StorageClass Type
hi link Structure Type
hi Typedef guibg=bg guifg=#009900 gui=italic
hi Special guibg=bg guifg=fg gui=none
hi SpecialChar guibg=bg guifg=fg gui=bold
hi Tag guibg=bg guifg=#003399 gui=bold
hi link Delimiter Special
hi SpecialComment guibg=#dddddd guifg=#aa0000 gui=none
hi link Debug Special
hi Underlined guibg=bg guifg=blue gui=underline
hi Title guibg=bg guifg=fg gui=bold
hi Ignore guibg=bg guifg=#999999 gui=none
hi Error guibg=red guifg=white gui=none
hi Todo guibg=bg guifg=#aa0000 gui=none
" The same in cterm colors.
hi Cursor ctermbg=6 ctermfg=14
hi Normal ctermbg=15 ctermfg=0
hi NonText ctermbg=10 ctermfg=1
hi Visual ctermbg=14 ctermfg=0
" hi VisualNOS
hi Linenr ctermbg=bg ctermfg=7
" hi DiffText ctermbg=4 ctermfg=15
" hi DiffAdd ctermbg=1 ctermfg=15
" hi DiffChange ctermbg=5 ctermfg=15
" hi DiffDelete ctermbg=7 ctermfg=8
hi Directory ctermbg=bg ctermfg=2
hi IncSearch ctermbg=9 ctermfg=0
hi Search ctermbg=9 ctermfg=0
hi SpecialKey ctermbg=bg ctermfg=fg
hi Titled ctermbg=bg ctermfg=fg
hi ErrorMsg ctermbg=bg ctermfg=12
hi ModeMsg ctermbg=bg ctermfg=9
hi WarningMsg ctermbg=bg ctermfg=12
hi StatusLine ctermbg=14 ctermfg=0
hi StatusLineNC ctermbg=6 ctermfg=14
hi VertSplit ctermbg=6 ctermfg=14
" hi Folded
" hi FoldColumn
" hi SignColumn
hi Comment ctermbg=10 ctermfg=2
hi Constant ctermbg=bg ctermfg=9
hi String ctermbg=bg ctermfg=9 cterm=italic
hi Character ctermbg=bg ctermfg=9 cterm=italic
hi Number ctermbg=bg ctermfg=9 cterm=bold
hi Boolean ctermbg=bg ctermfg=9 cterm=bold
hi Float ctermbg=bg ctermfg=9 cterm=bold
hi Function ctermbg=bg ctermfg=9 cterm=bold
hi Statement ctermbg=bg ctermfg=9 cterm=bold
hi Conditional ctermbg=bg ctermfg=6 cterm=bold
hi Repeat ctermbg=bg ctermfg=6 cterm=bold
hi Operator ctermbg=bg ctermfg=6 cterm=bold
hi Exception ctermbg=bg ctermfg=2 cterm=bold
hi PreProc ctermbg=bg ctermfg=6
hi Include ctermbg=bg ctermfg=2 cterm=bold
hi Type ctermbg=bg ctermfg=2 cterm=bold
hi Typedef ctermbg=bg ctermfg=2 cterm=italic
hi Special ctermbg=bg ctermfg=fg cterm=bold
hi Tag ctermbg=bg ctermfg=9 cterm=bold
hi SpecialComment ctermbg=7 ctermfg=4
hi Underlined ctermbg=bg ctermfg=9 cterm=underline
hi Title ctermbg=bg ctermfg=fg cterm=bold
hi Ignore ctermbg=bg ctermfg=7
hi Error ctermbg=12 ctermfg=15
hi Todo ctermbg=bg ctermfg=15

319
colors/baycomb.vim Executable file
View File

@ -0,0 +1,319 @@
" Vim color file
" baycomb v2.4
" http://www.vim.org/scripts/script.php?script_id=1454
"
" Maintainer: Shawn Axsom <axs221@gmail.com>
"
" * Place :colo baycomb in your VimRC/GVimRC file
" * Also add :set background=dark or :setbackground=light
" depending on your preference.
"
" - Thanks to Desert and OceanDeep for their color scheme
" file layouts
" - Thanks to Raimon Grau and Bob Lied for their feedback
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name="baycomb"
if &background == "dark"
hi Normal guifg=#a0b4e0 guibg=#11121a "1a1823
hi NonText guifg=#382920 guibg=bg
hi Folded guibg=#232235 guifg=grey
hi FoldColumn guibg=#0a0a18 guifg=#dbcaa5
hi LineNr guibg=#101124 guifg=#206aa9
hi StatusLine guibg=#354070 guifg=#6880ea gui=none
hi StatusLineNC guibg=#2c3054 guifg=#5c6dbe gui=none
hi VertSplit guibg=#22253c guifg=#223355 gui=none
hi tablinesel guibg=#515a71 guifg=#50aae5 gui=none
hi tabline guibg=#4d4d5f guifg=#5b7098 gui=none
hi tablinefill guibg=#2d2d3f guifg=#aaaaaa gui=none
"hi SpellBad
"hi SpellCap
"hi SpellLocal
"hi SpellRare
hi MatchParen guibg=#7b5a55 guifg=#001122
" syntax highlighting """"""""""""""""""""""""""""""""""""""""
hi Comment guifg=#349d58 guibg=bg
hi Title guifg=#e5e5ca gui=none
hi Underlined guifg=#bac5ba gui=none
hi Statement guifg=#fca8ad gui=none "a080aa
hi Type guifg=#0490e8 gui=bold
hi Constant guifg=#5c78f0 "guibg=#111a2a
hi Number guifg=#4580b4 "guibg=#111a2a
hi PreProc guifg=#ba75cf
hi Special guifg=#aaaaca
hi Ignore guifg=grey40
hi Todo guifg=orangered guibg=yellow2
hi Error guibg=#b03452
hi Function guifg=#bab588 guibg=bg gui=bold
hi Identifier guifg=#5094c4
"""""this section borrowed from OceanDeep/Midnight"""""
highlight Conditional gui=None guifg=#d0688d guibg=bg
highlight Repeat gui=None guifg=#e06070 guibg=bg
"hi Label gui=None guifg=LightGreen guibg=bg
highlight Operator gui=None guifg=#e8cdc0 guibg=bg
highlight Keyword gui=bold guifg=grey guibg=bg
highlight Exception gui=bold guifg=#d0a8ad guibg=bg
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
"end syntax highlighting """""""""""""""""""""""""""""""""""""
" highlight groups
"hi CursorIM
hi Directory guifg=#bbd0df
hi DiffText guibg=#004335
hi DiffChange guibg=#685b5c
hi DiffAdd guibg=#0a4b8c
hi DiffDelete guifg=#300845 guibg=#200845
hi ErrorMsg guibg=#ff4545
hi Cursor guibg=#cad5c0 guifg=#0000aa
hi Search guibg=darkyellow guifg=black
hi IncSearch guifg=#babeaa guibg=#3a4520
hi ModeMsg guifg=#00AACC
hi MoreMsg guifg=SeaGreen
hi Question guifg=#AABBCC
hi SpecialKey guifg=#90dcb0
hi Visual guifg=#102030 guibg=#80a0f0
hi VisualNOS guifg=#201a30 guibg=#a3a5FF
hi WarningMsg guifg=salmon
"hi WildMenu
"hi Menu
"hi Scrollbar guibg=grey30 guifg=tan
"hi Tooltip
" new Vim 7.0 items
hi Pmenu guibg=#3a6595 guifg=#9aadd5
hi PmenuSel guibg=#4a85ba guifg=#b0d0f0
" color terminal definitions
hi Cursor ctermfg=black ctermbg=white
hi Normal ctermfg=grey ctermbg=black
hi Number ctermfg=darkgreen
highlight Operator ctermfg=yellow
highlight Conditional ctermfg=darkred
highlight Repeat ctermfg=darkred
hi Exception ctermfg=darkred
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkgrey
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch ctermfg=yellow ctermbg=darkyellow cterm=NONE
hi Search ctermfg=black ctermbg=darkyellow cterm=NONE
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=darkcyan ctermbg=black
hi Question ctermfg=green
hi StatusLine ctermfg=yellow ctermbg=darkblue cterm=NONE
hi StatusLineNC ctermfg=grey ctermbg=darkblue cterm=NONE
hi VertSplit ctermfg=black ctermbg=darkgrey cterm=NONE
hi Title ctermfg=yellow cterm=NONE
hi Visual ctermbg=grey ctermfg=blue cterm=NONE
hi VisualNOS ctermbg=grey ctermfg=blue cterm=NONE
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=darkgreen ctermbg=darkblue cterm=NONE
hi FoldColumn ctermfg=yellow ctermbg=black
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=darkgreen ctermbg=black
hi Identifier ctermfg=cyan
"set comments to grey on non-Windows OS's to make sure
"it is readable
if &term == "builtin_gui" || &term == "win32"
hi function ctermfg=grey
hi Type ctermfg=darkyellow ctermbg=darkblue
hi IncSearch ctermfg=black ctermbg=grey cterm=NONE
hi Search ctermfg=black ctermbg=darkgrey cterm=NONE
else
hi function ctermfg=white
hi Type ctermfg=grey
hi IncSearch ctermfg=yellow ctermbg=darkyellow cterm=NONE
hi Search ctermfg=black ctermbg=darkyellow cterm=NONE
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""
hi Constant ctermfg=darkcyan
hi Special ctermfg=white
hi Statement ctermfg=yellow
hi PreProc ctermfg=darkred
hi Underlined ctermfg=cyan cterm=NONE
hi Ignore cterm=bold ctermfg=7
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1
" new Vim 7.0 items
hi Pmenu ctermbg=darkblue ctermfg=lightgrey
hi PmenuSel ctermbg=lightblue ctermfg=white
hi tablinesel ctermfg=cyan ctermbg=blue
hi tabline ctermfg=black ctermbg=blue
hi tablinefill ctermfg=green ctermbg=darkblue
"vim: sw=4
"
hi MatchParen ctermfg=black ctermbg=green
elseif &background == "light"
hi Normal guifg=#003255 guibg=#e8ebf0 "greyish blue2
hi NonText guifg=#382920 guibg=#152555
" syntax highlighting """"""""""""""""""""""""""""""""""""""""
"set comments to grey on non-Windows OS's to make sure
"it is readable
if &term == "builtin_gui" || &term == "win32"
hi Comment guifg=#daddb8 guibg=#308ae5
else
hi Comment guifg=darkyellow guibg=#207ada
endif
""""""""""""""""""""""""""""""""""""""""""""""""""""""
hi Title guifg=#857540 gui=none
hi Underlined guifg=#8a758a
hi Statement guifg=#da302a gui=none
hi Type guifg=#307aca gui=none
hi Constant guifg=#3a40aa gui=none
hi PreProc guifg=#9570b5
hi Identifier guifg=#856075 "gui=bold
hi Special guifg=#652a7a
hi Ignore guifg=grey40
hi Todo guifg=orangered guibg=yellow2
hi Error guibg=#b03452
"""""this section borrowed from OceanDeep/Midnight"""""
hi Number guifg=#006bcd
hi Function gui=None guifg=#d06d50 "or green 50b3b0
highlight Conditional gui=None guifg=#a50a4a
highlight Repeat gui=None guifg=#700d8a
"hi Label gui=None guifg=LightGreen guibg=bg
highlight Operator gui=None guifg=#e0b045
highlight Keyword gui=bold guifg=grey guibg=bg
highlight Exception gui=none guifg=#ea5460
"""""""""""""""""""""""""""""""""""""""""""""""""""""""
"end syntax highlighting """""""""""""""""""""""""""""""""""""
" highlight groups
"hi CursorIM
hi Directory guifg=#bbd0df
"hi DiffAdd
"hi DiffChange
"hi DiffDelete
"hi DiffText
hi ErrorMsg guibg=#ff4545
hi Cursor guibg=#cadaca guifg=#05293d
hi FoldColumn guibg=#409ae0 guifg=darkgrey
"hi FoldColumn guibg=#83a5cd guifg=#70459F
hi LineNr guibg=#409ae0 guifg=darkblue gui=bold
"hi LineNr guibg=#081c30 guifg=#80a0dA
hi StatusLine guibg=#20b5fd guifg=#0a150d gui=none
hi StatusLineNC guibg=#0580da guifg=#302d34 gui=none
hi Search guibg=#babdad guifg=#3a4520
hi IncSearch guifg=#dadeca guibg=#3a4520
hi VertSplit guibg=#525f95 guifg=grey50 gui=none
hi Folded guibg=#252f5d guifg=#BBDDCC
hi ModeMsg guifg=#00AACC
hi MoreMsg guifg=SeaGreen
hi Question guifg=#AABBCC
hi SpecialKey guifg=#308c70
hi Visual guifg=#008FBF guibg=#33DFEF
"hi VisualNOS
hi WarningMsg guifg=salmon
"hi WildMenu
"hi Menu
"hi Scrollbar guibg=grey30 guifg=tan
"hi Tooltip
" new Vim 7.0 items
hi Pmenu guibg=#3a6595 guifg=#9aadd5
hi PmenuSel guibg=#4a85ba guifg=#b0d0f0
" color terminal definitions
hi Normal ctermfg=black ctermbg=white
hi Number ctermfg=blue
highlight Operator ctermfg=yellow
highlight Conditional ctermfg=magenta
highlight Repeat ctermfg=magenta
hi Exception ctermfg=red
hi function ctermfg=darkyellow
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkgrey ctermbg=grey
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch ctermfg=yellow ctermbg=darkyellow cterm=NONE
hi Search ctermfg=white ctermbg=darkyellow cterm=NONE
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=black ctermbg=blue
hi Question ctermfg=green
hi StatusLine ctermfg=cyan ctermbg=blue cterm=NONE
hi StatusLineNC ctermfg=grey ctermbg=darkblue cterm=NONE
hi VertSplit ctermfg=black ctermbg=black cterm=NONE
hi Title ctermfg=darkyellow ctermbg=white
hi Visual ctermbg=darkcyan ctermfg=cyan cterm=NONE
hi VisualNOS ctermbg=darkcyan ctermfg=white cterm=NONE
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=black ctermbg=white cterm=NONE
hi FoldColumn ctermfg=green ctermbg=blue
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=grey ctermbg=blue
hi Constant ctermfg=darkblue
hi Special ctermfg=darkmagenta
hi Identifier ctermfg=darkyellow cterm=NONE
hi Statement ctermfg=red
hi PreProc ctermfg=magenta
hi Type ctermfg=darkcyan "or darkcyan
hi Underlined ctermfg=black ctermbg=white
hi Ignore cterm=bold ctermfg=7
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1
" new Vim 7.0 items
hi Pmenu ctermbg=darkblue ctermfg=lightgrey
hi PmenuSel ctermbg=lightblue ctermfg=white
"vim: sw=4
endif

67
colors/bclear.vim Executable file
View File

@ -0,0 +1,67 @@
" Vim colorscheme
" Name: bclear
" Maintainer: Ricky Cintron 'borosai' [borosai at gmail dot com]
" Last Change: 2009-08-04
hi clear
set background=light
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "bclear"
"---GUI settings
hi SpecialKey guifg=#000000 guibg=#ffcde6
hi NonText guifg=#969696 guibg=#f0f0f0 gui=none
hi Directory guifg=#78681a
hi ErrorMsg guifg=#ffffff guibg=#a01010
hi IncSearch guifg=#ffffff guibg=#ff8000 gui=none
hi Search guifg=#000000 guibg=#ffd073
hi MoreMsg guifg=#ffffff guibg=#3c960f gui=none
hi ModeMsg guifg=#323232 gui=none
hi LineNr guifg=#969696 guibg=#f0f0f0
hi Question guifg=#000000 guibg=#ffde37 gui=none
hi StatusLine guifg=#ffffff guibg=#323232 gui=none
hi StatusLineNC guifg=#f0f0f0 guibg=#646464 gui=none
hi VertSplit guifg=#f0f0f0 guibg=#646464 gui=none
hi Title guifg=#323232 gui=none
hi Visual guifg=#ffffff guibg=#1994d1
hi VisualNOS guifg=#000000 guibg=#1994d1 gui=none
hi WarningMsg guifg=#c8c8c8 guibg=#a01010
hi WildMenu guifg=#ffffff guibg=#1994d1
hi Folded guifg=#969696 guibg=#f0f0f0
hi FoldColumn guifg=#969696 guibg=#f0f0f0
hi DiffAdd guibg=#deffcd
hi DiffChange guibg=#dad7ff
hi DiffDelete guifg=#c8c8c8 guibg=#ffffff gui=none
hi DiffText guifg=#ffffff guibg=#767396 gui=none
hi SignColumn guifg=#969696 guibg=#f0f0f0
hi SpellBad guifg=#000000 guibg=#fff5c3 guisp=#f01818 gui=undercurl
hi SpellCap guifg=#000000 guibg=#fff5c3 guisp=#14b9c8 gui=undercurl
hi SpellRare guifg=#000000 guibg=#fff5c3 guisp=#4cbe13 gui=undercurl
hi SpellLocal guifg=#000000 guibg=#fff5c3 guisp=#000000 gui=undercurl
hi Pmenu guifg=#ffffff guibg=#323232
hi PmenuSel guifg=#ffffff guibg=#1994d1
hi PmenuSbar guifg=#323232 guibg=#323232
hi PmenuThumb guifg=#646464 guibg=#646464 gui=none
hi TabLine guifg=#f0f0f0 guibg=#646464 gui=none
hi TabLineSel guifg=#ffffff guibg=#323232 gui=none
hi TabLineFill guifg=#646464 guibg=#646464 gui=none
hi CursorColumn guibg=#e1f5ff
hi CursorLine guibg=#e1f5ff gui=none
hi Cursor guifg=#ffffff guibg=#323232
hi lCursor guifg=#ffffff guibg=#004364
hi MatchParen guifg=#ffffff guibg=#f00078
hi Normal guifg=#323232 guibg=#ffffff
hi Comment guifg=#969696
hi Constant guifg=#1094a0
hi Special guifg=#dc6816
hi Identifier guifg=#3c960f
hi Statement guifg=#3b6ac8 gui=none
hi PreProc guifg=#294a8c
hi Type guifg=#a00050 gui=none
hi Underlined guifg=#323232 gui=underline
hi Ignore guifg=#c8c8c8
hi Error guifg=#ffffff guibg=#c81414
hi Todo guifg=#c81414 guibg=#ffffff

402
colors/bigbang.vim Executable file
View File

@ -0,0 +1,402 @@
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" ColorScheme: bigbang.vim
" Last Change: 2009-10-17 [17:01:53]
" Version: 125
" License: Public Domain, Free / Frei / Gratis / Libre.
" Author: Jaime Wottrich, <jaime.wottrich@gmail.com>
" Help: :h bigbang.vim
" :h bigbang-options
" :h bigbang-variants
" :h mimicpak
" :h mimicpak-options
"«««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
" Setup {{{1
"~~~~~~~
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let colors_name = "bigbang"
" Function: s:GetValue(var, ...) {{{2
" Looks up the value of a variable in this order (by default):
" buffer, window, tabpage and global.
" The one that exists first is returned, or 0 if none of them exists.
" Optional Args:
" a:1 value to return if variable doesn't exist.
" a:2 string with comma separated variable prefixes. Examples:
" "b:,t:,g:" - search for buffer, tabpage and global variables
" "w:,t:" - search for window and tabpage variables
" "g:" - search for global variables only
function s:GetValue(var, ...)
let l:defvalue = 0 < a:0 ? a:1 : 0
let l:prefixes = 1 < a:0 ? a:2 . "" : "b:,w:,t:,g:"
let l:start = 0
let l:i = stridx(l:prefixes, ",")
while 1
" track down the comma position, and handle special cases:
" - only one prefix without commas, and
" - after the last encountered comma.
let l:end = l:i < 0 ? strlen(l:prefixes) : l:i
let l:prefix = strpart(l:prefixes, l:start, l:end - l:start)
if exists(prefix . a:var)
return {prefix . a:var}
endif
" after last comma (or one prefix only without commas),
" and variable not found
if l:i < 0
return l:defvalue
endif
" update needle and get next comma position
let l:start = l:i + 1
let l:i = stridx(l:prefixes, ",", l:start)
endwhile
endfunction "}}}2
" get the values (if any) for the options
let s:mimic_font_style = s:GetValue("mimic_font_style")
let s:mimic_colorize_gui = s:GetValue("mimic_colorize_gui")
let s:mimic_bigbang_alt = s:GetValue("mimic_bigbang_alt")
let s:mimic_bigbang_dark = s:GetValue("mimic_bigbang_dark")
" cleanup
delfunction s:GetValue
" Default Highlight {{{1
if !s:mimic_bigbang_dark
if !s:mimic_bigbang_alt
hi Normal guifg=#68f8c8 guibg=#333333 gui=NONE ctermfg=cyan ctermbg=black cterm=NONE
else
hi Normal guifg=#68f8c8 guibg=#000078 gui=NONE ctermfg=cyan ctermbg=blue cterm=NONE
endif
else "darker colors, black and darkblue
if !s:mimic_bigbang_alt
hi Normal guifg=#68f8c8 guibg=#000000 gui=NONE ctermfg=cyan ctermbg=black cterm=NONE
else
hi Normal guifg=#68f8c8 guibg=#000040 gui=NONE ctermfg=cyan ctermbg=darkblue cterm=NONE
endif
endif
hi Cursor guifg=bg guibg=#68f868 gui=NONE ctermfg=bg ctermbg=green cterm=NONE
hi CursorIM guifg=bg guibg=#68c8f8 gui=NONE ctermfg=bg ctermbg=cyan cterm=NONE
hi MatchParen guifg=bg guibg=#68f8f8 gui=NONE ctermfg=bg ctermbg=cyan cterm=NONE
" search
hi Search guifg=#f9f999 guibg=#3333f9 gui=NONE ctermfg=black ctermbg=cyan cterm=NONE
hi IncSearch guifg=#000000 guibg=fg gui=NONE ctermfg=black ctermbg=fg cterm=NONE
" visual mode
if version < 700
hi LineNr guifg=#d8d8d8 guibg=bg gui=NONE ctermfg=grey ctermbg=bg cterm=NONE
hi Visual guifg=fg guibg=#007000 gui=NONE ctermfg=fg ctermbg=darkgreen cterm=NONE
hi VisualNOS guifg=fg guibg=#000070 gui=NONE ctermfg=bg ctermbg=darkcyan cterm=NONE
" diff
hi DiffAdd guifg=#000000 guibg=#68f868 gui=NONE ctermfg=black ctermbg=green cterm=NONE
hi DiffChange guifg=#000000 guibg=#68ccf8 gui=NONE ctermfg=grey ctermbg=blue cterm=NONE
hi DiffDelete guifg=#000000 guibg=#f8f868 gui=NONE ctermfg=black ctermbg=yellow cterm=NONE
hi DiffText guifg=#000000 guibg=#68f8f8 gui=NONE ctermfg=black ctermbg=cyan cterm=NONE
else
hi LineNr guifg=#d8d8d8 gui=NONE ctermfg=grey cterm=NONE
hi Visual guibg=#007000 gui=NONE ctermbg=darkgreen cterm=NONE
hi VisualNOS guibg=#000070 gui=NONE ctermbg=darkcyan cterm=NONE
" diff
hi DiffAdd guibg=#004800 gui=NONE ctermfg=black ctermbg=green cterm=NONE
hi DiffChange guibg=#0000a8 gui=NONE ctermfg=black ctermbg=blue cterm=NONE
hi DiffDelete guifg=bg guibg=#989800 gui=NONE ctermfg=black ctermbg=yellow cterm=NONE
hi DiffText guibg=#006888 gui=NONE ctermfg=black ctermbg=cyan cterm=NONE
endif
" line numbers and folding
hi NonText guifg=#f888f8 guibg=bg gui=NONE ctermfg=magenta ctermbg=bg cterm=NONE
if !s:mimic_bigbang_dark
" color for grey20 and blue {{{2
if !s:mimic_bigbang_alt
hi Folded guifg=#f888f8 guibg=#131313 gui=NONE ctermfg=magenta ctermbg=blue cterm=NONE
hi FoldColumn guifg=#38f8f8 guibg=#131313 gui=NONE ctermfg=cyan ctermbg=blue cterm=NONE
hi SignColumn guifg=#88f888 guibg=#131313 gui=NONE ctermfg=green ctermbg=blue cterm=NONE
" other text
hi SpecialKey guifg=#f8f888 guibg=#131313 gui=NONE ctermfg=yellow ctermbg=blue cterm=NONE
hi ModeMsg guifg=#88f888 guibg=#131313 gui=NONE ctermfg=green ctermbg=blue cterm=NONE
hi Title guifg=#d8d8d8 guibg=#131313 gui=NONE ctermfg=grey ctermbg=blue cterm=NONE
else
hi Folded guifg=#f888f8 guibg=#000040 gui=NONE ctermfg=magenta ctermbg=darkblue cterm=NONE
hi FoldColumn guifg=#38f8f8 guibg=#000040 gui=NONE ctermfg=cyan ctermbg=darkblue cterm=NONE
hi SignColumn guifg=#88f888 guibg=#000040 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
" other text
hi SpecialKey guifg=#f8f888 guibg=#000040 gui=NONE ctermfg=yellow ctermbg=darkblue cterm=NONE
hi ModeMsg guifg=#88f888 guibg=#000040 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Title guifg=#d8d8d8 guibg=#000040 gui=NONE ctermfg=grey ctermbg=darkblue cterm=NONE
endif "}}}2
else
" colors for black and darkblue {{{2
if !s:mimic_bigbang_alt
hi Folded guifg=#f888f8 guibg=#232323 gui=NONE ctermfg=magenta ctermbg=darkblue cterm=NONE
hi FoldColumn guifg=#38f8f8 guibg=#232323 gui=NONE ctermfg=cyan ctermbg=darkblue cterm=NONE
hi SignColumn guifg=#88f888 guibg=#232323 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
" other text
hi SpecialKey guifg=#f8f888 guibg=#232323 gui=NONE ctermfg=yellow ctermbg=darkblue cterm=NONE
hi ModeMsg guifg=#88f888 guibg=#232323 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Title guifg=#d8d8d8 guibg=#232323 gui=NONE ctermfg=grey ctermbg=darkblue cterm=NONE
else
hi Folded guifg=#f888f8 guibg=#000078 gui=NONE ctermfg=magenta ctermbg=black cterm=NONE
hi FoldColumn guifg=#38f8f8 guibg=#000078 gui=NONE ctermfg=cyan ctermbg=black cterm=NONE
hi SignColumn guifg=#88f888 guibg=#000078 gui=NONE ctermfg=green ctermbg=black cterm=NONE
" other text
hi SpecialKey guifg=#f888f8 guibg=#000078 gui=NONE ctermfg=yellow ctermbg=blue cterm=NONE
hi ModeMsg guifg=#88f888 guibg=#000098 gui=NONE ctermfg=green ctermbg=blue cterm=NONE
hi Title guifg=#d8d8d8 guibg=#000098 gui=NONE ctermfg=grey ctermbg=blue cterm=NONE
endif "}}}2
endif
" windows, statusline
hi StatusLine guifg=#000000 guibg=#38f8f8 gui=NONE ctermfg=bg ctermbg=cyan cterm=NONE
hi StatusLineNC guifg=#000000 guibg=#68f868 gui=NONE ctermfg=bg ctermbg=green cterm=NONE
hi VertSplit guifg=#000000 guibg=#68f868 gui=NONE ctermfg=bg ctermbg=green cterm=NONE
hi WildMenu guifg=fg guibg=bg gui=underline ctermfg=fg ctermbg=bg cterm=NONE
" colors for GUI
if 0 < s:mimic_colorize_gui
" will be set for everyone but Windows.
" Athena, Motif, Mac, Photon or GTK GUI.
if has("gui_running") && !(has("gui_win32") || has("gui_win32s"))
hi Menu guifg=fg guibg=bg
hi Scrollbar guifg=bg guibg=#88f8f8
hi Tooltip guifg=bg guibg=fg
endif
endif
" vim >= 7.0 only
if version >= 700
" tab pages
hi TabLine guifg=#000000 guibg=#38f8f8 gui=NONE ctermfg=black ctermbg=cyan cterm=NONE
hi TabLineFill guifg=#000000 guibg=#38f8f8 gui=NONE ctermfg=black ctermbg=cyan cterm=NONE
hi TabLineSel guifg=fg guibg=bg gui=underline ctermfg=fg ctermbg=bg cterm=NONE
if !s:mimic_bigbang_dark
" color for grey20 and blue {{{2
if !s:mimic_bigbang_alt
" current line, column
hi CursorLine guibg=#131313 gui=NONE ctermbg=blue cterm=NONE
hi CursorColumn guibg=#131313 gui=NONE ctermbg=blue cterm=NONE
else
" current line, column
hi CursorLine guibg=#000040 gui=NONE ctermbg=darkblue cterm=NONE
hi CursorColumn guibg=#000040 gui=NONE ctermbg=darkblue cterm=NONE
endif "}}}2
else
" color for black and darkblue {{{2
if !s:mimic_bigbang_alt
" current line, column
hi CursorLine guibg=#232323 gui=NONE ctermbg=darkblue cterm=NONE
hi CursorColumn guibg=#232323 gui=NONE ctermbg=darkblue cterm=NONE
else
" current line, column
hi CursorLine guibg=#000098 gui=NONE ctermbg=black cterm=NONE
hi CursorColumn guibg=#000098 gui=NONE ctermbg=black cterm=NONE
endif "}}}2
endif
" popup completion menu
hi Pmenu guifg=bg guibg=fg gui=NONE ctermfg=bg ctermbg=fg cterm=NONE
hi PmenuSel guifg=bg guibg=#88f888 gui=underline ctermfg=bg ctermbg=green cterm=NONE
hi PmenuSbar guifg=#38f868 guibg=#68f868 gui=NONE ctermfg=green ctermbg=green cterm=NONE
hi PmenuThumb guifg=#38f8f8 guibg=#38f8f8 gui=NONE ctermfg=cyan ctermbg=cyan cterm=NONE
" spell checking
hi SpellBad guisp=#f87878 gui=undercurl ctermfg=red ctermbg=yellow cterm=NONE
hi SpellCap guisp=#4888f8 gui=undercurl ctermfg=blue ctermbg=yellow cterm=NONE
hi SpellLocal guisp=#38f8f8 gui=undercurl ctermfg=cyan ctermbg=yellow cterm=NONE
hi SpellRare guisp=#f838f8 gui=undercurl ctermfg=magenta ctermbg=yellow cterm=NONE
endif
" other texts
hi Question guifg=#88f888 guibg=bg gui=NONE ctermfg=green ctermbg=bg cterm=NONE
hi WarningMsg guifg=bg guibg=#f8f888 gui=NONE ctermfg=bg ctermbg=yellow cterm=NONE
hi ErrorMsg guifg=#d8d8d8 guibg=#c80000 gui=NONE ctermfg=grey ctermbg=darkred cterm=NONE
hi Directory guifg=#88f888 guibg=bg gui=underline ctermfg=green ctermbg=bg cterm=NONE
hi MoreMsg guifg=#f8f888 guibg=bg gui=NONE ctermfg=yellow ctermbg=bg cterm=NONE
" Default Syntax Highlight {{{1
"~~~~~~~~~~~~~~~~~~~~~~~~~~
if !s:mimic_bigbang_dark
" colors for grey20 and blue {{{2
if !s:mimic_bigbang_alt
hi Statement guifg=#68f868 guibg=#131313 gui=NONE ctermfg=green ctermbg=blue cterm=NONE
hi Type guifg=#38f8f8 guibg=#131313 gui=NONE ctermfg=cyan ctermbg=blue cterm=NONE
hi PreProc guifg=#f888f8 guibg=#131313 gui=NONE ctermfg=magenta ctermbg=blue cterm=NONE
hi Special guifg=#f8f888 guibg=#131313 gui=NONE ctermfg=yellow ctermbg=blue cterm=NONE
hi Tag guifg=#68f868 guibg=#131313 gui=NONE ctermfg=green ctermbg=blue cterm=NONE
hi Delimiter guifg=#d8d8d8 guibg=#131313 gui=NONE ctermfg=grey ctermbg=blue cterm=NONE
else
hi Statement guifg=#68f868 guibg=#000040 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Type guifg=#38f8f8 guibg=#000040 gui=none ctermfg=cyan ctermbg=darkblue cterm=NONE
hi PreProc guifg=#f888f8 guibg=#000040 gui=NONE ctermfg=magenta ctermbg=darkblue cterm=NONE
hi Special guifg=#f8f888 guibg=#000040 gui=NONE ctermfg=yellow ctermbg=darkblue cterm=NONE
hi Tag guifg=#68f868 guibg=#000040 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Delimiter guifg=#d8d8d8 guibg=#000040 gui=NONE ctermfg=grey ctermbg=darkblue cterm=NONE
endif "}}}2
else
" colors for black and darkblue {{{2
if !s:mimic_bigbang_alt
hi Statement guifg=#68f868 guibg=#232323 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Type guifg=#38f8f8 guibg=#232323 gui=none ctermfg=cyan ctermbg=darkblue cterm=NONE
hi PreProc guifg=#f888f8 guibg=#232323 gui=NONE ctermfg=magenta ctermbg=darkblue cterm=NONE
hi Special guifg=#f8f888 guibg=#232323 gui=NONE ctermfg=yellow ctermbg=darkblue cterm=NONE
hi Tag guifg=#68f868 guibg=#232323 gui=NONE ctermfg=green ctermbg=darkblue cterm=NONE
hi Delimiter guifg=#d8d8d8 guibg=#232323 gui=NONE ctermfg=grey ctermbg=darkblue cterm=NONE
else
hi Statement guifg=#88f888 guibg=#000098 gui=NONE ctermfg=green ctermbg=black cterm=NONE
hi Type guifg=#38f8f8 guibg=#000098 gui=none ctermfg=cyan ctermbg=black cterm=NONE
hi PreProc guifg=#f888f8 guibg=#000098 gui=NONE ctermfg=magenta ctermbg=black cterm=NONE
hi Special guifg=#f8f888 guibg=#000098 gui=NONE ctermfg=yellow ctermbg=black cterm=NONE
hi Tag guifg=#88f888 guibg=#000098 gui=NONE ctermfg=green ctermbg=black cterm=NONE
hi Delimiter guifg=#d8d8d8 guibg=#000098 gui=NONE ctermfg=grey ctermbg=black cterm=NONE
endif "}}}2
endif
hi Comment guifg=#d8d8d8 guibg=bg gui=NONE ctermfg=grey ctermbg=bg cterm=NONE
hi link SpecialComment Comment
hi Constant guifg=#f8f888 guibg=bg gui=NONE ctermfg=yellow ctermbg=bg cterm=NONE
hi Character guifg=#f8f888 guibg=bg gui=NONE ctermfg=yellow ctermbg=bg cterm=NONE
hi String guifg=#f8f888 guibg=bg gui=NONE ctermfg=yellow ctermbg=bg cterm=NONE
hi link Number Constant
hi link Boolean Constant
hi link Float Constant
hi Identifier guifg=#88f888 guibg=bg gui=NONE ctermfg=green ctermbg=bg cterm=NONE
hi Function guifg=#88f888 guibg=bg gui=underline ctermfg=green ctermbg=bg cterm=NONE
hi link Conditional Statement
hi link Repeat Statement
hi link Label Statement
hi link Operator Statement
hi link Keyword Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link SpecialChar Special
hi Debug guifg=#f8f888 guibg=bg gui=NONE ctermfg=yellow ctermbg=bg cterm=NONE
hi Underlined guifg=#f8f888 guibg=bg gui=underline ctermfg=yellow ctermbg=darkmagenta cterm=NONE
hi Ignore guifg=bg guibg=bg gui=NONE ctermfg=bg ctermbg=bg cterm=NONE
hi Error guifg=#d8d8d8 guibg=#880000 gui=NONE ctermfg=white ctermbg=darkred cterm=NONE
hi Todo guifg=bg guibg=#88f888 gui=NONE ctermfg=bg ctermbg=fg cterm=NONE
" Non-Standard Syntax Groups {{{1
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" Vim help {{{2
hi! link Subtitle Function
" Dr. Chip's stuff {{{2
" Decho
if exists("g:loaded_Decho")
hi! link DechoBarHL Delimiter
hi! link Warning WarningMsg
endif
" Lisp {{{2
" Correct the FG and BG colors for the fancy Rainbow parenthesis.
if exists("g:lisp_rainbow") && 0 != g:lisp_rainbow
" set up BG color according to current one,
if !s:mimic_bigbang_dark
if !s:mimic_bigbang_alt
let s:guibg = "#131313"
let s:ctermbg = "blue"
else
" gvim=#000078, vim=blue
let s:guibg = "#000040"
let s:ctermbg = "darkblue"
endif
else
if !s:mimic_bigbang_alt
" gvim=#000000, vim=black
let s:guibg = "#232323"
let s:ctermbg = "darkblue"
else
" gvim=#000040, vim=darkblue
let s:guibg = "#000098"
let s:ctermbg = "black"
endif
endif
" Green and Cyan are used a lot for the syntax, so they will be in the last
" levels for the fg colors; and so the levels go from "Yellow" to "Green" in
" the GUI, and from "White" to "Cyan" in Console.
" Note: the cterm fg colors can't use Blue nor Darkblue, because they're
" already used for the background.
exe "hi hlLevel0 guifg=#ffff66 guibg=".s:guibg." ctermfg=white ctermbg=".s:ctermbg
exe "hi hlLevel1 guifg=#ffcc66 guibg=".s:guibg." ctermfg=yellow ctermbg=".s:ctermbg
exe "hi hlLevel2 guifg=#ff66cc guibg=".s:guibg." ctermfg=red ctermbg=".s:ctermbg
exe "hi hlLevel3 guifg=#ff66ff guibg=".s:guibg." ctermfg=magenta ctermbg=".s:ctermbg
exe "hi hlLevel4 guifg=#cc66ff guibg=".s:guibg." ctermfg=cyan ctermbg=".s:ctermbg
exe "hi hlLevel5 guifg=#6666ff guibg=".s:guibg." ctermfg=white ctermbg=".s:ctermbg
exe "hi hlLevel6 guifg=#66ccff guibg=".s:guibg." ctermfg=yellow ctermbg=".s:ctermbg
exe "hi hlLevel7 guifg=#66ffff guibg=".s:guibg." ctermfg=red ctermbg=".s:ctermbg
exe "hi hlLevel8 guifg=#66ffcc guibg=".s:guibg." ctermfg=magenta ctermbg=".s:ctermbg
exe "hi hlLevel9 guifg=#66ff66 guibg=".s:guibg." ctermfg=cyan ctermbg=".s:ctermbg
" cleanup
unlet s:guibg s:ctermbg
endif
" }}}1
" Font Style {{{1
"~~~~~~~~~~~~
if has("gui_running") && 0 < s:mimic_font_style
" Function: s:MultiHi(option, ...) {{{2
" Sets highlight option(s) on all its arguments.
" Parameters:
" option -- a string in the form of "key1=value1 key2=value2 ... keyN=valueN".
" ... -- the highlight group names.
function s:MultiHi(option, ...)
let l:i = 1
while l:i <= a:0
silent execute "hi " . a:{l:i} . " " . a:option
let l:i = l:i + 1
endwhile
endfunction "}}}2
" set the bold only options, including the "bold & italics" groups.
if 1 == s:mimic_font_style || 3 <= s:mimic_font_style
call s:MultiHi("gui=bold", "Directory", "StatusLine", "MoreMsg", "ModeMsg", "Title", "Constant", "Character", "Type", "Statement", "PreProc","Special", "Tag", "Delimiter", "Todo")
call s:MultiHi("gui=underline,bold", "WildMenu", "TablineSel", "Function")