remove old airline to move to pathogen
This commit is contained in:
@@ -1,172 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', [])
|
||||
|
||||
let s:sections = ['a','b','c','gutter','x','y','z','warning']
|
||||
let s:inactive_funcrefs = []
|
||||
|
||||
function! airline#add_statusline_func(name)
|
||||
call airline#add_statusline_funcref(function(a:name))
|
||||
endfunction
|
||||
|
||||
function! airline#add_statusline_funcref(function)
|
||||
if index(g:airline_statusline_funcrefs, a:function) >= 0
|
||||
echohl WarningMsg
|
||||
echo 'The airline statusline funcref '.string(a:function).' has already been added.'
|
||||
echohl NONE
|
||||
return
|
||||
endif
|
||||
call add(g:airline_statusline_funcrefs, a:function)
|
||||
endfunction
|
||||
|
||||
function! airline#remove_statusline_func(name)
|
||||
let i = index(g:airline_statusline_funcrefs, function(a:name))
|
||||
if i > -1
|
||||
call remove(g:airline_statusline_funcrefs, i)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#add_inactive_statusline_func(name)
|
||||
call add(s:inactive_funcrefs, function(a:name))
|
||||
endfunction
|
||||
|
||||
function! airline#load_theme()
|
||||
if exists('*airline#themes#{g:airline_theme}#refresh')
|
||||
call airline#themes#{g:airline_theme}#refresh()
|
||||
endif
|
||||
|
||||
let palette = g:airline#themes#{g:airline_theme}#palette
|
||||
call airline#themes#patch(palette)
|
||||
|
||||
if exists('g:airline_theme_patch_func')
|
||||
let Fn = function(g:airline_theme_patch_func)
|
||||
call Fn(palette)
|
||||
endif
|
||||
|
||||
call airline#highlighter#load_theme()
|
||||
call airline#extensions#load_theme()
|
||||
endfunction
|
||||
|
||||
function! airline#switch_theme(name)
|
||||
try
|
||||
let palette = g:airline#themes#{a:name}#palette "also lazy loads the theme
|
||||
let g:airline_theme = a:name
|
||||
catch
|
||||
echohl WarningMsg | echo 'The specified theme cannot be found.' | echohl NONE
|
||||
if exists('g:airline_theme')
|
||||
return
|
||||
else
|
||||
let g:airline_theme = 'dark'
|
||||
endif
|
||||
endtry
|
||||
|
||||
let w:airline_lastmode = ''
|
||||
call airline#update_statusline()
|
||||
call airline#load_theme()
|
||||
|
||||
" this is required to prevent clobbering the startup info message, i don't know why...
|
||||
call airline#check_mode(winnr())
|
||||
endfunction
|
||||
|
||||
function! airline#switch_matching_theme()
|
||||
if exists('g:colors_name')
|
||||
try
|
||||
let palette = g:airline#themes#{g:colors_name}#palette
|
||||
call airline#switch_theme(g:colors_name)
|
||||
return 1
|
||||
catch
|
||||
for map in items(g:airline_theme_map)
|
||||
if match(g:colors_name, map[0]) > -1
|
||||
call airline#switch_theme(map[1])
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
endtry
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! airline#update_statusline()
|
||||
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call setwinvar(nr, 'airline_active', 0)
|
||||
let context = { 'winnr': nr, 'active': 0, 'bufnr': winbufnr(nr) }
|
||||
call s:invoke_funcrefs(context, s:inactive_funcrefs)
|
||||
endfor
|
||||
|
||||
unlet! w:airline_render_left
|
||||
unlet! w:airline_render_right
|
||||
for section in s:sections
|
||||
unlet! w:airline_section_{section}
|
||||
endfor
|
||||
|
||||
let w:airline_active = 1
|
||||
let context = { 'winnr': winnr(), 'active': 1, 'bufnr': winbufnr(winnr()) }
|
||||
call s:invoke_funcrefs(context, g:airline_statusline_funcrefs)
|
||||
endfunction
|
||||
|
||||
let s:contexts = {}
|
||||
let s:core_funcrefs = [
|
||||
\ function('airline#extensions#apply'),
|
||||
\ function('airline#extensions#default#apply') ]
|
||||
function! s:invoke_funcrefs(context, funcrefs)
|
||||
let builder = airline#builder#new(a:context)
|
||||
let err = airline#util#exec_funcrefs(a:funcrefs + s:core_funcrefs, builder, a:context)
|
||||
if err == 1
|
||||
let a:context.line = builder.build()
|
||||
let s:contexts[a:context.winnr] = a:context
|
||||
call setwinvar(a:context.winnr, '&statusline', '%!airline#statusline('.a:context.winnr.')')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#statusline(winnr)
|
||||
if has_key(s:contexts, a:winnr)
|
||||
return '%{airline#check_mode('.a:winnr.')}'.s:contexts[a:winnr].line
|
||||
endif
|
||||
|
||||
" in rare circumstances this happens...see #276
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#check_mode(winnr)
|
||||
let context = s:contexts[a:winnr]
|
||||
|
||||
if get(w:, 'airline_active', 1)
|
||||
let l:m = mode()
|
||||
if l:m ==# "i"
|
||||
let l:mode = ['insert']
|
||||
elseif l:m ==# "R"
|
||||
let l:mode = ['replace']
|
||||
elseif l:m =~# '\v(v|V||s|S|)'
|
||||
let l:mode = ['visual']
|
||||
else
|
||||
let l:mode = ['normal']
|
||||
endif
|
||||
let w:airline_current_mode = get(g:airline_mode_map, l:m, l:m)
|
||||
else
|
||||
let l:mode = ['inactive']
|
||||
let w:airline_current_mode = get(g:airline_mode_map, '__')
|
||||
endif
|
||||
|
||||
if g:airline_detect_modified && &modified
|
||||
call add(l:mode, 'modified')
|
||||
endif
|
||||
|
||||
if g:airline_detect_paste && &paste
|
||||
call add(l:mode, 'paste')
|
||||
endif
|
||||
|
||||
if &readonly || ! &modifiable
|
||||
call add(l:mode, 'readonly')
|
||||
endif
|
||||
|
||||
let mode_string = join(l:mode)
|
||||
if get(w:, 'airline_lastmode', '') != mode_string
|
||||
call airline#highlighter#highlight_modified_inactive(context.bufnr)
|
||||
call airline#highlighter#highlight(l:mode)
|
||||
let w:airline_lastmode = mode_string
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:prototype = {}
|
||||
|
||||
function! s:prototype.split(...)
|
||||
call add(self._sections, ['|', a:0 ? a:1 : '%='])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section_spaced(group, contents)
|
||||
call self.add_section(a:group, (g:airline_symbols.space).a:contents.(g:airline_symbols.space))
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_section(group, contents)
|
||||
call add(self._sections, [a:group, a:contents])
|
||||
endfunction
|
||||
|
||||
function! s:prototype.add_raw(text)
|
||||
call add(self._sections, ['', a:text])
|
||||
endfunction
|
||||
|
||||
function! s:get_prev_group(sections, i)
|
||||
let x = a:i - 1
|
||||
while x >= 0
|
||||
let group = a:sections[x][0]
|
||||
if group != '' && group != '|'
|
||||
return group
|
||||
endif
|
||||
let x = x - 1
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:prototype.build()
|
||||
let side = 1
|
||||
let line = ''
|
||||
let i = 0
|
||||
let length = len(self._sections)
|
||||
let split = 0
|
||||
|
||||
while i < length
|
||||
let section = self._sections[i]
|
||||
let group = section[0]
|
||||
let contents = section[1]
|
||||
let prev_group = s:get_prev_group(self._sections, i)
|
||||
|
||||
if group == ''
|
||||
let line .= contents
|
||||
elseif group == '|'
|
||||
let side = 0
|
||||
let line .= contents
|
||||
let split = 1
|
||||
else
|
||||
if prev_group == ''
|
||||
let line .= '%#'.group.'#'
|
||||
elseif split
|
||||
let line .= s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
let split = 0
|
||||
else
|
||||
let line .= s:get_seperator(self, prev_group, group, side)
|
||||
endif
|
||||
let line .= s:get_accented_line(self, group, contents)
|
||||
endif
|
||||
|
||||
let i = i + 1
|
||||
endwhile
|
||||
|
||||
if !self._context.active
|
||||
let line = substitute(line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
endif
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:should_change_group(group1, group2)
|
||||
if a:group1 == a:group2
|
||||
return 0
|
||||
endif
|
||||
let color1 = airline#highlighter#get_highlight(a:group1)
|
||||
let color2 = airline#highlighter#get_highlight(a:group2)
|
||||
if has('gui_running')
|
||||
return color1[1] != color2[1] || color1[0] != color2[0]
|
||||
else
|
||||
return color1[3] != color2[3] || color1[2] != color2[2]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_transitioned_seperator(self, prev_group, group, side)
|
||||
let line = ''
|
||||
call airline#highlighter#add_separator(a:prev_group, a:group, a:side)
|
||||
let line .= '%#'.a:prev_group.'_to_'.a:group.'#'
|
||||
let line .= a:side ? a:self._context.left_sep : a:self._context.right_sep
|
||||
let line .= '%#'.a:group.'#'
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! s:get_seperator(self, prev_group, group, side)
|
||||
if s:should_change_group(a:prev_group, a:group)
|
||||
return s:get_transitioned_seperator(a:self, a:prev_group, a:group, a:side)
|
||||
else
|
||||
return a:side ? a:self._context.left_alt_sep : a:self._context.right_alt_sep
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_accented_line(self, group, contents)
|
||||
if a:self._context.active
|
||||
let contents = []
|
||||
let content_parts = split(a:contents, '__accent')
|
||||
for cpart in content_parts
|
||||
let accent = matchstr(cpart, '_\zs[^#]*\ze')
|
||||
call add(contents, cpart)
|
||||
endfor
|
||||
let line = join(contents, a:group)
|
||||
let line = substitute(line, '__restore__', a:group, 'g')
|
||||
else
|
||||
let line = substitute(a:contents, '%#__accent[^#]*#', '', 'g')
|
||||
let line = substitute(line, '%#__restore__#', '', 'g')
|
||||
endif
|
||||
return line
|
||||
endfunction
|
||||
|
||||
function! airline#builder#new(context)
|
||||
let builder = copy(s:prototype)
|
||||
let builder._context = a:context
|
||||
let builder._sections = []
|
||||
|
||||
call extend(builder._context, {
|
||||
\ 'left_sep': g:airline_left_sep,
|
||||
\ 'left_alt_sep': g:airline_left_alt_sep,
|
||||
\ 'right_sep': g:airline_right_sep,
|
||||
\ 'right_alt_sep': g:airline_right_alt_sep,
|
||||
\ }, 'keep')
|
||||
return builder
|
||||
endfunction
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#debug#profile1()
|
||||
profile start airline-profile-switch.log
|
||||
profile func *
|
||||
profile file *
|
||||
split
|
||||
for i in range(1, 1000)
|
||||
wincmd w
|
||||
redrawstatus
|
||||
endfor
|
||||
profile pause
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
function! airline#debug#profile2()
|
||||
profile start airline-profile-cursor.log
|
||||
profile func *
|
||||
profile file *
|
||||
edit blank
|
||||
call setline(1, 'all your base are belong to us')
|
||||
call setline(2, 'all your base are belong to us')
|
||||
let positions = [[1,2], [2,2], [1,2], [1,1]]
|
||||
for i in range(1, 1000)
|
||||
for pos in positions
|
||||
call cursor(pos[0], pos[1])
|
||||
redrawstatus
|
||||
endfor
|
||||
endfor
|
||||
profile pause
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
function! airline#debug#profile3()
|
||||
profile start airline-profile-mode.log
|
||||
profile func *
|
||||
profile file *
|
||||
|
||||
for i in range(1000)
|
||||
startinsert
|
||||
redrawstatus
|
||||
stopinsert
|
||||
redrawstatus
|
||||
endfor
|
||||
|
||||
profile pause
|
||||
noautocmd qall!
|
||||
endfunction
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#deprecation#check()
|
||||
if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix')
|
||||
echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables are obsolete. Please read the documentation about the branch extension.'
|
||||
endif
|
||||
|
||||
let tests = [
|
||||
\ [ 'g:airline_paste_symbol', 'g:airline_symbols.paste' ],
|
||||
\ [ 'g:airline_readonly_symbol', 'g:airline_symbols.readonly' ],
|
||||
\ [ 'g:airline_linecolumn_prefix', 'g:airline_symbols.linenr' ],
|
||||
\ [ 'g:airline_branch_prefix', 'g:airline_symbols.branch' ],
|
||||
\ [ 'g:airline_branch_empty_message', 'g:airline#extensions#branch#empty_message' ],
|
||||
\ [ 'g:airline_detect_whitespace', 'g:airline#extensions#whitespace#enabled|show_message' ],
|
||||
\ [ 'g:airline_enable_hunks', 'g:airline#extensions#hunks#enabled' ],
|
||||
\ [ 'g:airline_enable_tagbar', 'g:airline#extensions#tagbar#enabled' ],
|
||||
\ [ 'g:airline_enable_csv', 'g:airline#extensions#csv#enabled' ],
|
||||
\ [ 'g:airline_enable_branch', 'g:airline#extensions#branch#enabled' ],
|
||||
\ [ 'g:airline_enable_bufferline', 'g:airline#extensions#bufferline#enabled' ],
|
||||
\ [ 'g:airline_enable_syntastic', 'g:airline#extensions#syntastic#enabled' ],
|
||||
\ [ 'g:airline_enable_eclim', 'g:airline#extensions#eclim#enabled' ],
|
||||
\ ]
|
||||
for test in tests
|
||||
if exists(test[0])
|
||||
let max = winwidth(0) - 16
|
||||
let msg = printf('The variable %s is deprecated and may not work in the future. It has been replaced with %s. Please read the documentation.', test[0], test[1])
|
||||
echom msg[:max].'...'
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,242 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:ext = {}
|
||||
let s:ext._theme_funcrefs = []
|
||||
|
||||
function! s:ext.add_statusline_func(name) dict
|
||||
call airline#add_statusline_func(a:name)
|
||||
endfunction
|
||||
function! s:ext.add_statusline_funcref(function) dict
|
||||
call airline#add_statusline_funcref(a:function)
|
||||
endfunction
|
||||
function! s:ext.add_inactive_statusline_func(name) dict
|
||||
call airline#add_inactive_statusline_func(a:name)
|
||||
endfunction
|
||||
function! s:ext.add_theme_func(name) dict
|
||||
call add(self._theme_funcrefs, function(a:name))
|
||||
endfunction
|
||||
|
||||
let s:script_path = tolower(resolve(expand('<sfile>:p:h')))
|
||||
|
||||
let s:filetype_overrides = {
|
||||
\ 'nerdtree': [ 'NERD', '' ],
|
||||
\ 'gundo': [ 'Gundo', '' ],
|
||||
\ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ],
|
||||
\ 'minibufexpl': [ 'MiniBufExplorer', '' ],
|
||||
\ 'startify': [ 'startify', '' ],
|
||||
\ 'vim-plug': [ 'Plugins', '' ],
|
||||
\ }
|
||||
|
||||
let s:filetype_regex_overrides = {}
|
||||
|
||||
function! s:check_defined_section(name)
|
||||
if !exists('w:airline_section_{a:name}')
|
||||
let w:airline_section_{a:name} = g:airline_section_{a:name}
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#append_to_section(name, value)
|
||||
call <sid>check_defined_section(a:name)
|
||||
let w:airline_section_{a:name} .= a:value
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#prepend_to_section(name, value)
|
||||
call <sid>check_defined_section(a:name)
|
||||
let w:airline_section_{a:name} = a:value . w:airline_section_{a:name}
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#apply_left_override(section1, section2)
|
||||
let w:airline_section_a = a:section1
|
||||
let w:airline_section_b = a:section2
|
||||
let w:airline_section_c = airline#section#create(['readonly'])
|
||||
let w:airline_render_left = 1
|
||||
let w:airline_render_right = 0
|
||||
endfunction
|
||||
|
||||
let s:active_winnr = -1
|
||||
function! airline#extensions#apply(...)
|
||||
let s:active_winnr = winnr()
|
||||
|
||||
if s:is_excluded_window()
|
||||
return -1
|
||||
endif
|
||||
|
||||
if &buftype == 'help'
|
||||
call airline#extensions#apply_left_override('Help', '%f')
|
||||
let w:airline_section_x = ''
|
||||
let w:airline_section_y = ''
|
||||
let w:airline_render_right = 1
|
||||
endif
|
||||
|
||||
if &previewwindow
|
||||
let w:airline_section_a = 'Preview'
|
||||
let w:airline_section_b = ''
|
||||
let w:airline_section_c = bufname(winbufnr(winnr()))
|
||||
endif
|
||||
|
||||
if has_key(s:filetype_overrides, &ft)
|
||||
let args = s:filetype_overrides[&ft]
|
||||
call airline#extensions#apply_left_override(args[0], args[1])
|
||||
endif
|
||||
|
||||
for item in items(s:filetype_regex_overrides)
|
||||
if match(&ft, item[0]) >= 0
|
||||
call airline#extensions#apply_left_override(item[1][0], item[1][1])
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! s:is_excluded_window()
|
||||
for matchft in g:airline_exclude_filetypes
|
||||
if matchft ==# &ft
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
for matchw in g:airline_exclude_filenames
|
||||
if matchstr(expand('%'), matchw) ==# matchw
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if g:airline_exclude_preview && &previewwindow
|
||||
return 1
|
||||
endif
|
||||
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#load_theme()
|
||||
call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette)
|
||||
endfunction
|
||||
|
||||
function! s:sync_active_winnr()
|
||||
if exists('#airline') && winnr() != s:active_winnr
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#load()
|
||||
" non-trivial number of external plugins use eventignore=all, so we need to account for that
|
||||
autocmd CursorMoved * call <sid>sync_active_winnr()
|
||||
|
||||
call airline#extensions#quickfix#init(s:ext)
|
||||
|
||||
if get(g:, 'loaded_unite', 0)
|
||||
call airline#extensions#unite#init(s:ext)
|
||||
endif
|
||||
|
||||
if exists(':NetrwSettings')
|
||||
call airline#extensions#netrw#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_vimfiler', 0)
|
||||
let g:vimfiler_force_overwrite_statusline = 0
|
||||
endif
|
||||
|
||||
if get(g:, 'loaded_ctrlp', 0)
|
||||
call airline#extensions#ctrlp#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'command_t_loaded', 0)
|
||||
call airline#extensions#commandt#init(s:ext)
|
||||
endif
|
||||
|
||||
if exists(':UndotreeToggle')
|
||||
call airline#extensions#undotree#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#hunks#enabled', 1) && get(g:, 'airline_enable_hunks', 1))
|
||||
\ && (exists('g:loaded_signify') || exists('g:loaded_gitgutter') || exists('g:loaded_changes'))
|
||||
call airline#extensions#hunks#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#tagbar#enabled', 1) && get(g:, 'airline_enable_tagbar', 1))
|
||||
\ && exists(':TagbarToggle')
|
||||
call airline#extensions#tagbar#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#csv#enabled', 1) && get(g:, 'airline_enable_csv', 1))
|
||||
\ && (get(g:, 'loaded_csv', 0) || exists(':Table'))
|
||||
call airline#extensions#csv#init(s:ext)
|
||||
endif
|
||||
|
||||
if exists(':VimShell')
|
||||
let s:filetype_overrides['vimshell'] = ['vimshell','%{vimshell#get_status_string()}']
|
||||
let s:filetype_regex_overrides['^int-'] = ['vimshell','%{substitute(&ft, "int-", "", "")}']
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#branch#enabled', 1) && get(g:, 'airline_enable_branch', 1))
|
||||
\ && (exists('*fugitive#head') || exists('*lawrencium#statusline') ||
|
||||
\ (get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')))
|
||||
call airline#extensions#branch#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#bufferline#enabled', 1) && get(g:, 'airline_enable_bufferline', 1))
|
||||
\ && exists('*bufferline#get_status_string')
|
||||
call airline#extensions#bufferline#init(s:ext)
|
||||
endif
|
||||
|
||||
if isdirectory($VIRTUAL_ENV) && get(g:, 'airline#extensions#virtualenv#enabled', 1)
|
||||
call airline#extensions#virtualenv#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#eclim#enabled', 1) && exists(':ProjectCreate'))
|
||||
call airline#extensions#eclim#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#syntastic#enabled', 1) && get(g:, 'airline_enable_syntastic', 1))
|
||||
\ && exists(':SyntasticCheck')
|
||||
call airline#extensions#syntastic#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1))
|
||||
call airline#extensions#whitespace#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tabline#enabled', 0)
|
||||
call airline#extensions#tabline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#tmuxline#enabled', 1) && exists(':Tmuxline')
|
||||
call airline#extensions#tmuxline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#promptline#enabled', 1) && exists(':PromptlineSnapshot') && len(get(g:, 'airline#extensions#promptline#snapshot_file', ''))
|
||||
call airline#extensions#promptline#init(s:ext)
|
||||
endif
|
||||
|
||||
if get(g:, 'airline#extensions#nrrwrgn#enabled', 1) && exists(':NR') == 2
|
||||
call airline#extensions#nrrwrgn#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#capslock#enabled', 1) && exists('*CapsLockStatusline'))
|
||||
call airline#extensions#capslock#init(s:ext)
|
||||
endif
|
||||
|
||||
if (get(g:, 'airline#extensions#windowswap#enabled', 1) && get(g:, 'loaded_windowswap', 0))
|
||||
call airline#extensions#windowswap#init(s:ext)
|
||||
endif
|
||||
|
||||
if !get(g:, 'airline#extensions#disable_rtp_load', 0)
|
||||
" load all other extensions, which are not part of the default distribution.
|
||||
" (autoload/airline/extensions/*.vim outside of our s:script_path).
|
||||
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n")
|
||||
" we have to check both resolved and unresolved paths, since it's possible
|
||||
" that they might not get resolved properly (see #187)
|
||||
if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0
|
||||
\ && stridx(tolower(fnamemodify(file, ':p')), s:script_path) < 0
|
||||
let name = fnamemodify(file, ':t:r')
|
||||
if !get(g:, 'airline#extensions#'.name.'#enabled', 1)
|
||||
continue
|
||||
endif
|
||||
try
|
||||
call airline#extensions#{name}#init(s:ext)
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:has_fugitive = exists('*fugitive#head')
|
||||
let s:has_lawrencium = exists('*lawrencium#statusline')
|
||||
let s:has_vcscommand = get(g:, 'airline#extensions#branch#use_vcscommand', 0) && exists('*VCSCommandGetStatusLine')
|
||||
|
||||
if !s:has_fugitive && !s:has_lawrencium && !s:has_vcscommand
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:git_dirs = {}
|
||||
function! s:get_git_branch(path)
|
||||
if has_key(s:git_dirs, a:path)
|
||||
return s:git_dirs[a:path]
|
||||
endif
|
||||
|
||||
let dir = fugitive#extract_git_dir(a:path)
|
||||
if empty(dir)
|
||||
let name = ''
|
||||
else
|
||||
try
|
||||
let line = join(readfile(dir . '/HEAD'))
|
||||
if strpart(line, 0, 16) == 'ref: refs/heads/'
|
||||
let name = strpart(line, 16)
|
||||
else
|
||||
" raw commit hash
|
||||
let name = strpart(line, 0, 7)
|
||||
endif
|
||||
catch
|
||||
let name = ''
|
||||
endtry
|
||||
endif
|
||||
|
||||
let s:git_dirs[a:path] = name
|
||||
return name
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#head()
|
||||
if exists('b:airline_head') && !empty(b:airline_head)
|
||||
return b:airline_head
|
||||
endif
|
||||
|
||||
let b:airline_head = ''
|
||||
let found_fugitive_head = 0
|
||||
|
||||
if s:has_fugitive && !exists('b:mercurial_dir')
|
||||
let b:airline_head = fugitive#head(7)
|
||||
let found_fugitive_head = 1
|
||||
|
||||
if empty(b:airline_head) && !exists('b:git_dir')
|
||||
let b:airline_head = s:get_git_branch(expand("%:p:h"))
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head)
|
||||
if s:has_lawrencium
|
||||
let b:airline_head = lawrencium#statusline()
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head)
|
||||
if s:has_vcscommand
|
||||
call VCSCommandEnableBufferSetup()
|
||||
if exists('b:VCSCommandBufferInfo')
|
||||
let b:airline_head = get(b:VCSCommandBufferInfo, 0, '')
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(b:airline_head) || !found_fugitive_head && !s:check_in_path()
|
||||
let b:airline_head = ''
|
||||
endif
|
||||
|
||||
if exists("g:airline#extensions#branch#displayed_head_limit")
|
||||
let w:displayed_head_limit = g:airline#extensions#branch#displayed_head_limit
|
||||
if len(b:airline_head) > w:displayed_head_limit - 1
|
||||
let b:airline_head = b:airline_head[0:w:displayed_head_limit - 1].'…'
|
||||
endif
|
||||
endif
|
||||
|
||||
return b:airline_head
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#get_head()
|
||||
let head = airline#extensions#branch#head()
|
||||
let empty_message = get(g:, 'airline#extensions#branch#empty_message',
|
||||
\ get(g:, 'airline_branch_empty_message', ''))
|
||||
let symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch)
|
||||
return empty(head)
|
||||
\ ? empty_message
|
||||
\ : printf('%s%s', empty(symbol) ? '' : symbol.(g:airline_symbols.space), head)
|
||||
endfunction
|
||||
|
||||
function! s:check_in_path()
|
||||
if !exists('b:airline_branch_path')
|
||||
let root = get(b:, 'git_dir', get(b:, 'mercurial_dir', ''))
|
||||
let bufferpath = resolve(fnamemodify(expand('%'), ':p'))
|
||||
|
||||
if !filereadable(root) "not a file
|
||||
" if .git is a directory, it's the old submodule format
|
||||
if match(root, '\.git$') >= 0
|
||||
let root = expand(fnamemodify(root, ':h'))
|
||||
else
|
||||
" else it's the newer format, and we need to guesstimate
|
||||
let pattern = '\.git\(\\\|\/\)modules\(\\\|\/\)'
|
||||
if match(root, pattern) >= 0
|
||||
let root = substitute(root, pattern, '', '')
|
||||
endif
|
||||
endif
|
||||
|
||||
let b:airline_file_in_root = stridx(bufferpath, root) > -1
|
||||
endif
|
||||
return b:airline_file_in_root
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#branch#init(ext)
|
||||
call airline#parts#define_function('branch', 'airline#extensions#branch#get_head')
|
||||
|
||||
autocmd BufReadPost * unlet! b:airline_file_in_root
|
||||
autocmd CursorHold,ShellCmdPost,CmdwinLeave * unlet! b:airline_head
|
||||
endfunction
|
||||
@@ -1,23 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists('*bufferline#get_status_string')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1)
|
||||
|
||||
function! airline#extensions#bufferline#init(ext)
|
||||
if s:overwrite
|
||||
highlight bufferline_selected gui=bold cterm=bold term=bold
|
||||
highlight link bufferline_selected_inactive airline_c_inactive
|
||||
let g:bufferline_inactive_highlight = 'airline_c'
|
||||
let g:bufferline_active_highlight = 'bufferline_selected'
|
||||
let g:bufferline_active_buffer_left = ''
|
||||
let g:bufferline_active_buffer_right = ''
|
||||
let g:bufferline_separator = g:airline_symbols.space
|
||||
endif
|
||||
|
||||
call airline#parts#define_raw('file', '%{bufferline#refresh_status()}'.bufferline#get_status_string())
|
||||
endfunction
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
" MIT License. Copyright (c) 2014 Mathias Andersson.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
if !exists('*CapsLockStatusline')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#capslock#status()
|
||||
return CapsLockStatusline() == '[caps]' ? 'CAPS' : ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#capslock#init(ext)
|
||||
call airline#parts#define_function('capslock', 'airline#extensions#capslock#status')
|
||||
endfunction
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'command_t_loaded', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#commandt#apply(...)
|
||||
if bufname('%') ==# 'GoToFile'
|
||||
call airline#extensions#apply_left_override('CommandT', '')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#commandt#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#commandt#apply')
|
||||
endfunction
|
||||
@@ -1,31 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_csv', 0) && !exists(':Table')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:column_display = get(g:, 'airline#extensions#csv#column_display', 'Number')
|
||||
|
||||
function! airline#extensions#csv#get_column()
|
||||
if exists('*CSV_WCol')
|
||||
if s:column_display ==# 'Name'
|
||||
return '['.CSV_WCol('Name').CSV_WCol().']'
|
||||
else
|
||||
return '['.CSV_WCol().']'
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#csv#apply(...)
|
||||
if &ft ==# "csv"
|
||||
call airline#extensions#prepend_to_section('gutter',
|
||||
\ g:airline_left_alt_sep.' %{airline#extensions#csv#get_column()}')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#csv#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#csv#apply')
|
||||
endfunction
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:color_template = get(g:, 'airline#extensions#ctrlp#color_template', 'insert')
|
||||
|
||||
function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
|
||||
return {
|
||||
\ 'CtrlPdark' : a:dark,
|
||||
\ 'CtrlPlight' : a:light,
|
||||
\ 'CtrlPwhite' : a:white,
|
||||
\ 'CtrlParrow1' : [ a:light[1] , a:white[1] , a:light[3] , a:white[3] , '' ] ,
|
||||
\ 'CtrlParrow2' : [ a:white[1] , a:light[1] , a:white[3] , a:light[3] , '' ] ,
|
||||
\ 'CtrlParrow3' : [ a:light[1] , a:dark[1] , a:light[3] , a:dark[3] , '' ] ,
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#load_theme(palette)
|
||||
if exists('a:palette.ctrlp')
|
||||
let theme = a:palette.ctrlp
|
||||
else
|
||||
let s:color_template = has_key(a:palette, s:color_template) ? s:color_template : 'insert'
|
||||
let theme = airline#extensions#ctrlp#generate_color_map(
|
||||
\ a:palette[s:color_template]['airline_c'],
|
||||
\ a:palette[s:color_template]['airline_b'],
|
||||
\ a:palette[s:color_template]['airline_a'])
|
||||
endif
|
||||
for key in keys(theme)
|
||||
call airline#highlighter#exec(key, theme[key])
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Arguments: focus, byfname, regexp, prv, item, nxt, marked
|
||||
function! airline#extensions#ctrlp#ctrlp_airline(...)
|
||||
let b = airline#builder#new({'active': 1})
|
||||
if a:2 == 'file'
|
||||
call b.add_section_spaced('CtrlPlight', 'by fname')
|
||||
endif
|
||||
if a:3
|
||||
call b.add_section_spaced('CtrlPlight', 'regex')
|
||||
endif
|
||||
if get(g:, 'airline#extensions#ctrlp#show_adjacent_modes', 1)
|
||||
call b.add_section_spaced('CtrlPlight', a:4)
|
||||
call b.add_section_spaced('CtrlPwhite', a:5)
|
||||
call b.add_section_spaced('CtrlPlight', a:6)
|
||||
else
|
||||
call b.add_section_spaced('CtrlPwhite', a:5)
|
||||
endif
|
||||
call b.add_section_spaced('CtrlPdark', a:7)
|
||||
call b.split()
|
||||
call b.add_section_spaced('CtrlPdark', a:1)
|
||||
call b.add_section_spaced('CtrlPdark', a:2)
|
||||
call b.add_section_spaced('CtrlPlight', '%{getcwd()}')
|
||||
return b.build()
|
||||
endfunction
|
||||
|
||||
" Argument: len
|
||||
function! airline#extensions#ctrlp#ctrlp_airline_status(...)
|
||||
let len = '%#CtrlPdark# '.a:1
|
||||
let dir = '%=%<%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
|
||||
return len.dir
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#apply(...)
|
||||
" disable statusline overwrite if ctrlp already did it
|
||||
return match(&statusline, 'CtrlPwhite') >= 0 ? -1 : 0
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#ctrlp#init(ext)
|
||||
let g:ctrlp_status_func = {
|
||||
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
|
||||
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
|
||||
\ }
|
||||
call a:ext.add_statusline_func('airline#extensions#ctrlp#apply')
|
||||
call a:ext.add_theme_func('airline#extensions#ctrlp#load_theme')
|
||||
endfunction
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:section_truncate_width = get(g:, 'airline#extensions#default#section_truncate_width', {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ })
|
||||
let s:layout = get(g:, 'airline#extensions#default#layout', [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ])
|
||||
|
||||
function! s:get_section(winnr, key, ...)
|
||||
if has_key(s:section_truncate_width, a:key)
|
||||
if winwidth(a:winnr) < s:section_truncate_width[a:key]
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
let spc = g:airline_symbols.space
|
||||
let text = airline#util#getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key})
|
||||
let [prefix, suffix] = [get(a:000, 0, '%('.spc), get(a:000, 1, spc.'%)')]
|
||||
return empty(text) ? '' : prefix.text.suffix
|
||||
endfunction
|
||||
|
||||
function! s:build_sections(builder, context, keys)
|
||||
for key in a:keys
|
||||
if key == 'warning' && !a:context.active
|
||||
continue
|
||||
endif
|
||||
call s:add_section(a:builder, a:context, key)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
if v:version >= 704 || (v:version >= 703 && has('patch81'))
|
||||
function s:add_section(builder, context, key)
|
||||
" i have no idea why the warning section needs special treatment, but it's
|
||||
" needed to prevent separators from showing up
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%(')
|
||||
endif
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%)')
|
||||
endif
|
||||
endfunction
|
||||
else
|
||||
" older version don't like the use of %(%)
|
||||
function s:add_section(builder, context, key)
|
||||
if a:key == 'warning'
|
||||
call a:builder.add_raw('%#airline_warning#'.s:get_section(a:context.winnr, a:key))
|
||||
else
|
||||
call a:builder.add_section('airline_'.a:key, s:get_section(a:context.winnr, a:key))
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! airline#extensions#default#apply(builder, context)
|
||||
let winnr = a:context.winnr
|
||||
let active = a:context.active
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_left', active || (!active && !g:airline_inactive_collapse))
|
||||
call s:build_sections(a:builder, a:context, s:layout[0])
|
||||
else
|
||||
let text = s:get_section(winnr, 'c')
|
||||
if empty(text)
|
||||
let text = ' %f%m '
|
||||
endif
|
||||
call a:builder.add_section('airline_c'.(a:context.bufnr), text)
|
||||
endif
|
||||
|
||||
call a:builder.split(s:get_section(winnr, 'gutter', '', ''))
|
||||
|
||||
if airline#util#getwinvar(winnr, 'airline_render_right', 1)
|
||||
call s:build_sections(a:builder, a:context, s:layout[1])
|
||||
endif
|
||||
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':ProjectCreate')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#eclim#creat_line(...)
|
||||
if &filetype == "tree"
|
||||
let builder = a:1
|
||||
call builder.add_section('airline_a', ' Project ')
|
||||
call builder.add_section('airline_b', ' %f ')
|
||||
call builder.add_section('airline_c', '')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#get_warnings()
|
||||
let eclimList = eclim#display#signs#GetExisting()
|
||||
|
||||
if !empty(eclimList)
|
||||
" Remove any non-eclim signs (see eclim#display#signs#Update)
|
||||
" First check for just errors since they are more important.
|
||||
" If there are no errors, then check for warnings.
|
||||
let errorList = filter(copy(eclimList), 'v:val.name =~ "^\\(qf_\\)\\?\\(error\\)$"')
|
||||
|
||||
if (empty(errorList))
|
||||
" use the warnings
|
||||
call filter(eclimList, 'v:val.name =~ "^\\(qf_\\)\\?\\(warning\\)$"')
|
||||
let type = 'W'
|
||||
else
|
||||
" Use the errors
|
||||
let eclimList = errorList
|
||||
let type = 'E'
|
||||
endif
|
||||
|
||||
if !empty(eclimList)
|
||||
let errorsLine = eclimList[0]['line']
|
||||
let errorsNumber = len(eclimList)
|
||||
let errors = "[Eclim:" . type . " line:".string(errorsLine)." (".string(errorsNumber).")]"
|
||||
if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == ''
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#eclim#init(ext)
|
||||
call airline#parts#define_function('eclim', 'airline#extensions#eclim#get_warnings')
|
||||
call a:ext.add_statusline_func('airline#extensions#eclim#creat_line')
|
||||
endfunction
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" we don't actually want this loaded :P
|
||||
finish
|
||||
|
||||
" Due to some potential rendering issues, the use of the `space` variable is
|
||||
" recommended.
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
" Extension specific variables can be defined the usual fashion.
|
||||
if !exists('g:airline#extensions#example#number_of_cats')
|
||||
let g:airline#extensions#example#number_of_cats = 42
|
||||
endif
|
||||
|
||||
" First we define an init function that will be invoked from extensions.vim
|
||||
function! airline#extensions#example#init(ext)
|
||||
|
||||
" Here we define a new part for the plugin. This allows users to place this
|
||||
" extension in arbitrary locations.
|
||||
call airline#parts#define_raw('cats', '%{airline#extensions#example#get_cats()}')
|
||||
|
||||
" Next up we add a funcref so that we can run some code prior to the
|
||||
" statusline getting modifed.
|
||||
call a:ext.add_statusline_func('airline#extensions#example#apply')
|
||||
|
||||
" You can also add a funcref for inactive statuslines.
|
||||
" call a:ext.add_inactive_statusline_func('airline#extensions#example#unapply')
|
||||
endfunction
|
||||
|
||||
" This function will be invoked just prior to the statusline getting modified.
|
||||
function! airline#extensions#example#apply(...)
|
||||
" First we check for the filetype.
|
||||
if &filetype == "nyancat"
|
||||
|
||||
" Let's say we want to append to section_c, first we check if there's
|
||||
" already a window-local override, and if not, create it off of the global
|
||||
" section_c.
|
||||
let w:airline_section_c = get(w:, 'airline_section_c', g:airline_section_c)
|
||||
|
||||
" Then we just append this extenion to it, optionally using separators.
|
||||
let w:airline_section_c .= s:spc.g:airline_left_alt_sep.s:spc.'%{airline#extensions#example#get_cats()}'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Finally, this function will be invoked from the statusline.
|
||||
function! airline#extensions#example#get_cats()
|
||||
let cats = ''
|
||||
for i in range(1, g:airline#extensions#example#number_of_cats)
|
||||
let cats .= ' (,,,)=(^.^)=(,,,) '
|
||||
endfor
|
||||
return cats
|
||||
endfunction
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 0) && !get(g:, 'loaded_changes', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:non_zero_only = get(g:, 'airline#extensions#hunks#non_zero_only', 0)
|
||||
let s:hunk_symbols = get(g:, 'airline#extensions#hunks#hunk_symbols', ['+', '~', '-'])
|
||||
|
||||
function! s:get_hunks_signify()
|
||||
let hunks = sy#repo#get_stats()
|
||||
if hunks[0] >= 0
|
||||
return hunks
|
||||
endif
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! s:is_branch_empty()
|
||||
return exists('*airline#extensions#branch#head') && empty(airline#extensions#branch#head())
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_gitgutter()
|
||||
if !get(g:, 'gitgutter_enabled', 0) || s:is_branch_empty()
|
||||
return ''
|
||||
endif
|
||||
return GitGutterGetHunkSummary()
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_changes()
|
||||
if !get(b:, 'changes_view_enabled', 0) || s:is_branch_empty()
|
||||
return []
|
||||
endif
|
||||
let hunks = changes#GetStats()
|
||||
for i in hunks
|
||||
if i > 0
|
||||
return hunks
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! s:get_hunks_empty()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
let s:source_func = ''
|
||||
function! s:get_hunks()
|
||||
if empty(s:source_func)
|
||||
if get(g:, 'loaded_signify', 0)
|
||||
let s:source_func = 's:get_hunks_signify'
|
||||
elseif exists('*GitGutterGetHunkSummary')
|
||||
let s:source_func = 's:get_hunks_gitgutter'
|
||||
elseif exists('*changes#GetStats')
|
||||
let s:source_func = 's:get_hunks_changes'
|
||||
else
|
||||
let s:source_func = 's:get_hunks_empty'
|
||||
endif
|
||||
endif
|
||||
return {s:source_func}()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#get_hunks()
|
||||
if !get(w:, 'airline_active', 0)
|
||||
return ''
|
||||
endif
|
||||
let hunks = s:get_hunks()
|
||||
let string = ''
|
||||
if !empty(hunks)
|
||||
for i in [0, 1, 2]
|
||||
if s:non_zero_only == 0 || hunks[i] > 0
|
||||
let string .= printf('%s%s ', s:hunk_symbols[i], hunks[i])
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
return string
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#hunks#init(ext)
|
||||
call airline#parts#define_function('hunks', 'airline#extensions#hunks#get_hunks')
|
||||
endfunction
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':NetrwSettings')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#netrw#apply(...)
|
||||
if &ft == 'netrw'
|
||||
let spc = g:airline_symbols.space
|
||||
|
||||
call a:1.add_section('airline_a', spc.'netrw'.spc)
|
||||
if exists('*airline#extensions#branch#get_head')
|
||||
call a:1.add_section('airline_b', spc.'%{airline#extensions#branch#get_head()}'.spc)
|
||||
endif
|
||||
call a:1.add_section('airline_c', spc.'%f'.spc)
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', spc.'%{airline#extensions#netrw#sortstring()}'.spc)
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#netrw#init(ext)
|
||||
let g:netrw_force_overwrite_statusline = 0
|
||||
call a:ext.add_statusline_func('airline#extensions#netrw#apply')
|
||||
endfunction
|
||||
|
||||
|
||||
function! airline#extensions#netrw#sortstring()
|
||||
let order = (g:netrw_sort_direction =~ 'n') ? '+' : '-'
|
||||
return g:netrw_sort_by . (g:airline_symbols.space) . '[' . order . ']'
|
||||
endfunction
|
||||
@@ -1,54 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_nrrw_rgn', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#nrrwrgn#apply(...)
|
||||
if exists(":WidenRegion") == 2
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists("*nrrwrgn#NrrwRgnStatus()") || empty(nrrwrgn#NrrwRgnStatus())
|
||||
call a:1.add_section('airline_a', printf('%s[Narrowed%s#%d]', spc, spc, b:nrrw_instn))
|
||||
let bufname=(get(b:, 'orig_buf', 0) ? bufname(b:orig_buf) : substitute(bufname('%'), '^Nrrwrgn_\zs.*\ze_\d\+$', submatch(0), ''))
|
||||
call a:1.add_section('airline_c', spc.bufname.spc)
|
||||
call a:1.split()
|
||||
else
|
||||
let dict=nrrwrgn#NrrwRgnStatus()
|
||||
let vmode = { 'v': 'Char ', 'V': 'Line ', '': 'Block '}
|
||||
let mode = dict.visual ? vmode[dict.visual] : vmode['V']
|
||||
let winwidth = winwidth(0)
|
||||
if winwidth < 80
|
||||
let mode = mode[0]
|
||||
endif
|
||||
let title = (winwidth < 80 ? "Nrrw" : "Narrowed ")
|
||||
let multi = (winwidth < 80 ? 'M' : 'Multi')
|
||||
call a:1.add_section('airline_a', printf('[%s%s%s#%d]%s', (dict.multi ? multi : ""),
|
||||
\ title, mode, b:nrrw_instn, spc))
|
||||
let name = dict.fullname
|
||||
if name !=# '[No Name]'
|
||||
if winwidth > 100
|
||||
" need some space
|
||||
let name = fnamemodify(dict.fullname, ':~')
|
||||
if strlen(name) > 8
|
||||
" shorten name
|
||||
let name = substitute(name, '\(.\)[^/\\]*\([/\\]\)', '\1\2', 'g')
|
||||
endif
|
||||
else
|
||||
let name = fnamemodify(dict.fullname, ':t')
|
||||
endif
|
||||
endif
|
||||
let range=(dict.multi ? '' : printf("[%d-%d]", dict.start[1], dict.end[1]))
|
||||
call a:1.add_section('airline_c', printf("%s %s %s", name, range, dict.enabled ? "\u2713" : '!'))
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_x', get(g:, 'airline_section_x').spc)
|
||||
call a:1.add_section('airline_y', spc.get(g:, 'airline_section_y').spc)
|
||||
call a:1.add_section('airline_z', spc.get(g:, 'airline_section_z'))
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#nrrwrgn#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#nrrwrgn#apply')
|
||||
endfunction
|
||||
@@ -1,33 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':PromptlineSnapshot')
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists('airline#extensions#promptline#snapshot_file') || !len('airline#extensions#promptline#snapshot_file')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:prompt_snapshot_file = get(g:, 'airline#extensions#promptline#snapshot_file', '')
|
||||
let s:color_template = get(g:, 'airline#extensions#promptline#color_template', 'normal')
|
||||
|
||||
function! airline#extensions#promptline#init(ext)
|
||||
call a:ext.add_theme_func('airline#extensions#promptline#set_prompt_colors')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#promptline#set_prompt_colors(palette)
|
||||
let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal'
|
||||
let mode_palette = a:palette[color_template]
|
||||
|
||||
if !has_key(g:, 'promptline_symbols')
|
||||
let g:promptline_symbols = {
|
||||
\ 'left' : g:airline_left_sep,
|
||||
\ 'right' : g:airline_right_sep,
|
||||
\ 'left_alt' : g:airline_left_alt_sep,
|
||||
\ 'right_alt' : g:airline_right_alt_sep}
|
||||
endif
|
||||
|
||||
let promptline_theme = promptline#api#create_theme_from_airline(mode_palette)
|
||||
call promptline#api#create_snapshot_with_theme(s:prompt_snapshot_file, promptline_theme)
|
||||
endfunction
|
||||
@@ -1,37 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
|
||||
function! airline#extensions#quickfix#apply(...)
|
||||
if &buftype == 'quickfix'
|
||||
let w:airline_section_a = s:get_text()
|
||||
let w:airline_section_b = '%{get(w:, "quickfix_title", "")}'
|
||||
let w:airline_section_c = ''
|
||||
let w:airline_section_x = ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#quickfix#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#quickfix#apply')
|
||||
endfunction
|
||||
|
||||
function! s:get_text()
|
||||
redir => buffers
|
||||
silent ls
|
||||
redir END
|
||||
|
||||
let nr = bufnr('%')
|
||||
for buf in split(buffers, '\n')
|
||||
if match(buf, '\v^\s*'.nr) > -1
|
||||
if match(buf, '\cQuickfix') > -1
|
||||
return g:airline#extensions#quickfix#quickfix_text
|
||||
else
|
||||
return g:airline#extensions#quickfix#location_text
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':SyntasticCheck')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#syntastic#get_warnings()
|
||||
let errors = SyntasticStatuslineFlag()
|
||||
if strlen(errors) > 0
|
||||
return errors.(g:airline_symbols.space)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#syntastic#init(ext)
|
||||
call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings')
|
||||
endfunction
|
||||
|
||||
@@ -1,363 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:formatter = get(g:, 'airline#extensions#tabline#formatter', 'default')
|
||||
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
|
||||
let s:tab_nr_type = get(g:, 'airline#extensions#tabline#tab_nr_type', 0)
|
||||
let s:show_buffers = get(g:, 'airline#extensions#tabline#show_buffers', 1)
|
||||
let s:show_tab_nr = get(g:, 'airline#extensions#tabline#show_tab_nr', 1)
|
||||
let s:show_tab_type = get(g:, 'airline#extensions#tabline#show_tab_type', 1)
|
||||
let s:show_close_button = get(g:, 'airline#extensions#tabline#show_close_button', 1)
|
||||
let s:close_symbol = get(g:, 'airline#extensions#tabline#close_symbol', 'X')
|
||||
let s:buffer_idx_mode = get(g:, 'airline#extensions#tabline#buffer_idx_mode', 0)
|
||||
let s:buf_min_count = get(g:, 'airline#extensions#tabline#buffer_min_count', 0)
|
||||
let s:tab_min_count = get(g:, 'airline#extensions#tabline#tab_min_count', 0)
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
let s:number_map = &encoding == 'utf-8'
|
||||
\ ? {
|
||||
\ '0': '⁰',
|
||||
\ '1': '¹',
|
||||
\ '2': '²',
|
||||
\ '3': '³',
|
||||
\ '4': '⁴',
|
||||
\ '5': '⁵',
|
||||
\ '6': '⁶',
|
||||
\ '7': '⁷',
|
||||
\ '8': '⁸',
|
||||
\ '9': '⁹'
|
||||
\ }
|
||||
\ : {}
|
||||
|
||||
function! airline#extensions#tabline#init(ext)
|
||||
if has('gui_running')
|
||||
set guioptions-=e
|
||||
endif
|
||||
|
||||
autocmd User AirlineToggledOn call s:toggle_on()
|
||||
autocmd User AirlineToggledOff call s:toggle_off()
|
||||
autocmd BufDelete * let s:current_bufnr = -1
|
||||
|
||||
call s:toggle_on()
|
||||
call a:ext.add_theme_func('airline#extensions#tabline#load_theme')
|
||||
if s:buffer_idx_mode
|
||||
call s:define_buffer_idx_mode_mappings()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:toggle_off()
|
||||
if exists('s:original_tabline')
|
||||
let &tabline = s:original_tabline
|
||||
let &showtabline = s:original_showtabline
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:toggle_on()
|
||||
let [ s:original_tabline, s:original_showtabline ] = [ &tabline, &showtabline ]
|
||||
|
||||
set tabline=%!airline#extensions#tabline#get()
|
||||
if s:buf_min_count <= 0 && s:tab_min_count <= 1
|
||||
set showtabline=2
|
||||
else
|
||||
augroup airline_tabline
|
||||
autocmd!
|
||||
if s:show_buffers == 1
|
||||
autocmd BufEnter * call <sid>show_tabline(s:buf_min_count, len(s:get_buffer_list()))
|
||||
autocmd BufUnload * call <sid>show_tabline(s:buf_min_count, len(s:get_buffer_list()) - 1)
|
||||
else
|
||||
autocmd TabEnter * call <sid>show_tabline(s:tab_min_count, tabpagenr('$'))
|
||||
endif
|
||||
augroup END
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#load_theme(palette)
|
||||
let colors = get(a:palette, 'tabline', {})
|
||||
let l:tab = get(colors, 'airline_tab', a:palette.normal.airline_b)
|
||||
let l:tabsel = get(colors, 'airline_tabsel', a:palette.normal.airline_a)
|
||||
let l:tabtype = get(colors, 'airline_tabtype', a:palette.visual.airline_a)
|
||||
let l:tabfill = get(colors, 'airline_tabfill', a:palette.normal.airline_c)
|
||||
let l:tabmod = get(colors, 'airline_tabmod', a:palette.insert.airline_a)
|
||||
if has_key(a:palette, 'normal_modified') && has_key(a:palette.normal_modified, 'airline_c')
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal_modified.airline_c)
|
||||
else
|
||||
"Fall back to normal airline_c if modified airline_c isn't present
|
||||
let l:tabmodu = get(colors, 'airline_tabmod_unsel', a:palette.normal.airline_c)
|
||||
endif
|
||||
|
||||
let l:tabhid = get(colors, 'airline_tabhid', a:palette.normal.airline_c)
|
||||
call airline#highlighter#exec('airline_tab', l:tab)
|
||||
call airline#highlighter#exec('airline_tabsel', l:tabsel)
|
||||
call airline#highlighter#exec('airline_tabtype', l:tabtype)
|
||||
call airline#highlighter#exec('airline_tabfill', l:tabfill)
|
||||
call airline#highlighter#exec('airline_tabmod', l:tabmod)
|
||||
call airline#highlighter#exec('airline_tabmod_unsel', l:tabmodu)
|
||||
call airline#highlighter#exec('airline_tabhid', l:tabhid)
|
||||
endfunction
|
||||
|
||||
function! s:show_tabline(min_count, total_count)
|
||||
if a:total_count >= a:min_count
|
||||
if &showtabline != 2
|
||||
set showtabline=2
|
||||
endif
|
||||
else
|
||||
if &showtabline != 0
|
||||
set showtabline=0
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get()
|
||||
let curtabcnt = tabpagenr('$')
|
||||
if curtabcnt != s:current_tabcnt
|
||||
let s:current_tabcnt = curtabcnt
|
||||
let s:current_bufnr = -1 " force a refresh...
|
||||
endif
|
||||
if s:show_buffers && curtabcnt == 1
|
||||
return s:get_buffers()
|
||||
else
|
||||
return s:get_tabs()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#title(n)
|
||||
let buflist = tabpagebuflist(a:n)
|
||||
let winnr = tabpagewinnr(a:n)
|
||||
return airline#extensions#tabline#get_buffer_name(buflist[winnr - 1])
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#get_buffer_name(nr)
|
||||
return airline#extensions#tabline#{s:formatter}#format(a:nr, get(s:, 'current_buffer_list', s:get_buffer_list()))
|
||||
endfunction
|
||||
|
||||
function! s:get_buffer_list()
|
||||
let buffers = []
|
||||
let cur = bufnr('%')
|
||||
for nr in range(1, bufnr('$'))
|
||||
if buflisted(nr) && bufexists(nr)
|
||||
for ex in s:excludes
|
||||
if match(bufname(nr), ex)
|
||||
continue
|
||||
endif
|
||||
endfor
|
||||
if getbufvar(nr, 'current_syntax') == 'qf'
|
||||
continue
|
||||
endif
|
||||
call add(buffers, nr)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let s:current_buffer_list = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
function! s:get_visible_buffers()
|
||||
let buffers = s:get_buffer_list()
|
||||
let cur = bufnr('%')
|
||||
|
||||
let total_width = 0
|
||||
let max_width = 0
|
||||
|
||||
for nr in buffers
|
||||
let width = len(airline#extensions#tabline#get_buffer_name(nr)) + 4
|
||||
let total_width += width
|
||||
let max_width = max([max_width, width])
|
||||
endfor
|
||||
|
||||
" only show current and surrounding buffers if there are too many buffers
|
||||
let position = index(buffers, cur)
|
||||
let vimwidth = &columns
|
||||
if total_width > vimwidth && position > -1
|
||||
let buf_count = len(buffers)
|
||||
|
||||
" determine how many buffers to show based on the longest buffer width,
|
||||
" use one on the right side and put the rest on the left
|
||||
let buf_max = vimwidth / max_width
|
||||
let buf_right = 1
|
||||
let buf_left = max([0, buf_max - buf_right])
|
||||
|
||||
let start = max([0, position - buf_left])
|
||||
let end = min([buf_count, position + buf_right])
|
||||
|
||||
" fill up available space on the right
|
||||
if position < buf_left
|
||||
let end += (buf_left - position)
|
||||
endif
|
||||
|
||||
" fill up available space on the left
|
||||
if end > buf_count - 1 - buf_right
|
||||
let start -= max([0, buf_right - (buf_count - 1 - position)])
|
||||
endif
|
||||
|
||||
let buffers = eval('buffers[' . start . ':' . end . ']')
|
||||
|
||||
if start > 0
|
||||
call insert(buffers, -1, 0)
|
||||
endif
|
||||
|
||||
if end < buf_count - 1
|
||||
call add(buffers, -1)
|
||||
endif
|
||||
endif
|
||||
|
||||
let g:current_visible_buffers = buffers
|
||||
return buffers
|
||||
endfunction
|
||||
|
||||
let s:current_bufnr = -1
|
||||
let s:current_tabnr = -1
|
||||
let s:current_tabcnt = -1
|
||||
let s:current_tabline = ''
|
||||
let s:current_modified = 0
|
||||
function! s:get_buffers()
|
||||
let cur = bufnr('%')
|
||||
if cur == s:current_bufnr
|
||||
if !g:airline_detect_modified || getbufvar(cur, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
endif
|
||||
endif
|
||||
|
||||
let l:index = 1
|
||||
let b = s:new_builder()
|
||||
let tab_bufs = tabpagebuflist(tabpagenr())
|
||||
for nr in s:get_visible_buffers()
|
||||
if nr < 0
|
||||
call b.add_raw('%#airline_tabhid#...')
|
||||
continue
|
||||
endif
|
||||
|
||||
if cur == nr
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
else
|
||||
let group = 'airline_tabsel'
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
if g:airline_detect_modified && getbufvar(nr, '&modified')
|
||||
let group = 'airline_tabmod_unsel'
|
||||
elseif index(tab_bufs, nr) > -1
|
||||
let group = 'airline_tab'
|
||||
else
|
||||
let group = 'airline_tabhid'
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:buffer_idx_mode
|
||||
if len(s:number_map) > 0
|
||||
call b.add_section(group, s:spc . get(s:number_map, l:index, '') . '%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)' . s:spc)
|
||||
else
|
||||
call b.add_section(group, '['.l:index.s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.']')
|
||||
endif
|
||||
let l:index = l:index + 1
|
||||
else
|
||||
call b.add_section(group, s:spc.'%(%{airline#extensions#tabline#get_buffer_name('.nr.')}%)'.s:spc)
|
||||
endif
|
||||
endfor
|
||||
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.add_section('airline_tabtype', ' buffers ')
|
||||
|
||||
let s:current_bufnr = cur
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
|
||||
function! s:select_tab(buf_index)
|
||||
" no-op when called in the NERDTree buffer
|
||||
if exists('t:NERDTreeBufName') && bufname('%') == t:NERDTreeBufName
|
||||
return
|
||||
endif
|
||||
|
||||
let idx = a:buf_index
|
||||
if g:current_visible_buffers[0] == -1
|
||||
let idx = idx + 1
|
||||
endif
|
||||
|
||||
let buf = get(g:current_visible_buffers, idx, 0)
|
||||
if buf != 0
|
||||
exec 'b!' . buf
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:define_buffer_idx_mode_mappings()
|
||||
noremap <unique> <Plug>AirlineSelectTab1 :call <SID>select_tab(0)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab2 :call <SID>select_tab(1)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab3 :call <SID>select_tab(2)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab4 :call <SID>select_tab(3)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab5 :call <SID>select_tab(4)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab6 :call <SID>select_tab(5)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab7 :call <SID>select_tab(6)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab8 :call <SID>select_tab(7)<CR>
|
||||
noremap <unique> <Plug>AirlineSelectTab9 :call <SID>select_tab(8)<CR>
|
||||
endfunction
|
||||
|
||||
function! s:new_builder()
|
||||
let builder_context = {
|
||||
\ 'active' : 1,
|
||||
\ 'right_sep' : get(g:, 'airline#extensions#tabline#right_sep' , g:airline_right_sep),
|
||||
\ 'right_alt_sep' : get(g:, 'airline#extensions#tabline#right_alt_sep', g:airline_right_alt_sep),
|
||||
\ }
|
||||
if get(g:, 'airline_powerline_fonts', 0)
|
||||
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , g:airline_left_sep)
|
||||
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , g:airline_left_alt_sep)
|
||||
else
|
||||
let builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ')
|
||||
let builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|')
|
||||
endif
|
||||
|
||||
return airline#builder#new(builder_context)
|
||||
endfunction
|
||||
|
||||
function! s:get_tabs()
|
||||
let curbuf = bufnr('%')
|
||||
let curtab = tabpagenr()
|
||||
if curbuf == s:current_bufnr && curtab == s:current_tabnr
|
||||
if !g:airline_detect_modified || getbufvar(curbuf, '&modified') == s:current_modified
|
||||
return s:current_tabline
|
||||
endif
|
||||
endif
|
||||
|
||||
let b = s:new_builder()
|
||||
for i in range(1, tabpagenr('$'))
|
||||
if i == curtab
|
||||
let group = 'airline_tabsel'
|
||||
if g:airline_detect_modified
|
||||
for bi in tabpagebuflist(i)
|
||||
if getbufvar(bi, '&modified')
|
||||
let group = 'airline_tabmod'
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
let s:current_modified = (group == 'airline_tabmod') ? 1 : 0
|
||||
else
|
||||
let group = 'airline_tab'
|
||||
endif
|
||||
let val = '%('
|
||||
if s:show_tab_nr
|
||||
if s:tab_nr_type == 0
|
||||
let val .= ' %{len(tabpagebuflist('.i.'))}'
|
||||
else
|
||||
let val .= (g:airline_symbols.space).i
|
||||
endif
|
||||
endif
|
||||
call b.add_section(group, val.'%'.i.'T %{airline#extensions#tabline#title('.i.')} %)')
|
||||
endfor
|
||||
|
||||
call b.add_raw('%T')
|
||||
call b.add_section('airline_tabfill', '')
|
||||
call b.split()
|
||||
if s:show_close_button
|
||||
call b.add_section('airline_tab', ' %999X'.s:close_symbol.' ')
|
||||
endif
|
||||
if s:show_tab_type
|
||||
call b.add_section('airline_tabtype', ' tabs ')
|
||||
endif
|
||||
|
||||
let s:current_bufnr = curbuf
|
||||
let s:current_tabnr = curtab
|
||||
let s:current_tabline = b.build()
|
||||
return s:current_tabline
|
||||
endfunction
|
||||
@@ -1,35 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':~:.')
|
||||
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
let s:buf_nr_format = get(g:, 'airline#extensions#tabline#buffer_nr_format', '%s: ')
|
||||
let s:buf_nr_show = get(g:, 'airline#extensions#tabline#buffer_nr_show', 0)
|
||||
let s:buf_modified_symbol = g:airline_symbols.modified
|
||||
|
||||
function! airline#extensions#tabline#default#format(bufnr, buffers)
|
||||
let _ = ''
|
||||
|
||||
let name = bufname(a:bufnr)
|
||||
if empty(name)
|
||||
let _ .= '[No Name]'
|
||||
else
|
||||
if s:fnamecollapse
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
else
|
||||
let _ .= fnamemodify(name, s:fmod)
|
||||
endif
|
||||
endif
|
||||
|
||||
return airline#extensions#tabline#default#wrap_name(a:bufnr, _)
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tabline#default#wrap_name(bufnr, buffer_name)
|
||||
let _ = s:buf_nr_show ? printf(s:buf_nr_format, a:bufnr) : ''
|
||||
let _ .= substitute(a:buffer_name, '\\', '/', 'g')
|
||||
|
||||
if getbufvar(a:bufnr, '&modified') == 1
|
||||
let _ .= s:buf_modified_symbol
|
||||
endif
|
||||
return _
|
||||
endfunction
|
||||
@@ -1,27 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! airline#extensions#tabline#unique_tail#format(bufnr, buffers)
|
||||
let duplicates = {}
|
||||
let tails = {}
|
||||
let map = {}
|
||||
for nr in a:buffers
|
||||
let name = bufname(nr)
|
||||
if empty(name)
|
||||
let map[nr] = '[No Name]'
|
||||
else
|
||||
let tail = fnamemodify(name, ':t')
|
||||
if has_key(tails, tail)
|
||||
let duplicates[nr] = nr
|
||||
endif
|
||||
let tails[tail] = 1
|
||||
let map[nr] = airline#extensions#tabline#default#wrap_name(nr, tail)
|
||||
endif
|
||||
endfor
|
||||
|
||||
for nr in values(duplicates)
|
||||
let map[nr] = airline#extensions#tabline#default#wrap_name(nr, fnamemodify(bufname(nr), ':p:.'))
|
||||
endfor
|
||||
|
||||
return map[a:bufnr]
|
||||
endfunction
|
||||
@@ -1,89 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:skip_symbol = '…'
|
||||
|
||||
function! airline#extensions#tabline#unique_tail_improved#format(bufnr, buffers)
|
||||
if len(a:buffers) <= 1 " don't need to compare bufnames if has less than one buffer opened
|
||||
return airline#extensions#tabline#default#format(a:bufnr, a:buffers)
|
||||
endif
|
||||
|
||||
let curbuf_tail = fnamemodify(bufname(a:bufnr), ':t')
|
||||
let do_deduplicate = 0
|
||||
let path_tokens = {}
|
||||
|
||||
for nr in a:buffers
|
||||
let name = bufname(nr)
|
||||
if !empty(name) && nr != a:bufnr && fnamemodify(name, ':t') == curbuf_tail " only perform actions if curbuf_tail isn't unique
|
||||
let do_deduplicate = 1
|
||||
let tokens = reverse(split(substitute(fnamemodify(name, ':p:h'), '\\', '/', 'g'), '/'))
|
||||
let token_index = 0
|
||||
for token in tokens
|
||||
if token == '' | continue | endif
|
||||
if token == '.' | break | endif
|
||||
if !has_key(path_tokens, token_index)
|
||||
let path_tokens[token_index] = {}
|
||||
endif
|
||||
let path_tokens[token_index][token] = 1
|
||||
let token_index += 1
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
|
||||
if do_deduplicate == 1
|
||||
let path = []
|
||||
let token_index = 0
|
||||
for token in reverse(split(substitute(fnamemodify(bufname(a:bufnr), ':p:h'), '\\', '/', 'g'), '/'))
|
||||
if token == '.' | break | endif
|
||||
let duplicated = 0
|
||||
let uniq = 1
|
||||
let single = 1
|
||||
if has_key(path_tokens, token_index)
|
||||
let duplicated = 1
|
||||
if len(keys(path_tokens[token_index])) > 1 | let single = 0 | endif
|
||||
if has_key(path_tokens[token_index], token) | let uniq = 0 | endif
|
||||
endif
|
||||
call insert(path, {'token': token, 'duplicated': duplicated, 'uniq': uniq, 'single': single})
|
||||
let token_index += 1
|
||||
endfor
|
||||
|
||||
let buf_name = [curbuf_tail]
|
||||
let has_uniq = 0
|
||||
let has_skipped = 0
|
||||
for token1 in reverse(path)
|
||||
if !token1['duplicated'] && len(buf_name) > 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
break
|
||||
endif
|
||||
|
||||
if has_uniq == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
break
|
||||
endif
|
||||
|
||||
if token1['uniq'] == 0 && token1['single'] == 1
|
||||
let has_skipped = 1
|
||||
else
|
||||
if has_skipped == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
let has_skipped = 0
|
||||
endif
|
||||
call insert(buf_name, token1['token'])
|
||||
endif
|
||||
|
||||
if token1['uniq'] == 1
|
||||
let has_uniq = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if has_skipped == 1
|
||||
call insert(buf_name, s:skip_symbol)
|
||||
endif
|
||||
|
||||
return airline#extensions#tabline#default#wrap_name(a:bufnr, join(buf_name, '/'))
|
||||
else
|
||||
return airline#extensions#tabline#default#format(a:bufnr, a:buffers)
|
||||
endif
|
||||
endfunction
|
||||
@@ -1,45 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':TagbarToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
" Arguments: current, sort, fname
|
||||
function! airline#extensions#tagbar#get_status(...)
|
||||
let builder = airline#builder#new({ 'active': a:1 })
|
||||
call builder.add_section('airline_a', s:spc.'Tagbar'.s:spc)
|
||||
call builder.add_section('airline_b', s:spc.a:2.s:spc)
|
||||
call builder.add_section('airline_c', s:spc.a:3.s:spc)
|
||||
return builder.build()
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tagbar#inactive_apply(...)
|
||||
if getwinvar(a:2.winnr, '&filetype') == 'tagbar'
|
||||
return -1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:airline_tagbar_last_lookup_time = 0
|
||||
let s:airline_tagbar_last_lookup_val = ''
|
||||
function! airline#extensions#tagbar#currenttag()
|
||||
if get(w:, 'airline_active', 0)
|
||||
if s:airline_tagbar_last_lookup_time != localtime()
|
||||
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
|
||||
let s:airline_tagbar_last_lookup_time = localtime()
|
||||
endif
|
||||
return s:airline_tagbar_last_lookup_val
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tagbar#init(ext)
|
||||
call a:ext.add_inactive_statusline_func('airline#extensions#tagbar#inactive_apply')
|
||||
let g:tagbar_status_func = 'airline#extensions#tagbar#get_status'
|
||||
|
||||
call airline#parts#define_function('tagbar', 'airline#extensions#tagbar#currenttag')
|
||||
endfunction
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':Tmuxline')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:tmuxline_snapshot_file = get(g:, 'airline#extensions#tmuxline#snapshot_file', '')
|
||||
let s:color_template = get(g:, 'airline#extensions#tmuxline#color_template', 'normal')
|
||||
|
||||
function! airline#extensions#tmuxline#init(ext)
|
||||
call a:ext.add_theme_func('airline#extensions#tmuxline#set_tmux_colors')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#tmuxline#set_tmux_colors(palette)
|
||||
let color_template = has_key(a:palette, s:color_template) ? s:color_template : 'normal'
|
||||
let mode_palette = a:palette[color_template]
|
||||
|
||||
let tmuxline_theme = tmuxline#api#create_theme_from_airline(mode_palette)
|
||||
call tmuxline#api#set_theme(tmuxline_theme)
|
||||
|
||||
if strlen(s:tmuxline_snapshot_file)
|
||||
call tmuxline#api#snapshot(s:tmuxline_snapshot_file)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists(':UndotreeToggle')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#undotree#apply(...)
|
||||
if exists('t:undotree')
|
||||
if &ft == 'undotree'
|
||||
if exists('*t:undotree.GetStatusLine')
|
||||
call airline#extensions#apply_left_override('undo', '%{t:undotree.GetStatusLine()}')
|
||||
else
|
||||
call airline#extensions#apply_left_override('undotree', '%f')
|
||||
endif
|
||||
endif
|
||||
|
||||
if &ft == 'diff' && exists('*t:diffpanel.GetStatusLine')
|
||||
call airline#extensions#apply_left_override('diff', '%{t:diffpanel.GetStatusLine()}')
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#undotree#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#undotree#apply')
|
||||
endfunction
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !get(g:, 'loaded_unite', 0)
|
||||
finish
|
||||
endif
|
||||
|
||||
function! airline#extensions#unite#apply(...)
|
||||
if &ft == 'unite'
|
||||
call a:1.add_section('airline_a', ' Unite ')
|
||||
call a:1.add_section('airline_b', ' %{get(unite#get_context(), "buffer_name", "")} ')
|
||||
call a:1.add_section('airline_c', ' %{unite#get_status_string()} ')
|
||||
call a:1.split()
|
||||
call a:1.add_section('airline_y', ' %{get(unite#get_context(), "real_buffer_name", "")} ')
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#unite#init(ext)
|
||||
let g:unite_force_overwrite_statusline = 0
|
||||
call a:ext.add_statusline_func('airline#extensions#unite#apply')
|
||||
endfunction
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !isdirectory($VIRTUAL_ENV)
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#extensions#virtualenv#init(ext)
|
||||
call a:ext.add_statusline_func('airline#extensions#virtualenv#apply')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#virtualenv#apply(...)
|
||||
if &filetype =~ "python"
|
||||
if get(g:, 'virtualenv_loaded', 0)
|
||||
let statusline = virtualenv#statusline()
|
||||
else
|
||||
let statusline = fnamemodify($VIRTUAL_ENV, ':t')
|
||||
endif
|
||||
call airline#extensions#append_to_section('x',
|
||||
\ s:spc.g:airline_right_alt_sep.s:spc.statusline)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" http://got-ravings.blogspot.com/2008/10/vim-pr0n-statusline-whitespace-flags.html
|
||||
|
||||
" for backwards compatibility
|
||||
if exists('g:airline_detect_whitespace')
|
||||
let s:show_message = g:airline_detect_whitespace == 1
|
||||
else
|
||||
let s:show_message = get(g:, 'airline#extensions#whitespace#show_message', 1)
|
||||
endif
|
||||
|
||||
let s:symbol = get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)
|
||||
let s:default_checks = ['indent', 'trailing']
|
||||
|
||||
let s:trailing_format = get(g:, 'airline#extensions#whitespace#trailing_format', 'trailing[%s]')
|
||||
let s:mixed_indent_format = get(g:, 'airline#extensions#whitespace#mixed_indent_format', 'mixed-indent[%s]')
|
||||
let s:indent_algo = get(g:, 'airline#extensions#whitespace#mixed_indent_algo', 0)
|
||||
|
||||
let s:max_lines = get(g:, 'airline#extensions#whitespace#max_lines', 20000)
|
||||
|
||||
let s:enabled = get(g:, 'airline#extensions#whitespace#enabled', 1)
|
||||
|
||||
function! s:check_mixed_indent()
|
||||
if s:indent_algo == 1
|
||||
" [<tab>]<space><tab>
|
||||
" spaces before or between tabs are not allowed
|
||||
let t_s_t = '(^\t* +\t\s*\S)'
|
||||
" <tab>(<space> x count)
|
||||
" count of spaces at the end of tabs should be less then tabstop value
|
||||
let t_l_s = '(^\t+ {' . &ts . ',}' . '\S)'
|
||||
return search('\v' . t_s_t . '|' . t_l_s, 'nw')
|
||||
else
|
||||
return search('\v(^\t+ +)|(^ +\t+)', 'nw')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#check()
|
||||
if &readonly || !&modifiable || !s:enabled || line('$') > s:max_lines
|
||||
return ''
|
||||
endif
|
||||
|
||||
if !exists('b:airline_whitespace_check')
|
||||
let b:airline_whitespace_check = ''
|
||||
let checks = get(g:, 'airline#extensions#whitespace#checks', s:default_checks)
|
||||
|
||||
let trailing = 0
|
||||
if index(checks, 'trailing') > -1
|
||||
let trailing = search('\s$', 'nw')
|
||||
endif
|
||||
|
||||
let mixed = 0
|
||||
if index(checks, 'indent') > -1
|
||||
let mixed = s:check_mixed_indent()
|
||||
endif
|
||||
|
||||
if trailing != 0 || mixed != 0
|
||||
let b:airline_whitespace_check = s:symbol
|
||||
if s:show_message
|
||||
if trailing != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing)
|
||||
endif
|
||||
if mixed != 0
|
||||
let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixed)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return b:airline_whitespace_check
|
||||
endfunction!
|
||||
|
||||
function! airline#extensions#whitespace#toggle()
|
||||
if s:enabled
|
||||
augroup airline_whitespace
|
||||
autocmd!
|
||||
augroup END
|
||||
augroup! airline_whitespace
|
||||
let s:enabled = 0
|
||||
else
|
||||
call airline#extensions#whitespace#init()
|
||||
let s:enabled = 1
|
||||
endif
|
||||
|
||||
if exists("g:airline#extensions#whitespace#enabled")
|
||||
let g:airline#extensions#whitespace#enabled = s:enabled
|
||||
if s:enabled && match(g:airline_section_warning, '#whitespace#check') < 0
|
||||
let g:airline_section_warning .= airline#section#create(['whitespace'])
|
||||
call airline#update_statusline()
|
||||
endif
|
||||
endif
|
||||
echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#whitespace#init(...)
|
||||
call airline#parts#define_function('whitespace', 'airline#extensions#whitespace#check')
|
||||
|
||||
unlet! b:airline_whitespace_check
|
||||
augroup airline_whitespace
|
||||
autocmd!
|
||||
autocmd CursorHold,BufWritePost * unlet! b:airline_whitespace_check
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if !exists('g:loaded_windowswap')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
if !exists('g:airline#extensions#windowswap#indicator_text')
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
endif
|
||||
|
||||
function! airline#extensions#windowswap#init(ext)
|
||||
call airline#parts#define_function('windowswap', 'airline#extensions#windowswap#get_status')
|
||||
endfunction
|
||||
|
||||
function! airline#extensions#windowswap#get_status()
|
||||
if WindowSwap#HasMarkedWindow() && WindowSwap#GetMarkedWindowNum() == winnr()
|
||||
return g:airline#extensions#windowswap#indicator_text.s:spc
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
|
||||
let s:separators = {}
|
||||
let s:accents = {}
|
||||
|
||||
function! s:gui2cui(rgb, fallback)
|
||||
if a:rgb == ''
|
||||
return a:fallback
|
||||
endif
|
||||
let rgb = map(matchlist(a:rgb, '#\(..\)\(..\)\(..\)')[1:3], '0 + ("0x".v:val)')
|
||||
let rgb = [rgb[0] > 127 ? 4 : 0, rgb[1] > 127 ? 2 : 0, rgb[2] > 127 ? 1 : 0]
|
||||
return rgb[0]+rgb[1]+rgb[2]
|
||||
endfunction
|
||||
|
||||
function! s:get_syn(group, what)
|
||||
" need to pass in mode, known to break on 7.3.547
|
||||
let mode = has('gui_running') ? 'gui' : 'cterm'
|
||||
let color = synIDattr(synIDtrans(hlID(a:group)), a:what, mode)
|
||||
if empty(color) || color == -1
|
||||
let color = synIDattr(synIDtrans(hlID('Normal')), a:what, mode)
|
||||
endif
|
||||
if empty(color) || color == -1
|
||||
if has('gui_running')
|
||||
let color = a:what ==# 'fg' ? '#000000' : '#FFFFFF'
|
||||
else
|
||||
let color = a:what ==# 'fg' ? 0 : 1
|
||||
endif
|
||||
endif
|
||||
return color
|
||||
endfunction
|
||||
|
||||
function! s:get_array(fg, bg, opts)
|
||||
let fg = a:fg
|
||||
let bg = a:bg
|
||||
return has('gui_running')
|
||||
\ ? [ fg, bg, '', '', join(a:opts, ',') ]
|
||||
\ : [ '', '', fg, bg, join(a:opts, ',') ]
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight(group, ...)
|
||||
let fg = s:get_syn(a:group, 'fg')
|
||||
let bg = s:get_syn(a:group, 'bg')
|
||||
let reverse = has('gui_running')
|
||||
\ ? synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'gui')
|
||||
\ : synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'cterm')
|
||||
\|| synIDattr(synIDtrans(hlID(a:group)), 'reverse', 'term')
|
||||
return reverse ? s:get_array(bg, fg, a:000) : s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#get_highlight2(fg, bg, ...)
|
||||
let fg = s:get_syn(a:fg[0], a:fg[1])
|
||||
let bg = s:get_syn(a:bg[0], a:bg[1])
|
||||
return s:get_array(fg, bg, a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#exec(group, colors)
|
||||
let colors = a:colors
|
||||
if s:is_win32term
|
||||
let colors[2] = s:gui2cui(get(colors, 0, ''), get(colors, 2, ''))
|
||||
let colors[3] = s:gui2cui(get(colors, 1, ''), get(colors, 3, ''))
|
||||
endif
|
||||
exec printf('hi %s %s %s %s %s %s %s %s',
|
||||
\ a:group,
|
||||
\ get(colors, 0, '') != '' ? 'guifg='.colors[0] : '',
|
||||
\ get(colors, 1, '') != '' ? 'guibg='.colors[1] : '',
|
||||
\ get(colors, 2, '') != '' ? 'ctermfg='.colors[2] : '',
|
||||
\ get(colors, 3, '') != '' ? 'ctermbg='.colors[3] : '',
|
||||
\ get(colors, 4, '') != '' ? 'gui='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'cterm='.colors[4] : '',
|
||||
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
|
||||
endfunction
|
||||
|
||||
function! s:exec_separator(dict, from, to, inverse, suffix)
|
||||
let l:from = airline#themes#get_highlight(a:from.a:suffix)
|
||||
let l:to = airline#themes#get_highlight(a:to.a:suffix)
|
||||
let group = a:from.'_to_'.a:to.a:suffix
|
||||
if a:inverse
|
||||
let colors = [ l:from[1], l:to[1], l:from[3], l:to[3] ]
|
||||
else
|
||||
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
|
||||
endif
|
||||
let a:dict[group] = colors
|
||||
call airline#highlighter#exec(group, colors)
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#load_theme()
|
||||
for winnr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
call airline#highlighter#highlight_modified_inactive(winbufnr(winnr))
|
||||
endfor
|
||||
call airline#highlighter#highlight(['inactive'])
|
||||
call airline#highlighter#highlight(['normal'])
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#add_separator(from, to, inverse)
|
||||
let s:separators[a:from.a:to] = [a:from, a:to, a:inverse]
|
||||
call <sid>exec_separator({}, a:from, a:to, a:inverse, '')
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#add_accent(accent)
|
||||
let s:accents[a:accent] = 1
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight_modified_inactive(bufnr)
|
||||
if getbufvar(a:bufnr, '&modified')
|
||||
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c')
|
||||
\ ? g:airline#themes#{g:airline_theme}#palette.inactive_modified.airline_c : []
|
||||
else
|
||||
let colors = exists('g:airline#themes#{g:airline_theme}#palette.inactive.airline_c')
|
||||
\ ? g:airline#themes#{g:airline_theme}#palette.inactive.airline_c : []
|
||||
endif
|
||||
|
||||
if !empty(colors)
|
||||
call airline#highlighter#exec('airline_c'.(a:bufnr).'_inactive', colors)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#highlighter#highlight(modes)
|
||||
let p = g:airline#themes#{g:airline_theme}#palette
|
||||
|
||||
" draw the base mode, followed by any overrides
|
||||
let mapped = map(a:modes, 'v:val == a:modes[0] ? v:val : a:modes[0]."_".v:val')
|
||||
let suffix = a:modes[0] == 'inactive' ? '_inactive' : ''
|
||||
for mode in mapped
|
||||
if exists('g:airline#themes#{g:airline_theme}#palette[mode]')
|
||||
let dict = g:airline#themes#{g:airline_theme}#palette[mode]
|
||||
for kvp in items(dict)
|
||||
let mode_colors = kvp[1]
|
||||
call airline#highlighter#exec(kvp[0].suffix, mode_colors)
|
||||
|
||||
for accent in keys(s:accents)
|
||||
if !has_key(p.accents, accent)
|
||||
continue
|
||||
endif
|
||||
let colors = copy(mode_colors)
|
||||
if p.accents[accent][0] != ''
|
||||
let colors[0] = p.accents[accent][0]
|
||||
endif
|
||||
if p.accents[accent][2] != ''
|
||||
let colors[2] = p.accents[accent][2]
|
||||
endif
|
||||
if len(colors) >= 5
|
||||
let colors[4] = get(p.accents[accent], 4, '')
|
||||
else
|
||||
call add(colors, get(p.accents[accent], 4, ''))
|
||||
endif
|
||||
call airline#highlighter#exec(kvp[0].suffix.'_'.accent, colors)
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" TODO: optimize this
|
||||
for sep in items(s:separators)
|
||||
call <sid>exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix)
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
function! s:check_defined(variable, default)
|
||||
if !exists(a:variable)
|
||||
let {a:variable} = a:default
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:loaded = 0
|
||||
function! airline#init#bootstrap()
|
||||
if s:loaded
|
||||
return
|
||||
endif
|
||||
let s:loaded = 1
|
||||
|
||||
let g:airline#init#bootstrapping = 1
|
||||
|
||||
call s:check_defined('g:airline_left_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b0":">")
|
||||
call s:check_defined('g:airline_left_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b1":">")
|
||||
call s:check_defined('g:airline_right_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b2":"<")
|
||||
call s:check_defined('g:airline_right_alt_sep', get(g:, 'airline_powerline_fonts', 0)?"\ue0b3":"<")
|
||||
call s:check_defined('g:airline_detect_modified', 1)
|
||||
call s:check_defined('g:airline_detect_paste', 1)
|
||||
call s:check_defined('g:airline_detect_iminsert', 0)
|
||||
call s:check_defined('g:airline_inactive_collapse', 1)
|
||||
call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerStack','DebuggerStatus'])
|
||||
call s:check_defined('g:airline_exclude_filetypes', [])
|
||||
call s:check_defined('g:airline_exclude_preview', 0)
|
||||
|
||||
call s:check_defined('g:airline_mode_map', {})
|
||||
call extend(g:airline_mode_map, {
|
||||
\ '__' : '------',
|
||||
\ 'n' : 'NORMAL',
|
||||
\ 'i' : 'INSERT',
|
||||
\ 'R' : 'REPLACE',
|
||||
\ 'v' : 'VISUAL',
|
||||
\ 'V' : 'V-LINE',
|
||||
\ 'c' : 'COMMAND',
|
||||
\ '' : 'V-BLOCK',
|
||||
\ 's' : 'SELECT',
|
||||
\ 'S' : 'S-LINE',
|
||||
\ '' : 'S-BLOCK',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_theme_map', {})
|
||||
call extend(g:airline_theme_map, {
|
||||
\ 'Tomorrow.*': 'tomorrow',
|
||||
\ 'base16.*': 'base16',
|
||||
\ 'mo[l|n]okai': 'molokai',
|
||||
\ 'wombat.*': 'wombat',
|
||||
\ '.*zenburn.*': 'zenburn',
|
||||
\ '.*solarized.*': 'solarized',
|
||||
\ }, 'keep')
|
||||
|
||||
call s:check_defined('g:airline_symbols', {})
|
||||
call extend(g:airline_symbols, {
|
||||
\ 'paste': get(g:, 'airline_paste_symbol', 'PASTE'),
|
||||
\ 'readonly': get(g:, 'airline_readonly_symbol', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a2" : 'RO'),
|
||||
\ 'whitespace': get(g:, 'airline_powerline_fonts', 0) ? "\u2739" : '!',
|
||||
\ 'linenr': get(g:, 'airline_linecolumn_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a1" : ':' ),
|
||||
\ 'branch': get(g:, 'airline_branch_prefix', get(g:, 'airline_powerline_fonts', 0) ? "\ue0a0" : ''),
|
||||
\ 'modified': '+',
|
||||
\ 'space': ' ',
|
||||
\ }, 'keep')
|
||||
|
||||
call airline#parts#define('mode', {
|
||||
\ 'function': 'airline#parts#mode',
|
||||
\ 'accent': 'bold',
|
||||
\ })
|
||||
call airline#parts#define_function('iminsert', 'airline#parts#iminsert')
|
||||
call airline#parts#define_function('paste', 'airline#parts#paste')
|
||||
call airline#parts#define_function('filetype', 'airline#parts#filetype')
|
||||
call airline#parts#define('readonly', {
|
||||
\ 'function': 'airline#parts#readonly',
|
||||
\ 'accent': 'red',
|
||||
\ })
|
||||
call airline#parts#define_raw('file', '%f%m')
|
||||
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
|
||||
call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
|
||||
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
|
||||
call airline#parts#define_text('capslock', '')
|
||||
|
||||
unlet g:airline#init#bootstrapping
|
||||
endfunction
|
||||
|
||||
function! airline#init#sections()
|
||||
let spc = g:airline_symbols.space
|
||||
if !exists('g:airline_section_a')
|
||||
let g:airline_section_a = airline#section#create_left(['mode', 'paste', 'capslock', 'iminsert'])
|
||||
endif
|
||||
if !exists('g:airline_section_b')
|
||||
let g:airline_section_b = airline#section#create(['hunks', 'branch'])
|
||||
endif
|
||||
if !exists('g:airline_section_c')
|
||||
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
|
||||
endif
|
||||
if !exists('g:airline_section_gutter')
|
||||
let g:airline_section_gutter = airline#section#create(['%='])
|
||||
endif
|
||||
if !exists('g:airline_section_x')
|
||||
let g:airline_section_x = airline#section#create_right(['tagbar', 'filetype'])
|
||||
endif
|
||||
if !exists('g:airline_section_y')
|
||||
let g:airline_section_y = airline#section#create_right(['ffenc'])
|
||||
endif
|
||||
if !exists('g:airline_section_z')
|
||||
let g:airline_section_z = airline#section#create(['windowswap', '%3p%%'.spc, 'linenr', ':%3c '])
|
||||
endif
|
||||
if !exists('g:airline_section_warning')
|
||||
let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:parts = {}
|
||||
|
||||
" PUBLIC API {{{
|
||||
|
||||
function! airline#parts#define(key, config)
|
||||
let s:parts[a:key] = get(s:parts, a:key, {})
|
||||
if exists('g:airline#init#bootstrapping')
|
||||
call extend(s:parts[a:key], a:config, 'keep')
|
||||
else
|
||||
call extend(s:parts[a:key], a:config, 'force')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_function(key, name)
|
||||
call airline#parts#define(a:key, { 'function': a:name })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_text(key, text)
|
||||
call airline#parts#define(a:key, { 'text': a:text })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_raw(key, raw)
|
||||
call airline#parts#define(a:key, { 'raw': a:raw })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_minwidth(key, width)
|
||||
call airline#parts#define(a:key, { 'minwidth': a:width })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_condition(key, predicate)
|
||||
call airline#parts#define(a:key, { 'condition': a:predicate })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_accent(key, accent)
|
||||
call airline#parts#define(a:key, { 'accent': a:accent })
|
||||
endfunction
|
||||
|
||||
function! airline#parts#define_empty(keys)
|
||||
for key in a:keys
|
||||
call airline#parts#define_raw(key, '')
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! airline#parts#get(key)
|
||||
return get(s:parts, a:key, {})
|
||||
endfunction
|
||||
|
||||
" }}}
|
||||
|
||||
function! airline#parts#mode()
|
||||
return get(w:, 'airline_current_mode', '')
|
||||
endfunction
|
||||
|
||||
function! airline#parts#paste()
|
||||
return g:airline_detect_paste && &paste ? g:airline_symbols.paste : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#iminsert()
|
||||
if g:airline_detect_iminsert && &iminsert && exists('b:keymap_name')
|
||||
return toupper(b:keymap_name)
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#readonly()
|
||||
return &readonly ? g:airline_symbols.readonly : ''
|
||||
endfunction
|
||||
|
||||
function! airline#parts#filetype()
|
||||
return &filetype
|
||||
endfunction
|
||||
|
||||
function! airline#parts#ffenc()
|
||||
return printf('%s%s', &fenc, strlen(&ff) > 0 ? '['.&ff.']' : '')
|
||||
endfunction
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! s:wrap_accent(part, value)
|
||||
if exists('a:part.accent')
|
||||
call airline#highlighter#add_accent(a:part.accent)
|
||||
return '%#__accent_'.(a:part.accent).'#'.a:value.'%#__restore__#'
|
||||
endif
|
||||
return a:value
|
||||
endfunction
|
||||
|
||||
function! s:create(parts, append)
|
||||
let _ = ''
|
||||
for idx in range(len(a:parts))
|
||||
let part = airline#parts#get(a:parts[idx])
|
||||
let val = ''
|
||||
|
||||
if exists('part.function')
|
||||
let func = (part.function).'()'
|
||||
elseif exists('part.text')
|
||||
let func = '"'.(part.text).'"'
|
||||
else
|
||||
if a:append > 0 && idx != 0
|
||||
let val .= s:spc.g:airline_left_alt_sep.s:spc
|
||||
endif
|
||||
if a:append < 0 && idx != 0
|
||||
let val = s:spc.g:airline_right_alt_sep.s:spc.val
|
||||
endif
|
||||
if exists('part.raw')
|
||||
let _ .= s:wrap_accent(part, val.(part.raw))
|
||||
continue
|
||||
else
|
||||
let _ .= s:wrap_accent(part, val.a:parts[idx])
|
||||
continue
|
||||
endif
|
||||
endif
|
||||
|
||||
let minwidth = get(part, 'minwidth', 0)
|
||||
|
||||
if a:append > 0 && idx != 0
|
||||
let partval = printf('%%{airline#util#append(%s,%s)}', func, minwidth)
|
||||
elseif a:append < 0 && idx != len(a:parts) - 1
|
||||
let partval = printf('%%{airline#util#prepend(%s,%s)}', func, minwidth)
|
||||
else
|
||||
let partval = printf('%%{airline#util#wrap(%s,%s)}', func, minwidth)
|
||||
endif
|
||||
|
||||
if exists('part.condition')
|
||||
let partval = substitute(partval, '{', '\="{".(part.condition)." ? "', '')
|
||||
let partval = substitute(partval, '}', ' : ""}', '')
|
||||
endif
|
||||
|
||||
let val .= s:wrap_accent(part, partval)
|
||||
let _ .= val
|
||||
endfor
|
||||
return _
|
||||
endfunction
|
||||
|
||||
function! airline#section#create(parts)
|
||||
return s:create(a:parts, 0)
|
||||
endfunction
|
||||
|
||||
function! airline#section#create_left(parts)
|
||||
return s:create(a:parts, 1)
|
||||
endfunction
|
||||
|
||||
function! airline#section#create_right(parts)
|
||||
return s:create(a:parts, -1)
|
||||
endfunction
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
" generates a dictionary which defines the colors for each highlight group
|
||||
function! airline#themes#generate_color_map(sect1, sect2, sect3, ...)
|
||||
let palette = {
|
||||
\ 'airline_a': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , get(a:sect1 , 4 , '') ] ,
|
||||
\ 'airline_b': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , get(a:sect2 , 4 , '') ] ,
|
||||
\ 'airline_c': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , get(a:sect3 , 4 , '') ] ,
|
||||
\ }
|
||||
|
||||
if a:0 > 0
|
||||
call extend(palette, {
|
||||
\ 'airline_x': [ a:1[0] , a:1[1] , a:1[2] , a:1[3] , get(a:1 , 4 , '' ) ] ,
|
||||
\ 'airline_y': [ a:2[0] , a:2[1] , a:2[2] , a:2[3] , get(a:2 , 4 , '' ) ] ,
|
||||
\ 'airline_z': [ a:3[0] , a:3[1] , a:3[2] , a:3[3] , get(a:3 , 4 , '' ) ] ,
|
||||
\ })
|
||||
else
|
||||
call extend(palette, {
|
||||
\ 'airline_x': [ a:sect3[0] , a:sect3[1] , a:sect3[2] , a:sect3[3] , '' ] ,
|
||||
\ 'airline_y': [ a:sect2[0] , a:sect2[1] , a:sect2[2] , a:sect2[3] , '' ] ,
|
||||
\ 'airline_z': [ a:sect1[0] , a:sect1[1] , a:sect1[2] , a:sect1[3] , '' ] ,
|
||||
\ })
|
||||
endif
|
||||
|
||||
return palette
|
||||
endfunction
|
||||
|
||||
function! airline#themes#get_highlight(group, ...)
|
||||
return call('airline#highlighter#get_highlight', [a:group] + a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#themes#get_highlight2(fg, bg, ...)
|
||||
return call('airline#highlighter#get_highlight2', [a:fg, a:bg] + a:000)
|
||||
endfunction
|
||||
|
||||
function! airline#themes#patch(palette)
|
||||
for mode in keys(a:palette)
|
||||
if !has_key(a:palette[mode], 'airline_warning')
|
||||
let a:palette[mode]['airline_warning'] = [ '#000000', '#df5f00', 232, 166 ]
|
||||
endif
|
||||
endfor
|
||||
|
||||
let a:palette.accents = get(a:palette, 'accents', {})
|
||||
let a:palette.accents.bold = [ '', '', '', '', 'bold' ]
|
||||
let a:palette.accents.italic = [ '', '', '', '', 'italic' ]
|
||||
|
||||
if !has_key(a:palette.accents, 'red')
|
||||
let a:palette.accents.red = [ '#ff0000' , '' , 160 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'green')
|
||||
let a:palette.accents.green = [ '#008700' , '' , 22 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'blue')
|
||||
let a:palette.accents.blue = [ '#005fff' , '' , 27 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'yellow')
|
||||
let a:palette.accents.yellow = [ '#dfff00' , '' , 190 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'orange')
|
||||
let a:palette.accents.orange = [ '#df5f00' , '' , 166 , '' ]
|
||||
endif
|
||||
if !has_key(a:palette.accents, 'purple')
|
||||
let a:palette.accents.purple = [ '#af00df' , '' , 128 , '' ]
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
let s:N1 = [ '#141413' , '#aeee00' , 232 , 154 ] " blackestgravel & lime
|
||||
let s:N2 = [ '#f4cf86' , '#45413b' , 222 , 238 ] " dirtyblonde & deepgravel
|
||||
let s:N3 = [ '#8cffba' , '#242321' , 121 , 235 ] " saltwatertaffy & darkgravel
|
||||
let s:N4 = [ '#666462' , 241 ] " mediumgravel
|
||||
|
||||
let s:I1 = [ '#141413' , '#0a9dff' , 232 , 39 ] " blackestgravel & tardis
|
||||
let s:I2 = [ '#f4cf86' , '#005fff' , 222 , 27 ] " dirtyblonde & facebook
|
||||
let s:I3 = [ '#0a9dff' , '#242321' , 39 , 235 ] " tardis & darkgravel
|
||||
|
||||
let s:V1 = [ '#141413' , '#ffa724' , 232 , 214 ] " blackestgravel & orange
|
||||
let s:V2 = [ '#000000' , '#fade3e' , 16 , 221 ] " coal & dalespale
|
||||
let s:V3 = [ '#000000' , '#b88853' , 16 , 137 ] " coal & toffee
|
||||
let s:V4 = [ '#c7915b' , 173 ] " coffee
|
||||
|
||||
let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde
|
||||
let s:RE = [ '#ff9eb8' , 211 ] " dress
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#badwolf#palette = {}
|
||||
|
||||
let g:airline#themes#badwolf#palette.accents = {
|
||||
\ 'red': [ '#ff2c4b' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#badwolf#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#badwolf#palette.normal_modified = {
|
||||
\ 'airline_b': [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#badwolf#palette.insert_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#badwolf#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.replace = copy(airline#themes#badwolf#palette.insert)
|
||||
let g:airline#themes#badwolf#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#badwolf#palette.replace_modified = g:airline#themes#badwolf#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#badwolf#palette.visual_modified = {
|
||||
\ 'airline_c': [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#badwolf#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#badwolf#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
if get(g:, 'airline#themes#base16#constant', 0)
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#202020'
|
||||
let s:cterm_dark_gray = 234
|
||||
let s:gui_med_gray_hi = '#303030'
|
||||
let s:cterm_med_gray_hi = 236
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#505050'
|
||||
let s:cterm_light_gray = 239
|
||||
let s:gui_green = '#99cc99'
|
||||
let s:cterm_green = 151
|
||||
let s:gui_blue = '#6a9fb5'
|
||||
let s:cterm_blue = 67
|
||||
let s:gui_purple = '#aa759f'
|
||||
let s:cterm_purple = 139
|
||||
let s:gui_orange = '#d28445'
|
||||
let s:cterm_orange = 173
|
||||
let s:gui_red = '#ac4142'
|
||||
let s:cterm_red = 131
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = copy(g:airline#themes#base16#palette.normal_modified)
|
||||
let g:airline#themes#base16#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#base16#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#base16#palette.replace_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = copy(g:airline#themes#base16#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
else
|
||||
function! airline#themes#base16#refresh()
|
||||
let g:airline#themes#base16#palette = {}
|
||||
|
||||
let g:airline#themes#base16#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DiffText', 'bg'], ['DiffText', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Visual')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#base16#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#base16#palette.normal_modified = {
|
||||
\ 'statusline': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DiffAdded', 'bg'], ['DiffAdded', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['DiffAdded', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#base16#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#base16#palette.insert_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['WarningMsg', 'bg'], ['WarningMsg', 'fg'], 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#base16#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#base16#palette.replace_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#base16#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#base16#palette.visual_modified = g:airline#themes#base16#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#base16#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#base16#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
call airline#themes#base16#refresh()
|
||||
endif
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
" Color palette
|
||||
let s:gui_dark_gray = '#303030'
|
||||
let s:cterm_dark_gray = 236
|
||||
let s:gui_med_gray_hi = '#444444'
|
||||
let s:cterm_med_gray_hi = 238
|
||||
let s:gui_med_gray_lo = '#3a3a3a'
|
||||
let s:cterm_med_gray_lo = 237
|
||||
let s:gui_light_gray = '#b2b2b2'
|
||||
let s:cterm_light_gray = 249
|
||||
let s:gui_green = '#afd787'
|
||||
let s:cterm_green = 150
|
||||
let s:gui_blue = '#87afd7'
|
||||
let s:cterm_blue = 110
|
||||
let s:gui_purple = '#afafd7'
|
||||
let s:cterm_purple = 146
|
||||
let s:gui_orange = '#d7af5f'
|
||||
let s:cterm_orange = 179
|
||||
let s:gui_red = '#d78787'
|
||||
let s:cterm_red = 174
|
||||
let s:gui_pink = '#d7afd7'
|
||||
let s:cterm_pink = 182
|
||||
|
||||
let g:airline#themes#bubblegum#palette = {}
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green]
|
||||
let s:N2 = [s:gui_light_gray, s:gui_med_gray_lo, s:cterm_light_gray, s:cterm_med_gray_lo]
|
||||
let s:N3 = [s:gui_green, s:gui_med_gray_hi, s:cterm_green, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#bubblegum#palette.normal_modified = {
|
||||
\ 'airline_c': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_med_gray_hi, s:gui_blue, s:cterm_med_gray_hi, s:cterm_blue]
|
||||
let s:I3 = [s:gui_blue, s:gui_med_gray_hi, s:cterm_blue, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3)
|
||||
let g:airline#themes#bubblegum#palette.insert_modified = copy(g:airline#themes#bubblegum#palette.normal_modified)
|
||||
let g:airline#themes#bubblegum#palette.insert_paste = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''],
|
||||
\ }
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#bubblegum#palette.replace = {
|
||||
\ 'airline_a': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''],
|
||||
\ 'airline_c': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''],
|
||||
\ }
|
||||
let g:airline#themes#bubblegum#palette.replace_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_dark_gray, s:gui_pink, s:cterm_dark_gray, s:cterm_pink]
|
||||
let s:V3 = [s:gui_pink, s:gui_med_gray_hi, s:cterm_pink, s:cterm_med_gray_hi]
|
||||
let g:airline#themes#bubblegum#palette.visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3)
|
||||
let g:airline#themes#bubblegum#palette.visual_modified = copy(g:airline#themes#bubblegum#palette.insert_modified)
|
||||
|
||||
" Inactive window
|
||||
let s:IA = [s:gui_light_gray, s:gui_med_gray_hi, s:cterm_light_gray, s:cterm_med_gray_hi, '']
|
||||
let g:airline#themes#bubblegum#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#bubblegum#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:gui_orange, '', s:cterm_orange, '', ''],
|
||||
\ }
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#bubblegum#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, '' ] ,
|
||||
\ [ s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, '' ] ,
|
||||
\ [ s:gui_dark_gray, s:gui_green, s:cterm_dark_gray, s:cterm_green, 'bold' ] )
|
||||
@@ -1,102 +0,0 @@
|
||||
" Each theme is contained in its own file and declares variables scoped to the
|
||||
" file. These variables represent the possible "modes" that airline can
|
||||
" detect. The mode is the return value of mode(), which gets converted to a
|
||||
" readable string. The following is a list currently supported modes: normal,
|
||||
" insert, replace, visual, and inactive.
|
||||
"
|
||||
" Each mode can also have overrides. These are small changes to the mode that
|
||||
" don't require a completely different look. "modified" and "paste" are two
|
||||
" such supported overrides. These are simply suffixed to the major mode,
|
||||
" separated by an underscore. For example, "normal_modified" would be normal
|
||||
" mode where the current buffer is modified.
|
||||
"
|
||||
" The theming algorithm is a 2-pass system where the mode will draw over all
|
||||
" parts of the statusline, and then the override is applied after. This means
|
||||
" it is possible to specify a subset of the theme in overrides, as it will
|
||||
" simply overwrite the previous colors. If you want simultaneous overrides,
|
||||
" then they will need to change different parts of the statusline so they do
|
||||
" not conflict with each other.
|
||||
"
|
||||
" First, let's define an empty dictionary and assign it to the "palette"
|
||||
" variable. The # is a separator that maps with the directory structure. If
|
||||
" you get this wrong, Vim will complain loudly.
|
||||
let g:airline#themes#dark#palette = {}
|
||||
|
||||
" First let's define some arrays. The s: is just a VimL thing for scoping the
|
||||
" variables to the current script. Without this, these variables would be
|
||||
" declared globally. Now let's declare some colors for normal mode and add it
|
||||
" to the dictionary. The array is in the format:
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]. See "help attr-list" for valid
|
||||
" values for the "opt" value.
|
||||
let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ]
|
||||
let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ]
|
||||
let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ]
|
||||
let g:airline#themes#dark#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
" Here we define overrides for when the buffer is modified. This will be
|
||||
" applied after g:airline#themes#dark#palette.normal, hence why only certain keys are
|
||||
" declared.
|
||||
let g:airline#themes#dark#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#00005f' , '#00dfff' , 17 , 45 ]
|
||||
let s:I2 = [ '#ffffff' , '#005fff' , 255 , 27 ]
|
||||
let s:I3 = [ '#ffffff' , '#000080' , 15 , 17 ]
|
||||
let g:airline#themes#dark#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#dark#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#dark#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#dark#palette.replace = copy(g:airline#themes#dark#palette.insert)
|
||||
let g:airline#themes#dark#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
let g:airline#themes#dark#palette.replace_modified = g:airline#themes#dark#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#000000' , '#ffaf00' , 232 , 214 ]
|
||||
let s:V2 = [ '#000000' , '#ff5f00' , 232 , 202 ]
|
||||
let s:V3 = [ '#ffffff' , '#5f0000' , 15 , 52 ]
|
||||
let g:airline#themes#dark#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#dark#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#dark#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#dark#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Accents are used to give parts within a section a slightly different look or
|
||||
" color. Here we are defining a "red" accent, which is used by the 'readonly'
|
||||
" part by default. Only the foreground colors are specified, so the background
|
||||
" colors are automatically extracted from the underlying section colors. What
|
||||
" this means is that regardless of which section the part is defined in, it
|
||||
" will be red instead of the section's foreground color. You can also have
|
||||
" multiple parts with accents within a section.
|
||||
let g:airline#themes#dark#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
" Here we define the color map for ctrlp. We check for the g:loaded_ctrlp
|
||||
" variable so that related functionality is loaded iff the user is using
|
||||
" ctrlp. Note that this is optional, and if you do not define ctrlp colors
|
||||
" they will be chosen automatically from the existing palette.
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#dark#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ]
|
||||
let s:N2 = [ '#93a1a1' , '#586e75' , 245 , 240 ]
|
||||
let s:N3 = [ '#93a1a1' , '#073642' , 240 , 233 ]
|
||||
let g:airline#themes#durant#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
|
||||
let g:airline#themes#durant#normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#9e9e9e' , '#303030' , 247 , 236 ]
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ]
|
||||
let g:airline#themes#durant#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#durant#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#durant#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.replace = copy(g:airline#themes#durant#palette.insert)
|
||||
let g:airline#themes#durant#palette.replace.airline_a = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ]
|
||||
|
||||
let g:airline#themes#durant#palette.replace_modified = g:airline#themes#durant#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ]
|
||||
let s:V2 = [ '#ffffff' , '#44403a' , 255, 238 ]
|
||||
let s:V3 = [ '#90a680' , '#2e2d2a' , 64, 235 ]
|
||||
let g:airline#themes#durant#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#durant#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , '#262626' , 239 , 235 , '' ]
|
||||
let s:IA3 = [ '#4e4e4e' , '#303030' , 239 , 236 , '' ]
|
||||
let g:airline#themes#durant#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#durant#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#durant#palette.accents = {
|
||||
\ 'red': [ '#ff0000' , '' , 160 , '' ]
|
||||
\ }
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#durant#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
|
||||
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
|
||||
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
" vim-airline companion theme of Hybrid
|
||||
" (https://github.com/w0ng/vim-hybrid)
|
||||
|
||||
let g:airline#themes#hybrid#palette = {}
|
||||
|
||||
function! airline#themes#hybrid#refresh()
|
||||
let s:N1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:N2 = airline#themes#get_highlight('CursorLine')
|
||||
let s:N3 = airline#themes#get_highlight('PMenu')
|
||||
let g:airline#themes#hybrid#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.normal_modified = {
|
||||
\ 'airline_c': airline#themes#get_highlight2(['Text', 'fg'], ['SpellRare', 'bg'], 'bold')
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#hybrid#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffText', 'bg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellLocal', 'bg'], 'bold')
|
||||
let s:I3 = airline#themes#get_highlight2(['Text', 'fg'], ['SpellCap', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#hybrid#palette.insert_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.insert.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.insert_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#hybrid#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let replace_group = airline#themes#get_highlight('SpellRare')
|
||||
let g:airline#themes#hybrid#palette.replace_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.replace.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.replace_modified.airline_warning = g:airline#themes#hybrid#palette.replace_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Text', 'fg'], ['Folded', 'bg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Text', 'fg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V3 = airline#themes#get_highlight2(['Text', 'fg'], ['Error', 'bg'], 'bold')
|
||||
let g:airline#themes#hybrid#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#hybrid#palette.visual_modified = g:airline#themes#hybrid#palette.normal_modified
|
||||
let g:airline#themes#hybrid#palette.visual.airline_warning = g:airline#themes#hybrid#palette.normal.airline_warning
|
||||
let g:airline#themes#hybrid#palette.visual_modified.airline_warning = g:airline#themes#hybrid#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#hybrid#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#hybrid#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#hybrid#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#hybrid#refresh()
|
||||
@@ -1,52 +0,0 @@
|
||||
let g:airline#themes#jellybeans#palette = {}
|
||||
|
||||
" The name of the function must be 'refresh'.
|
||||
function! airline#themes#jellybeans#refresh()
|
||||
" This theme is an example of how to use helper functions to extract highlight
|
||||
" values from the corresponding colorscheme. It was written in a hurry, so it
|
||||
" is very minimalistic. If you are a jellybeans user and want to make updates,
|
||||
" please send pull requests.
|
||||
|
||||
" Here are examples where the entire highlight group is copied and an airline
|
||||
" compatible color array is generated.
|
||||
let s:N1 = airline#themes#get_highlight('DbgCurrent', 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#jellybeans#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let g:airline#themes#jellybeans#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#jellybeans#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffb964', '', 215, '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd', 'bold')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#jellybeans#palette.insert_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('WildMenu', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#jellybeans#palette.replace_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" Sometimes you want to mix and match colors from different groups, you can do
|
||||
" that with this method.
|
||||
let s:V1 = airline#themes#get_highlight2(['TabLineSel', 'bg'], ['DiffDelete', 'bg'], 'bold')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#jellybeans#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#jellybeans#palette.visual_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
|
||||
" And of course, you can always do it manually as well.
|
||||
let s:IA = [ '#444444', '#1c1c1c', 237, 234 ]
|
||||
let g:airline#themes#jellybeans#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#jellybeans#palette.inactive_modified = g:airline#themes#jellybeans#palette.normal_modified
|
||||
endfunction
|
||||
|
||||
call airline#themes#jellybeans#refresh()
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
"
|
||||
" Colorscheme: Kalisi for airline. Inspired by powerline.
|
||||
" Arthur Jaron
|
||||
" hifreeo@gmail.com
|
||||
" 24.10.2014
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#0087ff' , '#ffffff','33','231']
|
||||
let s:V2 = [ '#005faf' , '#5fafff','25','75']
|
||||
let s:V3 = [ '#87d7ff' , '#005faf','117','25']
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#d75fff' , '#ffffff','171','231']
|
||||
let s:R2 = [ '#5f005f' , '#d75fff','53','171']
|
||||
let s:R3 = [ '#ff87ff' , '#8700af','213','91']
|
||||
|
||||
let g:airline#themes#kalisi#palette = {}
|
||||
|
||||
|
||||
function! airline#themes#kalisi#refresh()
|
||||
|
||||
let s:StatusLine = airline#themes#get_highlight('StatusLine')
|
||||
let s:StatusLineNC = airline#themes#get_highlight('StatusLineNC')
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#ffffff' , '#e80000','231','160']
|
||||
let s:I2 = [ '#ff0000' , '#5f0000','196','52']
|
||||
let s:I3 = s:StatusLine
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#005f00' , '#afd700','22','148']
|
||||
let s:N2 = [ '#afd700' , '#005f00','148','22']
|
||||
let s:N3 = s:StatusLine
|
||||
|
||||
" Tabline Plugin
|
||||
let g:airline#themes#kalisi#palette.tabline = {
|
||||
\ 'airline_tab': ['#bcbcbc', '#005f00','250','22'],
|
||||
\ 'airline_tabsel': ['#404042', '#A6DB29','238','148'],
|
||||
\ 'airline_tabtype':['#afd700', '#204d20','148','22'],
|
||||
\ 'airline_tabfill': s:StatusLine,
|
||||
\ 'airline_tabhid': ['#c5c5c5', '#404042','251','238'],
|
||||
\ 'airline_tabmod': ['#d7ff00', '#afd700','190','148'],
|
||||
\ 'airline_tabmod_unsel': ['#d7ff00', '#005f00','190','22']
|
||||
\ }
|
||||
|
||||
let g:airline#themes#kalisi#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#kalisi#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kalisi#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kalisi#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
|
||||
" Inactive Mode
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#kalisi#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#kalisi#palette.inactive_modified = {
|
||||
\ 'airline_c': ['#d7ff00', s:IA[1],'190',s:IA[3]],
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#kalisi#refresh()
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kalisi#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ s:StatusLine,
|
||||
\ ['#afd700', '#005f00','148','22'],
|
||||
\ [ '#005f00' , '#afd700' , '22','148']
|
||||
\)
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
let g:airline#themes#kolor#palette = {}
|
||||
|
||||
let s:N1 = [ '#e2e2e2' , '#4f3598' , 254 , 56 ]
|
||||
let s:N2 = [ '#ff5fd7' , '#242322' , 206 , 234 ]
|
||||
let s:N3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
|
||||
let g:airline#themes#kolor#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#kolor#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#4f3598' , 254 , 56 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#242322' , '#7eaefd' , 234 , 111 ]
|
||||
let s:I2 = [ '#75d7d8' , '#242322' , 80 , 234 ]
|
||||
let s:I3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#kolor#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#7eaefd' , 234 , 111 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.replace = copy(g:airline#themes#kolor#palette.insert)
|
||||
let g:airline#themes#kolor#palette.replace.airline_a = [ s:I2[0] , '#005154' , s:I2[2] , 23 , '' ]
|
||||
let g:airline#themes#kolor#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#e2e2e2' , '#005154' , 254 , 23 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:V1 = [ '#242322' , '#e6987a' , 234 , 180 ]
|
||||
let s:V2 = [ '#dbc570' , '#242322' , 186 , 234 ]
|
||||
let s:V3 = [ '#e2e2e2' , '#4a4a4a' , 254 , 238 ]
|
||||
let g:airline#themes#kolor#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#kolor#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#242322' , '#e6987a' , 234 , 180 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let s:IA2 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 ]
|
||||
let s:IA3 = [ '#b2b2b2' , '#4a4a4a' , 247 , 238 , '' ]
|
||||
let g:airline#themes#kolor#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#kolor#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#875faf' , '' , 97 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#kolor#palette.accents = {
|
||||
\ 'red': [ '#d96e8a' , '' , 168 , '' ]
|
||||
\ }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#kolor#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#e2e2e2' , '#4a4a4a' , 254 , 238 , '' ],
|
||||
\ [ '#e2e2e2' , '#242322' , 254 , 234 , '' ],
|
||||
\ [ '#e2e2e2' , '#4f3598' , 254 , 56 , 'bold' ])
|
||||
@@ -1,62 +0,0 @@
|
||||
" vim-airline companion theme of Laederon
|
||||
" (https://github.com/Donearm/Laederon)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#1a1a18' , '#ffffff' , 232 , 255 ] " blackestgravel & snow
|
||||
let s:N2 = [ '#ffffff' , '#44403a' , 255, 238 ] " snow & deepgravel
|
||||
let s:N3 = [ '#90a680' , '#2e2d2a' , 64, 235 ] " dilutedpaint & darkgravel
|
||||
let s:N4 = [ '#777470' , 240 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#1693a5' , 232 , 62 ] " blackestgravel & crystallake
|
||||
let s:I2 = [ '#515744' , '#44403a' , 101 , 238 ] " lichen & deepgravel
|
||||
let s:I3 = [ '#1693a5' , '#2e2d2a' , 39 , 235 ] " crystallake & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1a1a18' , '#ab3e5d' , 232 , 161 ] " blackestgravel & raspberry
|
||||
let s:V2 = [ '#000000' , '#908571' , 16 , 252 ] " coal & winterterrain
|
||||
let s:V3 = [ '#ab3e5d' , '#8c7f77' , 161 , 245 ] " raspberry & wetcoldterrain
|
||||
let s:V4 = [ '#515744' , 101 ] " lichen
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#233e09' , 22 ] " oakleaf
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#ab3e5d' , 161 ] " raspberry
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ]
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette = {}
|
||||
|
||||
let g:airline#themes#laederon#palette.accents = {
|
||||
\ 'red': [ '#ef393d' , '' , 196 , '' , '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#laederon#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#laederon#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#laederon#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#laederon#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.replace = copy(airline#themes#laederon#palette.insert)
|
||||
let g:airline#themes#laederon#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#laederon#palette.replace_modified = g:airline#themes#laederon#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#laederon#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#laederon#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#laederon#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
let g:airline#themes#light#palette = {}
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005fff' , 255 , 27 ]
|
||||
let s:N2 = [ '#000087' , '#00dfff' , 18 , 45 ]
|
||||
let s:N3 = [ '#005fff' , '#afffff' , 27 , 159 ]
|
||||
let g:airline#themes#light#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#light#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#00875f' , 255 , 29 ]
|
||||
let s:I2 = [ '#005f00' , '#00df87' , 22 , 42 ]
|
||||
let s:I3 = [ '#005f5f' , '#afff87' , 23 , 156 ]
|
||||
let g:airline#themes#light#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#light#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#light#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#light#palette.replace = copy(g:airline#themes#light#palette.insert)
|
||||
let g:airline#themes#light#palette.replace.airline_a = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#light#palette.replace_modified = g:airline#themes#light#palette.insert_modified
|
||||
|
||||
|
||||
let s:V1 = [ '#ffffff' , '#ff5f00' , 255 , 202 ]
|
||||
let s:V2 = [ '#5f0000' , '#ffaf00' , 52 , 214 ]
|
||||
let s:V3 = [ '#df5f00' , '#ffff87' , 166 , 228 ]
|
||||
let g:airline#themes#light#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#light#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:IA1 = [ '#666666' , '#b2b2b2' , 242 , 249 , '' ]
|
||||
let s:IA2 = [ '#8a8a8a' , '#d0d0d0' , 245 , 252 , '' ]
|
||||
let s:IA3 = [ '#a8a8a8' , '#ffffff' , 248 , 255 , '' ]
|
||||
let g:airline#themes#light#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#light#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000' , '' , 160 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
let g:airline#themes#lucius#palette = {}
|
||||
|
||||
function! airline#themes#lucius#refresh()
|
||||
|
||||
let s:N1 = airline#themes#get_highlight('StatusLine')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#lucius#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let modified_group = airline#themes#get_highlight('Statement')
|
||||
let g:airline#themes#lucius#palette.normal_modified = {
|
||||
\ 'airline_c': [modified_group[0], '', modified_group[2], '', '']
|
||||
\ }
|
||||
|
||||
let warning_group = airline#themes#get_highlight('DiffDelete')
|
||||
let g:airline#themes#lucius#palette.normal.airline_warning = warning_group
|
||||
let g:airline#themes#lucius#palette.normal_modified.airline_warning = warning_group
|
||||
|
||||
let s:I1 = airline#themes#get_highlight('DiffAdd')
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#lucius#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#lucius#palette.insert_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.insert.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.insert_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('DiffChange')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#lucius#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#lucius#palette.replace_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.replace.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.replace_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:V1 = airline#themes#get_highlight('Cursor')
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#lucius#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#lucius#palette.visual_modified = g:airline#themes#lucius#palette.normal_modified
|
||||
let g:airline#themes#lucius#palette.visual.airline_warning = g:airline#themes#lucius#palette.normal.airline_warning
|
||||
let g:airline#themes#lucius#palette.visual_modified.airline_warning = g:airline#themes#lucius#palette.normal_modified.airline_warning
|
||||
|
||||
let s:IA = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#lucius#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#lucius#palette.inactive_modified = {
|
||||
\ 'airline_c': [ modified_group[0], '', modified_group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let g:airline#themes#lucius#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
endfunction
|
||||
|
||||
call airline#themes#lucius#refresh()
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
" vim-airline companion theme of Luna
|
||||
" (https://github.com/Pychimp/vim-luna)
|
||||
|
||||
let g:airline#themes#luna#palette = {}
|
||||
|
||||
let g:airline#themes#luna#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
let s:N1 = [ '#ffffff' , '#005252' , 231 , 36 ]
|
||||
let s:N2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:N3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#luna#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#ffffff' , '#789f00' , 231 , 106 ]
|
||||
let s:I2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:I3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#luna#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#005e5e' , 255 , 52 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#luna#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#luna#palette.replace = copy(g:airline#themes#luna#palette.insert)
|
||||
let g:airline#themes#luna#palette.replace.airline_a = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ]
|
||||
let g:airline#themes#luna#palette.replace_modified = g:airline#themes#luna#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff8036' , 222 , 208 ]
|
||||
let s:V2 = [ '#ffffff' , '#003f3f' , 231 , 29 ]
|
||||
let s:V3 = [ '#ffffff' , '#002b2b' , 231 , 23 ]
|
||||
let g:airline#themes#luna#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#luna#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#450000' , 231 , 52 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#4e4e4e' , '#002b2b' , 59 , 23 , '' ]
|
||||
let g:airline#themes#luna#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#luna#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e20000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#luna#palette.tabline = {
|
||||
\ 'airline_tab': ['#2aa198', '#003f3f', 231, 29, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#2e8b57', 231, 36, ''],
|
||||
\ 'airline_tabtype': ['#ffffff', '#005252', 231, 36, ''],
|
||||
\ 'airline_tabfill': ['#ffffff', '#002b2b', 231, 23, ''],
|
||||
\ 'airline_tabmod': ['#ffffff', '#780000', 231, 88, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ffffff', '#5f0000', 231, 88 ]
|
||||
let g:airline#themes#luna#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#luna#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#luna#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#luna#palette.normal.airline_warning
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#luna#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] ,
|
||||
\ [ '#ffffff' , '#005252' , 231 , 36 , '' ] ,
|
||||
\ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] )
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
let g:airline#themes#molokai#palette = {}
|
||||
|
||||
let g:airline#themes#molokai#palette.accents = {
|
||||
\ 'red': [ '#66d9ef' , '' , 81 , '' , '' ],
|
||||
\ }
|
||||
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#080808' , '#e6db74' , 232 , 144 ] " mode
|
||||
let s:N2 = [ '#f8f8f0' , '#232526' , 253 , 16 ] " info
|
||||
let s:N3 = [ '#f8f8f0' , '#465457' , 253 , 67 ] " statusline
|
||||
|
||||
let g:airline#themes#molokai#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#molokai#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#e6db74' , 232 , 144 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#080808' , '#66d9ef' , 232 , 81 ]
|
||||
let s:I2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:I3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#molokai#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Replace mode
|
||||
let g:airline#themes#molokai#palette.replace = copy(g:airline#themes#molokai#palette.insert)
|
||||
let g:airline#themes#molokai#palette.replace.airline_a = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ]
|
||||
let g:airline#themes#molokai#palette.replace_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#ef5939' , 232 , 166 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#080808' , '#fd971f' , 232 , 208 ]
|
||||
let s:V2 = [ '#f8f8f0' , '#232526' , 253 , 16 ]
|
||||
let s:V3 = [ '#f8f8f0' , '#465457' , 253 , 67 ]
|
||||
|
||||
let g:airline#themes#molokai#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#molokai#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#080808' , '#fd971f' , 232 , 208 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" Inactive
|
||||
let s:IA = [ '#1b1d1e' , '#465457' , 233 , 67 , '' ]
|
||||
let g:airline#themes#molokai#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#molokai#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#f8f8f0' , '' , 253 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
" CtrlP
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#molokai#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] ,
|
||||
\ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] ,
|
||||
\ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] )
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
let g:airline#themes#monochrome#palette = {}
|
||||
|
||||
function! airline#themes#monochrome#refresh()
|
||||
let s:SL = airline#themes#get_highlight('StatusLine')
|
||||
let g:airline#themes#monochrome#palette.normal = airline#themes#generate_color_map(s:SL, s:SL, s:SL)
|
||||
let g:airline#themes#monochrome#palette.insert = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.replace = g:airline#themes#monochrome#palette.normal
|
||||
let g:airline#themes#monochrome#palette.visual = g:airline#themes#monochrome#palette.normal
|
||||
|
||||
let s:SLNC = airline#themes#get_highlight('StatusLineNC')
|
||||
let g:airline#themes#monochrome#palette.inactive = airline#themes#generate_color_map(s:SLNC, s:SLNC, s:SLNC)
|
||||
endfunction
|
||||
|
||||
call airline#themes#monochrome#refresh()
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
let g:airline#themes#murmur#palette = {}
|
||||
|
||||
" Color palette
|
||||
let s:cterm_termbg = 237 " Background for branch and file format blocks
|
||||
let s:gui_termbg = '#5F5F5F'
|
||||
let s:cterm_termfg = 144 " Foreground for branch and file format blocks
|
||||
let s:gui_termfg = '#AFAF87'
|
||||
|
||||
let s:cterm_termbg2 = 234 " Background for middle block
|
||||
let s:gui_termbg2 = '#1C1C1C'
|
||||
let s:cterm_termfg2 = 39 " Foreground for middle block
|
||||
let s:gui_termfg2 = '#F5F5F5'
|
||||
|
||||
let s:cterm_normalbg = 27 " Background for normal mode and file position blocks
|
||||
let s:gui_normalbg = '#5F87FF'
|
||||
let s:cterm_normalfg = 15 " Foreground for normal mode and file position blocks
|
||||
let s:gui_normalfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_insertbg = 70 " Background for insert mode and file position blocks
|
||||
let s:gui_insertbg = '#87AF5F'
|
||||
let s:cterm_insertfg = 15 " Foreground for insert mode and file position blocks
|
||||
let s:gui_insertfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_visualbg = 166 " Background for visual mode and file position blocks
|
||||
let s:gui_visualbg = '#ff8c00'
|
||||
let s:cterm_visualfg = 15 " Foreground for visual mode and file position blocks
|
||||
let s:gui_visualfg = '#FFFFFF'
|
||||
|
||||
let s:cterm_replacebg = 88 " Background for replace mode and file position blocks
|
||||
let s:gui_replacebg = '#870000'
|
||||
let s:cterm_replacefg = 15 " Foreground for replace mode and file position blocks
|
||||
let s:gui_replacefg = '#FFFFFF'
|
||||
|
||||
let s:cterm_alert = 88 " Modified file alert color
|
||||
let s:gui_alert = '#870000'
|
||||
|
||||
let s:cterm_inactivebg = 234 " Background for inactive mode
|
||||
let s:gui_inactivebg = '#1C1C1C'
|
||||
let s:cterm_inactivefg = 239 " Foreground for inactive mode
|
||||
let s:gui_inactivefg = '#4E4E4E'
|
||||
|
||||
" Branch and file format
|
||||
let s:BB = [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg] " Branch and file format blocks
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg] " Outside blocks in normal mode
|
||||
let s:N2 = [s:gui_termfg2, s:gui_termbg2, s:cterm_normalbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.normal = airline#themes#generate_color_map(s:N1, s:BB, s:N2)
|
||||
let g:airline#themes#murmur#palette.normal_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:gui_insertfg, s:gui_insertbg, s:cterm_insertfg, s:cterm_insertbg] " Outside blocks in insert mode
|
||||
let s:I2 = [s:gui_insertbg, s:gui_termbg2, s:cterm_insertbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.insert = airline#themes#generate_color_map(s:I1, s:BB, s:I2)
|
||||
let g:airline#themes#murmur#palette.insert_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:gui_replacefg, s:gui_replacebg, s:cterm_replacefg, s:cterm_replacebg] " Outside blocks in replace mode
|
||||
let s:R2 = [s:gui_termfg, s:gui_termbg2, s:cterm_termfg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.replace = airline#themes#generate_color_map(s:R1, s:BB, s:R2)
|
||||
let g:airline#themes#murmur#palette.replace_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:gui_visualfg, s:gui_visualbg, s:cterm_visualfg, s:cterm_visualbg] " Outside blocks in visual mode
|
||||
let s:V2 = [s:gui_visualbg, s:gui_termbg2, s:cterm_visualbg, s:cterm_termbg2] " Middle block
|
||||
let g:airline#themes#murmur#palette.visual = airline#themes#generate_color_map(s:V1, s:BB, s:V2)
|
||||
let g:airline#themes#murmur#palette.visual_modified = {'airline_c': [s:gui_alert, s:gui_termbg2, s:cterm_alert, s:cterm_termbg2, 'bold'] ,}
|
||||
|
||||
" Inactive mode
|
||||
let s:IA1 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA2 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let s:IA3 = [s:gui_inactivefg, s:gui_inactivebg, s:cterm_inactivefg, s:cterm_inactivebg, '']
|
||||
let g:airline#themes#murmur#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
|
||||
" CtrlP plugin colors
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#murmur#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [s:gui_normalfg, s:gui_normalbg, s:cterm_normalfg, s:cterm_normalbg, ''],
|
||||
\ [s:gui_termfg, s:gui_termbg, s:cterm_termfg, s:cterm_termbg, ''],
|
||||
\ [s:gui_termfg2, s:gui_termbg2, s:cterm_termfg2, s:cterm_termbg2, 'bold'])
|
||||
@@ -1,46 +0,0 @@
|
||||
" Theme to mimic the default colorscheme of powerline
|
||||
" Not 100% the same so it's powerline... ish.
|
||||
"
|
||||
" Differences from default powerline:
|
||||
" * Paste indicator isn't colored different
|
||||
" * Far right hand section matches the color of the mode indicator
|
||||
"
|
||||
" Differences from other airline themes:
|
||||
" * No color differences when you're in a modified buffer
|
||||
" * Visual mode only changes the mode section. Otherwise
|
||||
" it appears the same as normal mode
|
||||
|
||||
" Normal mode " fg & bg
|
||||
let s:N1 = [ '#005f00' , '#afd700' , 22 , 148 ] " darkestgreen & brightgreen
|
||||
let s:N2 = [ '#9e9e9e' , '#303030' , 247 , 236 ] " gray8 & gray2
|
||||
let s:N3 = [ '#ffffff' , '#121212' , 231 , 233 ] " white & gray4
|
||||
|
||||
" Insert mode " fg & bg
|
||||
let s:I1 = [ '#005f5f' , '#ffffff' , 23 , 231 ] " darkestcyan & white
|
||||
let s:I2 = [ '#5fafd7' , '#0087af' , 74 , 31 ] " darkcyan & darkblue
|
||||
let s:I3 = [ '#87d7ff' , '#005f87' , 117 , 24 ] " mediumcyan & darkestblue
|
||||
|
||||
" Visual mode " fg & bg
|
||||
let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestorange
|
||||
|
||||
" Replace mode " fg & bg
|
||||
let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred
|
||||
|
||||
let g:airline#themes#powerlineish#palette = {}
|
||||
|
||||
let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let g:airline#themes#powerlineish#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#powerlineish#palette.insert_replace = {
|
||||
\ 'airline_a': [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.visual = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] }
|
||||
|
||||
let g:airline#themes#powerlineish#palette.replace = copy(airline#themes#powerlineish#palette.normal)
|
||||
let g:airline#themes#powerlineish#palette.replace.airline_a = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ]
|
||||
|
||||
|
||||
let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ]
|
||||
let g:airline#themes#powerlineish#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
let g:airline#themes#raven#palette = {}
|
||||
|
||||
let g:airline#themes#raven#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N2 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let s:N3 = [ '#c8c8c8' , '#2e2e2e' , 188 , 235 ]
|
||||
let g:airline#themes#raven#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#raven#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I2 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let s:I3 = [ '#11c279' , '#2e2e2e' , 36 , 235 ]
|
||||
let g:airline#themes#raven#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#raven#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#raven#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#2e2e2e' , s:I1[2] , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.replace = copy(g:airline#themes#raven#palette.insert)
|
||||
let g:airline#themes#raven#palette.replace.airline_a = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace.airline_z = [ '#e60000' , s:I1[1] , 160 , s:I1[3] , '' ]
|
||||
let g:airline#themes#raven#palette.replace_modified = g:airline#themes#raven#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V2 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let s:V3 = [ '#6565ff' , '#2e2e2e' , 63 , 235 ]
|
||||
let g:airline#themes#raven#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#raven#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#2e2e2e' , 166 , 235 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#5e5e5e' , '#222222' , 59 , 235 , '' ]
|
||||
let g:airline#themes#raven#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#raven#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#raven#palette.tabline = {
|
||||
\ 'airline_tab': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabsel': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ 'airline_tabtype': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabfill': ['#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ],
|
||||
\ 'airline_tabmod': ['#2e2e2e' , '#a4c639' , 235 , 149 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#2e2e2e', 196, 235 ]
|
||||
let g:airline#themes#raven#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#raven#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#raven#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#raven#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#raven#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#c8c8c8' , '#2e2e2e' , 188 , 235 , '' ] ,
|
||||
\ [ '#2e2e2e' , '#a4c639' , 235 , 149 , '' ] )
|
||||
@@ -1,41 +0,0 @@
|
||||
let g:airline#themes#serene#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:termbg = 232
|
||||
let s:termsep = 236
|
||||
let s:guisep = '#303030'
|
||||
|
||||
let s:N1 = [ '#00dfff' , s:guibg , 45 , s:termbg ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:N3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
|
||||
let g:airline#themes#serene#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#serene#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#5fff00' , s:guibg , 82 , s:termbg ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:I3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#serene#palette.insert_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
let g:airline#themes#serene#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#serene#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#serene#palette.replace_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:V1 = [ '#dfdf00' , s:guibg , 184 , s:termbg ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg , 202 , s:termbg ]
|
||||
let s:V3 = [ '#767676' , s:guibg , 7 , s:termbg ]
|
||||
let g:airline#themes#serene#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#serene#palette.visual_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guisep , 239 , s:termsep , '' ]
|
||||
let g:airline#themes#serene#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#serene#palette.inactive_modified = copy(g:airline#themes#serene#palette.normal_modified)
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
let g:airline#themes#silver#palette = {}
|
||||
|
||||
let g:airline#themes#silver#palette.accents = {
|
||||
\ 'red': [ '#ff2121' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N2 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let s:N3 = [ '#414141' , '#e1e1e1' , 59 , 188 ]
|
||||
let g:airline#themes#silver#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#silver#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:I1 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I2 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let s:I3 = [ '#0d935c' , '#e1e1e1' , 29 , 188 ]
|
||||
let g:airline#themes#silver#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#silver#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#silver#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#e1e1e1' , s:I1[2] , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.replace = copy(g:airline#themes#silver#palette.insert)
|
||||
let g:airline#themes#silver#palette.replace.airline_a = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace.airline_z = [ '#b30000' , s:I1[1] , 124 , s:I1[3] , '' ]
|
||||
let g:airline#themes#silver#palette.replace_modified = g:airline#themes#silver#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V2 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let s:V3 = [ '#0000b3' , '#e1e1e1' , 19 , 188 ]
|
||||
let g:airline#themes#silver#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#silver#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '#e1e1e1' , 166 , 188 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#a1a1a1' , '#dddddd' , 145 , 188 , '' ]
|
||||
let g:airline#themes#silver#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#silver#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#e25000' , '' , 166 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#silver#palette.tabline = {
|
||||
\ 'airline_tab': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabsel': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ 'airline_tabtype': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabfill': ['#414141' , '#e1e1e1' , 59 , 188 , '' ],
|
||||
\ 'airline_tabmod': ['#e1e1e1' , '#007599' , 188 , 30 , '' ],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#ff0000', '#e1e1e1', 196, 188 ]
|
||||
let g:airline#themes#silver#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#silver#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#silver#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#silver#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#silver#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#414141' , '#e1e1e1' , 59 , 188 , '' ] ,
|
||||
\ [ '#e1e1e1' , '#007599' , 188 , 30 , '' ] )
|
||||
@@ -1,46 +0,0 @@
|
||||
let g:airline#themes#simple#palette = {}
|
||||
|
||||
let s:guibg = '#080808'
|
||||
let s:guibg2 = '#1c1c1c'
|
||||
let s:termbg = 232
|
||||
let s:termbg2= 234
|
||||
|
||||
let s:N1 = [ s:guibg , '#00dfff' , s:termbg , 45 ]
|
||||
let s:N2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg]
|
||||
let g:airline#themes#simple#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#simple#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ s:guibg, '#5fff00' , s:termbg , 82 ]
|
||||
let s:I2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:I3 = [ '#767676' , s:guibg, 243 , s:termbg ]
|
||||
let g:airline#themes#simple#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#simple#palette.insert_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
let g:airline#themes#simple#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#simple#palette.replace = {
|
||||
\ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
|
||||
|
||||
let s:V1 = [ s:guibg, '#dfdf00' , s:termbg , 184 ]
|
||||
let s:V2 = [ '#ff5f00' , s:guibg2, 202 , s:termbg2 ]
|
||||
let s:V3 = [ '#767676' , s:guibg, 243 , s:termbg ]
|
||||
let g:airline#themes#simple#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#simple#palette.visual_modified = copy(g:airline#themes#simple#palette.normal_modified)
|
||||
|
||||
|
||||
let s:IA = [ '#4e4e4e' , s:guibg , 239 , s:termbg , '' ]
|
||||
let s:IA2 = [ '#4e4e4e' , s:guibg2 , 239 , s:termbg2 , '' ]
|
||||
let g:airline#themes#simple#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA2, s:IA2)
|
||||
let g:airline#themes#simple#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#df0000', '', 160, '', '' ] ,
|
||||
\ }
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
" vim-airline companion theme of Sol
|
||||
" (https://github.com/Pychimp/vim-sol)
|
||||
|
||||
let g:airline#themes#sol#palette = {}
|
||||
|
||||
let g:airline#themes#sol#palette.accents = {
|
||||
\ 'red': [ '#ffffff' , '' , 231 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let s:N1 = [ '#343434' , '#a0a0a0' , 237 , 248 ]
|
||||
let s:N2 = [ '#343434' , '#b3b3b3' , 237 , 250 ]
|
||||
let s:N3 = [ '#343434' , '#c7c7c7' , 237 , 252 ]
|
||||
let g:airline#themes#sol#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#sol#palette.normal_modified = {
|
||||
\ 'airline_c': [ '#ffffff' , '#ff6868' , 237 , 209 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let s:I1 = [ '#eeeeee' , '#09643f' , 255 , 30 ]
|
||||
let s:I2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:I3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#sol#palette.insert_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
let g:airline#themes#sol#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , '#09643f' , s:I1[2] , 30 , '' ] ,
|
||||
\ }
|
||||
|
||||
|
||||
let g:airline#themes#sol#palette.replace = copy(g:airline#themes#sol#palette.insert)
|
||||
let g:airline#themes#sol#palette.replace.airline_a = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace.airline_z = [ s:I1[0] , '#ff2121' , s:I1[2] , 196 , '' ]
|
||||
let g:airline#themes#sol#palette.replace_modified = g:airline#themes#sol#palette.insert_modified
|
||||
|
||||
let s:V1 = [ '#ffff9a' , '#ff6003' , 222 , 202 ]
|
||||
let s:V2 = [ '#343434' , '#a3a3a3' , 237 , 249 ]
|
||||
let s:V3 = [ '#343434' , '#b0b0b0' , 237 , 250 ]
|
||||
let g:airline#themes#sol#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#sol#palette.visual_modified = {
|
||||
\ 'airline_c': [ '#343434' , '#ffdbc7' , 237 , 216 , '' ] ,
|
||||
\ }
|
||||
|
||||
let s:IA = [ '#777777' , '#c7c7c7' , 244 , 251 , '' ]
|
||||
let g:airline#themes#sol#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#sol#palette.inactive_modified = {
|
||||
\ 'airline_c': [ '#ff3535' , '' , 203 , '' , '' ] ,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#sol#palette.tabline = {
|
||||
\ 'airline_tab': ['#343434', '#b3b3b3', 237, 250, ''],
|
||||
\ 'airline_tabsel': ['#ffffff', '#004b9a', 231, 31 , ''],
|
||||
\ 'airline_tabtype': ['#343434', '#a0a0a0', 237, 248, ''],
|
||||
\ 'airline_tabfill': ['#343434', '#c7c7c7', 237, 251, ''],
|
||||
\ 'airline_tabmod': ['#343434', '#ffdbc7', 237, 216, ''],
|
||||
\ }
|
||||
|
||||
let s:WI = [ '#eeeeee', '#e33900', 255, 166 ]
|
||||
let g:airline#themes#sol#palette.normal.airline_warning = [
|
||||
\ s:WI[0], s:WI[1], s:WI[2], s:WI[3]
|
||||
\ ]
|
||||
|
||||
let g:airline#themes#sol#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#sol#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#sol#palette.normal.airline_warning
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#sol#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#343434' , '#c7c7c7' , 237 , 251 , '' ] ,
|
||||
\ [ '#343434' , '#b3b3b3' , 237 , 250 , '' ] ,
|
||||
\ [ '#eeeeee' , '#007fff' , 255 , 27 , '' ] )
|
||||
@@ -1,176 +0,0 @@
|
||||
let g:airline#themes#solarized#palette = {}
|
||||
|
||||
function! airline#themes#solarized#refresh()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:background = get(g:, 'airline_solarized_bg', &background)
|
||||
let s:ansi_colors = get(g:, 'solarized_termcolors', 16) != 256 && &t_Co >= 16 ? 1 : 0
|
||||
let s:tty = &t_Co == 8
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colors
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Base colors
|
||||
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#002b36'}
|
||||
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#073642'}
|
||||
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#586e75'}
|
||||
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#657b83'}
|
||||
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#839496'}
|
||||
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#93a1a1'}
|
||||
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#eee8d5'}
|
||||
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 230), 'g': '#fdf6e3'}
|
||||
let s:yellow = {'t': s:ansi_colors ? 3 : (s:tty ? '3' : 136), 'g': '#b58900'}
|
||||
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#cb4b16'}
|
||||
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#dc322f'}
|
||||
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#d33682'}
|
||||
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6c71c4'}
|
||||
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#268bd2'}
|
||||
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#2aa198'}
|
||||
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#859900'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
" NOTE: These are easily tweakable mappings. The actual mappings get
|
||||
" the specific gui and terminal colors from the base color dicts.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Normal mode
|
||||
if s:background == 'dark'
|
||||
let s:N1 = [s:base3, s:base1, 'bold']
|
||||
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
|
||||
let s:N3 = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:N1 = [s:base2, s:base00, 'bold']
|
||||
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
|
||||
let s:N3 = [s:base1, s:base2, '']
|
||||
endif
|
||||
let s:NF = [s:orange, s:N3[1], '']
|
||||
let s:NW = [s:base3, s:orange, '']
|
||||
if s:background == 'dark'
|
||||
let s:NM = [s:base1, s:N3[1], '']
|
||||
let s:NMi = [s:base2, s:N3[1], '']
|
||||
else
|
||||
let s:NM = [s:base01, s:N3[1], '']
|
||||
let s:NMi = [s:base02, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:N1[0], s:yellow, 'bold']
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:N1[0], s:magenta, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let s:VF = s:NF
|
||||
let s:VM = s:NM
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:N1[0], s:red, '']
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let s:RM = s:NM
|
||||
let s:RF = s:NF
|
||||
|
||||
" Inactive, according to VertSplit in solarized
|
||||
" (bg dark: base00; bg light: base0)
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base02, s:base00, '']
|
||||
else
|
||||
let s:IA = [s:base2, s:base0, '']
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Actual mappings
|
||||
" WARNING: Don't modify this section unless necessary.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
|
||||
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
|
||||
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
|
||||
let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.accents = {
|
||||
\ 'red': s:NFa,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#solarized#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
|
||||
let g:airline#themes#solarized#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.normal = airline#themes#generate_color_map(
|
||||
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
|
||||
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
|
||||
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.normal.airline_warning = [
|
||||
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.normal_modified = {
|
||||
\ 'airline_c': [s:NM[0].g, s:NM[1].g,
|
||||
\ s:NM[0].t, s:NM[1].t, s:NM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.insert = airline#themes#generate_color_map(
|
||||
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
|
||||
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
|
||||
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.insert.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified = {
|
||||
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
|
||||
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual = airline#themes#generate_color_map(
|
||||
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
|
||||
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.visual.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified = {
|
||||
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
|
||||
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace = airline#themes#generate_color_map(
|
||||
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
|
||||
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
|
||||
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
|
||||
|
||||
let g:airline#themes#solarized#palette.replace.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified = {
|
||||
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
|
||||
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
|
||||
|
||||
let g:airline#themes#solarized#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#solarized#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline = {}
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tab = [
|
||||
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
|
||||
|
||||
let g:airline#themes#solarized#palette.tabline.airline_tabtype = [
|
||||
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
|
||||
endfunction
|
||||
|
||||
call airline#themes#solarized#refresh()
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
let g:airline#themes#tomorrow#palette = {}
|
||||
|
||||
function! airline#themes#tomorrow#refresh()
|
||||
let g:airline#themes#tomorrow#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Directory', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Pmenu')
|
||||
let s:N3 = airline#themes#get_highlight('CursorLine')
|
||||
let g:airline#themes#tomorrow#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
|
||||
let group = airline#themes#get_highlight('vimCommand')
|
||||
let g:airline#themes#tomorrow#palette.normal_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['Normal', 'bg'], ['MoreMsg', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['MoreMsg', 'fg'], ['Normal', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#tomorrow#palette.insert_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight('Error', 'bold')
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#tomorrow#palette.replace_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['Normal', 'bg'], ['Constant', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Constant', 'fg'], ['Normal', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#tomorrow#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#tomorrow#palette.visual_modified = g:airline#themes#tomorrow#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight2(['NonText', 'fg'], ['CursorLine', 'bg'])
|
||||
let g:airline#themes#tomorrow#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#tomorrow#palette.inactive_modified = {
|
||||
\ 'airline_c': [ group[0], '', group[2], '', '' ]
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#tomorrow#refresh()
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
" vim-airline companion theme of Ubaryd
|
||||
" (https://github.com/Donearm/Ubaryd)
|
||||
|
||||
" Normal mode
|
||||
let s:N1 = [ '#141413' , '#c7b386' , 232 , 252 ] " blackestgravel & bleaksand
|
||||
let s:N2 = [ '#c7b386' , '#45413b' , 252, 238 ] " bleaksand & deepgravel
|
||||
let s:N3 = [ '#b88853' , '#242321' , 137, 235 ] " toffee & darkgravel
|
||||
let s:N4 = [ '#857f78' , 243 ] " gravel
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#1a1a18' , '#fade3e' , 232 , 221 ] " blackestgravel & warmcorn
|
||||
let s:I2 = [ '#c7b386' , '#45413b' , 252 , 238 ] " bleaksand & deepgravel
|
||||
let s:I3 = [ '#f4cf86' , '#242321' , 222 , 235 ] " lighttannedskin & darkgravel
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#1c1b1a' , '#9a4820' , 233 , 88 ] " blackgravel & warmadobe
|
||||
let s:V2 = [ '#000000' , '#88633f' , 16 , 95 ] " coal & cappuccino
|
||||
let s:V3 = [ '#88633f' , '#c7b386' , 95 , 252 ] " cappuccino & bleaksand
|
||||
let s:V4 = [ '#c14c3d' , 160 ] " tannedumbrella
|
||||
|
||||
" Replace mode
|
||||
let s:RE = [ '#c7915b' , 173 ] " nut
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon
|
||||
|
||||
let s:IA = [ s:N2[1], s:N3[1], s:N2[3], s:N3[3], '' ]
|
||||
|
||||
let g:airline#themes#ubaryd#palette = {}
|
||||
|
||||
let g:airline#themes#ubaryd#palette.accents = {
|
||||
\ 'red': [ '#ff7400' , '' , 196 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = {
|
||||
\ 'airline_a' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#ubaryd#palette.normal_modified = {
|
||||
\ 'airline_a' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_c' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#ubaryd#palette.insert_modified = {
|
||||
\ 'airline_c' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] }
|
||||
let g:airline#themes#ubaryd#palette.insert_paste = {
|
||||
\ 'airline_a' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.replace = copy(airline#themes#ubaryd#palette.insert)
|
||||
let g:airline#themes#ubaryd#palette.replace.airline_a = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ]
|
||||
let g:airline#themes#ubaryd#palette.replace_modified = g:airline#themes#ubaryd#palette.insert_modified
|
||||
|
||||
|
||||
let g:airline#themes#ubaryd#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#ubaryd#palette.visual_modified = {
|
||||
\ 'airline_c' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] }
|
||||
|
||||
let g:airline#themes#ubaryd#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#ubaryd#palette.inactive_modified = {
|
||||
\ 'airline_c' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] }
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
let g:airline#themes#understated#palette = {}
|
||||
|
||||
let s:N1 = ['#FFFFFF', '#5F87FF', 15, 69] " Outside blocks in normal mode (mode and file position)
|
||||
let s:N2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:N3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
|
||||
let g:airline#themes#understated#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#understated#palette.normal_modified = {'airline_c': ['#ffffff', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:I1 = ['#FFFFFF', '#87AF5F', 15, 107] " Outside blocks in normal mode (mode and file position)
|
||||
let s:I2 = ['#AFAF87', '#5F5F5F', 144, 59] " Next blocks inside (branch and file format)
|
||||
let s:I3 = ['#AFAF87', '#5F5F5F', 144, 59] " The middle block
|
||||
let g:airline#themes#understated#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.insert_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
let g:airline#themes#understated#palette.insert_paste = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, ''] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.replace = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#understated#palette.replace.airline_a = ['#FFFFFF', '#870000', 15, 88, '']
|
||||
let g:airline#themes#understated#palette.replace_modified = {'airline_c': ['#AFAF87', '#5F5F5F', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#FFFFFF', '#AF5F00', 15, 130]
|
||||
let s:V2 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let s:V3 = ['#AFAF87', '#5F5F5F', 144, 59]
|
||||
let g:airline#themes#understated#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#understated#palette.visual_modified = {'airline_c': [ '#AFAF87', '#5f005f', 144, 59, 'bold'] ,}
|
||||
|
||||
let s:V1 = ['#080808', '#FFAF00', 232, 214]
|
||||
let s:IA1 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA2 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let s:IA3 = ['#4E4E4E', '#1C1C1C', 239, 234, '']
|
||||
let g:airline#themes#understated#palette.inactive = airline#themes#generate_color_map(s:IA1, s:IA2, s:IA3)
|
||||
let g:airline#themes#understated#palette.inactive_modified = {'airline_c': ['#4E4E4E', '', 239, '', 'bold'] ,}
|
||||
|
||||
let g:airline#themes#understated#palette.accents = {'red': ['#FF0000', '', 88, '']}
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#understated#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ ['#FFFFFF', '#1C1C1C', 15, 234, '' ],
|
||||
\ ['#FFFFFF', '#262626', 15, 235, '' ],
|
||||
\ ['#FFFFFF', '#303030', 15, 236, 'bold'])
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
" vim-airline companion theme of Wombat
|
||||
" looks great with wombat256 vim colorscheme
|
||||
|
||||
" Normal mode
|
||||
" [ guifg, guibg, ctermfg, ctermbg, opts ]
|
||||
let s:N1 = [ '#141413' , '#CAE682' , 232 , 192 ] " mode
|
||||
let s:N2 = [ '#CAE682' , '#32322F' , 192 , 236 ] " info
|
||||
let s:N3 = [ '#CAE682' , '#242424' , 192 , 234 ] " statusline
|
||||
let s:N4 = [ '#86CD74' , 113 ] " mode modified
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 227 ]
|
||||
let s:I2 = [ '#FDE76E' , '#32322F' , 227 , 236 ]
|
||||
let s:I3 = [ '#FDE76E' , '#242424' , 227 , 234 ]
|
||||
let s:I4 = [ '#FADE3E' , 221 ]
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 153 ]
|
||||
let s:V2 = [ '#B5D3F3' , '#32322F' , 153 , 236 ]
|
||||
let s:V3 = [ '#B5D3F3' , '#242424' , 153 , 234 ]
|
||||
let s:V4 = [ '#7CB0E6' , 111 ]
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [ '#141413' , '#E5786D' , 232 , 173 ]
|
||||
let s:R2 = [ '#E5786D' , '#32322F' , 173 , 236 ]
|
||||
let s:R3 = [ '#E5786D' , '#242424' , 173 , 234 ]
|
||||
let s:R4 = [ '#E55345' , 203 ]
|
||||
|
||||
" Paste mode
|
||||
let s:PA = [ '#94E42C' , 47 ]
|
||||
|
||||
" Info modified
|
||||
let s:IM = [ '#40403C' , 238 ]
|
||||
|
||||
" Inactive mode
|
||||
let s:IA = [ '#767676' , s:N3[1] , 243 , s:N3[3] , '' ]
|
||||
|
||||
let g:airline#themes#wombat#palette = {}
|
||||
|
||||
let g:airline#themes#wombat#palette.accents = {
|
||||
\ 'red': [ '#E5786D' , '' , 203 , '' , '' ],
|
||||
\ }
|
||||
|
||||
let g:airline#themes#wombat#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let g:airline#themes#wombat#palette.normal_modified = {
|
||||
\ 'airline_a': [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:N4[0] , s:N3[1] , s:N4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#wombat#palette.insert_modified = {
|
||||
\ 'airline_a': [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:I4[0] , s:N3[1] , s:I4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#wombat#palette.visual_modified = {
|
||||
\ 'airline_a': [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:V4[0] , s:N3[1] , s:V4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#wombat#palette.replace_modified = {
|
||||
\ 'airline_a': [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] ,
|
||||
\ 'airline_b': [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:R4[0] , s:N3[1] , s:R4[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.insert_paste = {
|
||||
\ 'airline_a': [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] ,
|
||||
\ 'airline_b': [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , '' ] ,
|
||||
\ 'airline_c': [ s:PA[0] , s:N3[1] , s:PA[1] , s:N3[3] , '' ] }
|
||||
|
||||
|
||||
let g:airline#themes#wombat#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#wombat#palette.inactive_modified = {
|
||||
\ 'airline_c': [ s:N4[0] , '' , s:N4[1] , '' , '' ] }
|
||||
|
||||
|
||||
if !get(g:, 'loaded_ctrlp', 0)
|
||||
finish
|
||||
endif
|
||||
let g:airline#themes#wombat#palette.ctrlp = airline#extensions#ctrlp#generate_color_map(
|
||||
\ [ '#DADADA' , '#242424' , 253 , 234 , '' ] ,
|
||||
\ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] ,
|
||||
\ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] )
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
let g:airline#themes#zenburn#palette = {}
|
||||
|
||||
function! airline#themes#zenburn#refresh()
|
||||
let g:airline#themes#zenburn#palette.accents = {
|
||||
\ 'red': airline#themes#get_highlight('Constant'),
|
||||
\ }
|
||||
|
||||
let s:N1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Folded', 'fg'], 'bold')
|
||||
let s:N2 = airline#themes#get_highlight('Folded')
|
||||
let s:N3 = airline#themes#get_highlight('NonText')
|
||||
|
||||
let g:airline#themes#zenburn#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3)
|
||||
let s:Nmod = airline#themes#get_highlight('Comment')
|
||||
let g:airline#themes#zenburn#palette.normal_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
|
||||
let s:I1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['String', 'fg'], 'bold')
|
||||
let s:I2 = airline#themes#get_highlight2(['String', 'fg'], ['Folded', 'bg'])
|
||||
let s:I3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3)
|
||||
let g:airline#themes#zenburn#palette.insert_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:R1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Comment', 'fg'], 'bold')
|
||||
let s:R2 = airline#themes#get_highlight2(['Comment', 'fg'], ['Folded', 'bg'])
|
||||
let s:R3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3)
|
||||
let g:airline#themes#zenburn#palette.replace_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:V1 = airline#themes#get_highlight2(['DbgCurrent', 'bg'], ['Identifier', 'fg'], 'bold')
|
||||
let s:V2 = airline#themes#get_highlight2(['Identifier', 'fg'], ['Folded', 'bg'])
|
||||
let s:V3 = s:N3
|
||||
let g:airline#themes#zenburn#palette.visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3)
|
||||
let g:airline#themes#zenburn#palette.visual_modified = g:airline#themes#zenburn#palette.normal_modified
|
||||
|
||||
let s:IA = airline#themes#get_highlight('NonText')
|
||||
let g:airline#themes#zenburn#palette.inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA)
|
||||
let g:airline#themes#zenburn#palette.inactive_modified = {
|
||||
\ 'airline_c': s:Nmod
|
||||
\ }
|
||||
endfunction
|
||||
|
||||
call airline#themes#zenburn#refresh()
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
call airline#init#bootstrap()
|
||||
let s:spc = g:airline_symbols.space
|
||||
|
||||
function! airline#util#wrap(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
return a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#append(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
let prefix = s:spc == "\ua0" ? s:spc : s:spc.s:spc
|
||||
return empty(a:text) ? '' : prefix.g:airline_left_alt_sep.s:spc.a:text
|
||||
endfunction
|
||||
|
||||
function! airline#util#prepend(text, minwidth)
|
||||
if a:minwidth > 0 && winwidth(0) < a:minwidth
|
||||
return ''
|
||||
endif
|
||||
return empty(a:text) ? '' : a:text.s:spc.g:airline_right_alt_sep.s:spc
|
||||
endfunction
|
||||
|
||||
if v:version >= 704
|
||||
function! airline#util#getwinvar(winnr, key, def)
|
||||
return getwinvar(a:winnr, a:key, a:def)
|
||||
endfunction
|
||||
else
|
||||
function! airline#util#getwinvar(winnr, key, def)
|
||||
let winvals = getwinvar(a:winnr, '')
|
||||
return get(winvals, a:key, a:def)
|
||||
endfunction
|
||||
endif
|
||||
|
||||
if v:version >= 704
|
||||
function! airline#util#exec_funcrefs(list, ...)
|
||||
for Fn in a:list
|
||||
let code = call(Fn, a:000)
|
||||
if code != 0
|
||||
return code
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
else
|
||||
function! airline#util#exec_funcrefs(list, ...)
|
||||
" for 7.2; we cannot iterate the list, hence why we use range()
|
||||
" for 7.3-[97, 328]; we cannot reuse the variable, hence the {}
|
||||
for i in range(0, len(a:list) - 1)
|
||||
let Fn{i} = a:list[i]
|
||||
let code = call(Fn{i}, a:000)
|
||||
if code != 0
|
||||
return code
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
endif
|
||||
|
||||
@@ -1,793 +0,0 @@
|
||||
*airline.txt* Lean and mean status/tabline that's light as air
|
||||
*airline*
|
||||
_ _ _ _ ~
|
||||
__ _(_)_ __ ___ __ _(_)_ __| (_)_ __ ___ ~
|
||||
\ \ / / | '_ ` _ \ _____ / _` | | '__| | | '_ \ / _ \ ~
|
||||
\ V /| | | | | | |_____| (_| | | | | | | | | | __/ ~
|
||||
\_/ |_|_| |_| |_| \__,_|_|_| |_|_|_| |_|\___| ~
|
||||
~
|
||||
==============================================================================
|
||||
CONTENTS *airline-contents*
|
||||
|
||||
01. Intro ............................................... |airline-intro|
|
||||
02. Features ......................................... |airline-features|
|
||||
03. Name ................................................. |airline-name|
|
||||
04. Configuration ............................... |airline-configuration|
|
||||
05. Commands ......................................... |airline-commands|
|
||||
06. Customization ............................... |airline-customization|
|
||||
07. Extensions ..................................... |airline-extensions|
|
||||
08. Advanced Customization ............. |airline-advanced-customization|
|
||||
09. Funcrefs ......................................... |airline-funcrefs|
|
||||
10. Pipeline ......................................... |airline-pipeline|
|
||||
11. Writing Extensions ..................... |airline-writing-extensions|
|
||||
12. Writing Themes ..................................... |airline-themes|
|
||||
13. Troubleshooting ........................... |airline-troubleshooting|
|
||||
14. Contributions ............................... |airline-contributions|
|
||||
15. License ........................................... |airline-license|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *airline-intro*
|
||||
|
||||
vim-airline is a fast and lightweight alternative to powerline, written
|
||||
in 100% vimscript with no outside dependencies.
|
||||
|
||||
==============================================================================
|
||||
FEATURES *airline-features*
|
||||
|
||||
* tiny core written with extensibility in mind.
|
||||
* integrates with many popular plugins.
|
||||
* looks good with regular fonts, and provides configuration points so you
|
||||
can use unicode or powerline symbols.
|
||||
* optimized for speed; it loads in under a millisecond.
|
||||
* fully customizable; if you know a little 'statusline' syntax you can
|
||||
tweak it to your needs.
|
||||
* extremely easy to write themes.
|
||||
|
||||
==============================================================================
|
||||
NAME *airline-name*
|
||||
|
||||
Where did the name come from?
|
||||
|
||||
I wrote this on an airplane, and since it's light as air it turned out to be a
|
||||
good name :-)
|
||||
|
||||
==============================================================================
|
||||
CONFIGURATION *airline-configuration*
|
||||
|
||||
There are a couple configuration values available (shown with their default
|
||||
values):
|
||||
|
||||
* the separator used on the left side >
|
||||
let g:airline_left_sep='>'
|
||||
<
|
||||
* the separator used on the right side >
|
||||
let g:airline_right_sep='<'
|
||||
<
|
||||
* enable modified detection >
|
||||
let g:airline_detect_modified=1
|
||||
|
||||
* enable paste detection >
|
||||
let g:airline_detect_paste=1
|
||||
<
|
||||
* enable iminsert detection >
|
||||
let g:airline_detect_iminsert=0
|
||||
<
|
||||
* determine whether inactive windows should have the left section collapsed to
|
||||
only the filename of that buffer. >
|
||||
let g:airline_inactive_collapse=1
|
||||
<
|
||||
* themes are automatically selected based on the matching colorscheme. this
|
||||
can be overridden by defining a value. >
|
||||
let g:airline_theme=
|
||||
<
|
||||
* if you want to patch the airline theme before it gets applied, you can
|
||||
supply the name of a function where you can modify the palette. >
|
||||
let g:airline_theme_patch_func = 'AirlineThemePatch'
|
||||
function! AirlineThemePatch(palette)
|
||||
if g:airline_theme == 'badwolf'
|
||||
for colors in values(a:palette.inactive)
|
||||
let colors[3] = 245
|
||||
endfor
|
||||
endif
|
||||
endfunction
|
||||
<
|
||||
* enable/disable automatic population of the `g:airline_symbols` dictionary
|
||||
with powerline symbols. >
|
||||
let g:airline_powerline_fonts=0
|
||||
<
|
||||
* define the set of text to display for each mode. >
|
||||
let g:airline_mode_map = {} " see source for the defaults
|
||||
|
||||
" or copy paste the following into your vimrc for shortform text
|
||||
let g:airline_mode_map = {
|
||||
\ '__' : '-',
|
||||
\ 'n' : 'N',
|
||||
\ 'i' : 'I',
|
||||
\ 'R' : 'R',
|
||||
\ 'c' : 'C',
|
||||
\ 'v' : 'V',
|
||||
\ 'V' : 'V',
|
||||
\ '' : 'V',
|
||||
\ 's' : 'S',
|
||||
\ 'S' : 'S',
|
||||
\ '' : 'S',
|
||||
\ }
|
||||
<
|
||||
* define the set of filename match queries which excludes a window from having
|
||||
its statusline modified >
|
||||
let g:airline_exclude_filenames = [] " see source for current list
|
||||
<
|
||||
* define the set of filetypes which are excluded from having its window
|
||||
statusline modified >
|
||||
let g:airline_exclude_filetypes = [] " see source for current list
|
||||
<
|
||||
* defines whether the preview window should be excluded from have its window
|
||||
statusline modified (may help with plugins which use the preview window
|
||||
heavily) >
|
||||
let g:airline_exclude_preview = 0
|
||||
<
|
||||
==============================================================================
|
||||
COMMANDS *airline-commands*
|
||||
|
||||
:AirlineTheme {theme-name} *:AirlineTheme*
|
||||
Displays or changes the current theme.
|
||||
|
||||
:AirlineToggleWhitespace *:AirlineToggleWhitespace*
|
||||
Toggles whitespace detection.
|
||||
|
||||
:AirlineToggle *:AirlineToggle*
|
||||
Toggles between the standard 'statusline' and airline.
|
||||
|
||||
:AirlineRefresh *:AirlineRefresh*
|
||||
Refreshes all highlight groups and redraws the statusline.
|
||||
|
||||
==============================================================================
|
||||
CUSTOMIZATION *airline-customization*
|
||||
|
||||
The following are some unicode symbols for customizing the left/right
|
||||
separators, as well as the powerline font glyths.
|
||||
|
||||
Note: You must define the dictionary first before setting values. Also, it's a
|
||||
good idea to check whether if it exists as to avoid accidentally overwritting
|
||||
its contents. >
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
|
||||
" unicode symbols
|
||||
let g:airline_left_sep = '»'
|
||||
let g:airline_left_sep = '▶'
|
||||
let g:airline_right_sep = '«'
|
||||
let g:airline_right_sep = '◀'
|
||||
let g:airline_symbols.linenr = '␊'
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.linenr = '¶'
|
||||
let g:airline_symbols.branch = '⎇'
|
||||
let g:airline_symbols.paste = 'ρ'
|
||||
let g:airline_symbols.paste = 'Þ'
|
||||
let g:airline_symbols.paste = '∥'
|
||||
let g:airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
" powerline symbols
|
||||
let g:airline_left_sep = ''
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep = ''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_symbols.branch = ''
|
||||
let g:airline_symbols.readonly = ''
|
||||
let g:airline_symbols.linenr = ''
|
||||
|
||||
" old vim-powerline symbols
|
||||
let g:airline_left_sep = '⮀'
|
||||
let g:airline_left_alt_sep = '⮁'
|
||||
let g:airline_right_sep = '⮂'
|
||||
let g:airline_right_alt_sep = '⮃'
|
||||
let g:airline_symbols.branch = '⭠'
|
||||
let g:airline_symbols.readonly = '⭤'
|
||||
let g:airline_symbols.linenr = '⭡'
|
||||
<
|
||||
|
||||
For more intricate customizations, you can replace the predefined sections
|
||||
with the usual statusline syntax.
|
||||
|
||||
Note: If you define any section variables it will replace the default values
|
||||
entirely. If you want to disable only certain parts of a section you can try
|
||||
using variables defined in the |airline-configuration| or |airline-extensions|
|
||||
section.
|
||||
>
|
||||
variable names default contents
|
||||
----------------------------------------------------------------------------
|
||||
let g:airline_section_a (mode, paste, iminsert)
|
||||
let g:airline_section_b (hunks, branch)
|
||||
let g:airline_section_c (bufferline or filename)
|
||||
let g:airline_section_gutter (readonly, csv)
|
||||
let g:airline_section_x (tagbar, filetype, virtualenv)
|
||||
let g:airline_section_y (fileencoding, fileformat)
|
||||
let g:airline_section_z (percentage, line number, column number)
|
||||
let g:airline_section_warning (syntastic, whitespace)
|
||||
|
||||
" here is an example of how you could replace the branch indicator with
|
||||
" the current working directory, followed by the filename.
|
||||
let g:airline_section_b = '%{getcwd()}'
|
||||
let g:airline_section_c = '%t'
|
||||
<
|
||||
==============================================================================
|
||||
EXTENSIONS *airline-extensions*
|
||||
|
||||
Most extensions are enabled by default and lazily loaded when the
|
||||
corresponding plugin (if any) is detected.
|
||||
|
||||
By default, airline will attempt to load any extension it can find in the
|
||||
'runtimepath'. On some systems this can result in an undersirable startup
|
||||
cost. You can disable the check with the following flag. >
|
||||
let g:airline#extensions#disable_rtp_load = 1
|
||||
<
|
||||
Note: Third party plugins that rely on this behavior will be affected. You
|
||||
will need to manually load them.
|
||||
|
||||
------------------------------------- *airline-default*
|
||||
The default extension understands all of the `g:` variables in the
|
||||
|airline-configuration| section, however it also has some more fine-tuned
|
||||
configuration values that you can use.
|
||||
|
||||
* control which sections get truncated and at what width. >
|
||||
let g:airline#extensions#default#section_truncate_width = {
|
||||
\ 'b': 79,
|
||||
\ 'x': 60,
|
||||
\ 'y': 88,
|
||||
\ 'z': 45,
|
||||
\ }
|
||||
|
||||
" Note: set to an empty dictionary to disable truncation.
|
||||
let g:airline#extensions#default#section_truncate_width = {}
|
||||
<
|
||||
* configure the layout of the sections by specificing an array of two arrays
|
||||
(first array is the left side, second array is the right side). >
|
||||
let g:airline#extensions#default#layout = [
|
||||
\ [ 'a', 'b', 'c' ],
|
||||
\ [ 'x', 'y', 'z', 'warning' ]
|
||||
\ ]
|
||||
<
|
||||
------------------------------------- *airline-quickfix*
|
||||
The quickfix extension is a simple built-in extension which determines
|
||||
whether the buffer is a quickfix or location list buffer, and adjusts the
|
||||
title accordingly.
|
||||
|
||||
* configure the title text for quickfix buffers >
|
||||
let g:airline#extensions#quickfix#quickfix_text = 'Quickfix'
|
||||
<
|
||||
* configure the title text for location list buffers >
|
||||
let g:airline#extensions#quickfix#location_text = 'Location'
|
||||
<
|
||||
|
||||
------------------------------------- *airline-bufferline*
|
||||
vim-bufferline <https://github.com/bling/vim-bufferline>
|
||||
|
||||
* enable/disable bufferline integration >
|
||||
let g:airline#extensions#bufferline#enabled = 1
|
||||
<
|
||||
* determine whether bufferline will overwrite customization variables >
|
||||
let g:airline#extensions#bufferline#overwrite_variables = 1
|
||||
<
|
||||
------------------------------------- *airline-branch*
|
||||
fugitive.vim <https://github.com/tpope/vim-fugitive>
|
||||
lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
|
||||
vcscommand <http://www.vim.org/scripts/script.php?script_id=90>
|
||||
|
||||
* enable/disable fugitive/lawrencium integration >
|
||||
let g:airline#extensions#branch#enabled = 1
|
||||
<
|
||||
* change the text for when no branch is detected >
|
||||
let g:airline#extensions#branch#empty_message = ''
|
||||
|
||||
* use vcscommand.vim if available >
|
||||
let g:airline#extensions#branch#use_vcscommand = 0
|
||||
|
||||
* truncate long branch names to a fixed length >
|
||||
let g:airline#extensions#branch#displayed_head_limit = 10
|
||||
|
||||
------------------------------------- *airline-syntastic*
|
||||
syntastic <https://github.com/scrooloose/syntastic>
|
||||
|
||||
* enable/disable syntastic integration >
|
||||
let g:airline#extensions#syntastic#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-tagbar*
|
||||
tagbar <https://github.com/majutsushi/tagbar>
|
||||
|
||||
* enable/disable tagbar integration >
|
||||
let g:airline#extensions#tagbar#enabled = 1
|
||||
<
|
||||
* change how tags are displayed (:help tagbar-statusline) >
|
||||
let g:airline#extensions#tagbar#flags = '' (default)
|
||||
let g:airline#extensions#tagbar#flags = 'f'
|
||||
let g:airline#extensions#tagbar#flags = 's'
|
||||
let g:airline#extensions#tagbar#flags = 'p'
|
||||
<
|
||||
------------------------------------- *airline-csv*
|
||||
csv.vim <https://github.com/chrisbra/csv.vim>
|
||||
|
||||
* enable/disable csv integration for displaying the current column. >
|
||||
let g:airline#extensions#csv#enabled = 1
|
||||
<
|
||||
* change how columns are displayed. >
|
||||
let g:airline#extensions#csv#column_display = 'Number' (default)
|
||||
let g:airline#extensions#csv#column_display = 'Name'
|
||||
<
|
||||
------------------------------------- *airline-hunks*
|
||||
vim-gitgutter <https://github.com/airblade/vim-gitgutter>
|
||||
vim-signify <https://github.com/mhinz/vim-signify>
|
||||
changesPlugin <https://github.com/chrisbra/changesPlugin>
|
||||
|
||||
* enable/disable showing a summary of changed hunks under source control. >
|
||||
let g:airline#extensions#hunks#enabled = 1
|
||||
<
|
||||
* enable/disable showing only non-zero hunks. >
|
||||
let g:airline#extensions#hunks#non_zero_only = 0
|
||||
<
|
||||
* set hunk count symbols. >
|
||||
let g:airline#extensions#hunks#hunk_symbols = ['+', '~', '-']
|
||||
<
|
||||
------------------------------------- *airline-ctrlp*
|
||||
ctrlp <https://github.com/kien/ctrlp.vim>
|
||||
|
||||
* configure which mode colors should ctrlp window use (takes effect
|
||||
only if the active airline theme doesn't define ctrlp colors) >
|
||||
let g:airline#extensions#ctrlp#color_template = 'insert' (default)
|
||||
let g:airline#extensions#ctrlp#color_template = 'normal'
|
||||
let g:airline#extensions#ctrlp#color_template = 'visual'
|
||||
let g:airline#extensions#ctrlp#color_template = 'replace'
|
||||
<
|
||||
|
||||
* configure whether to show the previous and next modes (mru, buffer, etc...)
|
||||
>
|
||||
let g:airline#extensions#ctrlp#show_adjacent_modes = 1
|
||||
<
|
||||
------------------------------------- *airline-virtualenv*
|
||||
virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
||||
|
||||
* enable/disable virtualenv integration >
|
||||
let g:airline#extensions#virtualenv#enabled = 1
|
||||
<
|
||||
------------------------------------- *airline-eclim*
|
||||
eclim <https://eclim.org>
|
||||
|
||||
* enable/disable eclim integration, which works well with the
|
||||
|airline-syntastic| extension. >
|
||||
let g:airline#extensions#eclim#enabled = 1
|
||||
|
||||
------------------------------------- *airline-whitespace*
|
||||
* enable/disable detection of whitespace errors. >
|
||||
let g:airline#extensions#whitespace#enabled = 1
|
||||
<
|
||||
* customize the type of mixed indent checking to perform. >
|
||||
" must be all spaces or all tabs before the first non-whitespace character
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 0 (default)
|
||||
|
||||
" certain number of spaces are allowed after tabs, but not in between
|
||||
" this algorithm works well for /** */ style comments in a tab-indented file
|
||||
let g:airline#extensions#whitespace#mixed_indent_algo = 1
|
||||
<
|
||||
* customize the whitespace symbol. >
|
||||
let g:airline#extensions#whitespace#symbol = '!'
|
||||
<
|
||||
* configure which whitespace checks to enable. >
|
||||
let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ]
|
||||
<
|
||||
* configure the maximum number of lines where whitespace checking is enabled. >
|
||||
let g:airline#extensions#whitespace#max_lines = 20000
|
||||
<
|
||||
* configure whether a message should be displayed. >
|
||||
let g:airline#extensions#whitespace#show_message = 1
|
||||
<
|
||||
* configure the formatting of the warning messages. >
|
||||
let g:airline#extensions#whitespace#trailing_format = 'trailing[%s]'
|
||||
let g:airline#extensions#whitespace#mixed_indent_format = 'mixed-indent[%s]'
|
||||
<
|
||||
------------------------------------- *airline-tabline*
|
||||
* enable/disable enhanced tabline. >
|
||||
let g:airline#extensions#tabline#enabled = 0
|
||||
<
|
||||
* enable/disable displaying buffers with a single tab. >
|
||||
let g:airline#extensions#tabline#show_buffers = 1
|
||||
<
|
||||
* configure filename match rules to exclude from the tabline. >
|
||||
let g:airline#extensions#tabline#excludes = []
|
||||
<
|
||||
* configure how numbers are calculated in tab mode. >
|
||||
let g:airline#extensions#tabline#tab_nr_type = 0 " # of splits (default)
|
||||
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
|
||||
<
|
||||
* enable/disable displaying tab number in tabs mode. >
|
||||
let g:airline#extensions#tabline#show_tab_nr = 1
|
||||
|
||||
* enable/disable displaying tab type (far right)
|
||||
let g:airline#extensions#tabline#show_tab_type = 1
|
||||
|
||||
* enable/disable displaying index of the buffer.
|
||||
|
||||
When enabled, numbers will be displayed in the tabline and mappings will be
|
||||
exposed to allow you to select a buffer directly. Up to 9 mappings will be
|
||||
exposed.
|
||||
|
||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||
nmap <leader>1 <Plug>AirlineSelectTab1
|
||||
nmap <leader>2 <Plug>AirlineSelectTab2
|
||||
nmap <leader>3 <Plug>AirlineSelectTab3
|
||||
nmap <leader>4 <Plug>AirlineSelectTab4
|
||||
nmap <leader>5 <Plug>AirlineSelectTab5
|
||||
nmap <leader>6 <Plug>AirlineSelectTab6
|
||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||
|
||||
Note: Mappings will be ignored within a NERDTree buffer.
|
||||
|
||||
* defines the name of a formatter for how buffer names are displayed. >
|
||||
let g:airline#extensions#tabline#formatter = 'default'
|
||||
|
||||
" here is how you can define a 'foo' formatter:
|
||||
function! airline#extensions#tabline#foo#format(bufnr, buffers)
|
||||
return fnamemodify(bufname(a:bufnr), ':t')
|
||||
endfunction
|
||||
let g:airline#extensions#tabline#formatter = 'foo'
|
||||
<
|
||||
Note: the following variables are only used by the 'default' formatter.
|
||||
|
||||
* configure whether buffer numbers should be shown. >
|
||||
let g:airline#extensions#tabline#buffer_nr_show = 0
|
||||
<
|
||||
* configure how buffer numbers should be formatted with |printf|. >
|
||||
let g:airline#extensions#tabline#buffer_nr_format = '%s: '
|
||||
<
|
||||
* configure the formatting of filenames (see |filename-modifiers|). >
|
||||
let g:airline#extensions#tabline#fnamemod = ':p:.'
|
||||
<
|
||||
* configure collapsing parent directories in buffer name. >
|
||||
let g:airline#extensions#tabline#fnamecollapse = 1
|
||||
|
||||
" The `unique_tail` algorithm will display the tail of the filename, unless
|
||||
" there is another file of the same name, in which it will display it along
|
||||
" with the containing parent directory.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail'
|
||||
|
||||
" The `unique_tail_improved` - another algorithm, that will smartly uniquify
|
||||
" buffers names with similar filename, suppressing common parts of paths.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
<
|
||||
* configure the minimum number of buffers needed to show the tabline. >
|
||||
let g:airline#extensions#tabline#buffer_min_count = 0
|
||||
<
|
||||
Note: this setting only applies to a single tab and when `show_buffers` is
|
||||
true.
|
||||
|
||||
* configure the minimum number of tabs needed to show the tabline. >
|
||||
let g:airline#extensions#tabline#tab_min_count = 0
|
||||
<
|
||||
Note: this setting only applies when `show_buffers` is false.
|
||||
|
||||
* configure separators for the tabline only. >
|
||||
let g:airline#extensions#tabline#left_sep = ''
|
||||
let g:airline#extensions#tabline#left_alt_sep = ''
|
||||
let g:airline#extensions#tabline#right_sep = ''
|
||||
let g:airline#extensions#tabline#right_alt_sep = ''
|
||||
|
||||
* configure whether close button should be shown
|
||||
let g:airline#extensions#tabline#show_close_button = 1
|
||||
|
||||
* configure symbol used to represent close button
|
||||
let g:airline#extensions#tabline#close_symbol = 'X'
|
||||
|
||||
<
|
||||
Note: Enabling this extension will modify 'showtabline' and 'guioptions'.
|
||||
|
||||
------------------------------------- *airline-tmuxline*
|
||||
tmuxline <https://github.com/edkolev/tmuxline.vim>
|
||||
|
||||
* enable/disable tmuxline integration >
|
||||
let g:airline#extensions#tmuxline#enabled = 0
|
||||
<
|
||||
* configure which mode colors should be used in tmux statusline >
|
||||
let airline#extensions#tmuxline#color_template = 'normal' (default)
|
||||
let airline#extensions#tmuxline#color_template = 'insert'
|
||||
let airline#extensions#tmuxline#color_template = 'visual'
|
||||
let airline#extensions#tmuxline#color_template = 'replace'
|
||||
<
|
||||
* if specified, setting this option will trigger writing to the file whenever the
|
||||
airline theme is applied, i.e. when :AirlineTheme is executed and on vim
|
||||
startup >
|
||||
airline#extensions#tmuxline#snapshot_file = "~/.tmux-statusline-colors.conf"
|
||||
<
|
||||
------------------------------------- *airline-promptline*
|
||||
promptline <https://github.com/edkolev/promptline.vim>
|
||||
|
||||
* configure the path to the snapshot .sh file. Mandatory option. The created
|
||||
file should be sourced by the shell on login >
|
||||
" in .vimrc
|
||||
airline#extensions#promptline#snapshot_file = "~/.shell_prompt.sh"
|
||||
|
||||
" in .bashrc/.zshrc
|
||||
[ -f ~/.shell_prompt.sh ] && source ~/.shell_prompt.sh
|
||||
<
|
||||
* enable/disable promptline integration >
|
||||
let g:airline#extensions#promptline#enabled = 0
|
||||
<
|
||||
* configure which mode colors should be used in prompt >
|
||||
let airline#extensions#promptline#color_template = 'normal' (default)
|
||||
let airline#extensions#promptline#color_template = 'insert'
|
||||
let airline#extensions#promptline#color_template = 'visual'
|
||||
let airline#extensions#promptline#color_template = 'replace'
|
||||
<
|
||||
------------------------------------- *airline-nrrwrgn*
|
||||
NrrwRgn <https://github.com/chrisbra/NrrwRgn>
|
||||
|
||||
* enable/disable NrrwRgn integration >
|
||||
let g:airline#extensions#nrrwrgn#enabled = 1
|
||||
|
||||
------------------------------------- *airline-capslock*
|
||||
vim-capslock <https://github.com/tpope/vim-capslock>
|
||||
|
||||
* enable/disable vim-capslock integration >
|
||||
let g:airline#extensions#capslock#enabled = 1
|
||||
|
||||
------------------------------------- *airline-windowswap*
|
||||
vim-windowswap <https://github.com/wesQ3/vim-windowswap>
|
||||
|
||||
* enable/disable vim-windowswap integration >
|
||||
let g:airline#extensions#windowswap#enabled = 1
|
||||
|
||||
* set marked window indicator string >
|
||||
let g:airline#extensions#windowswap#indicator_text = 'WS'
|
||||
<
|
||||
==============================================================================
|
||||
ADVANCED CUSTOMIZATION *airline-advanced-customization*
|
||||
|
||||
The defaults will accomodate the mass majority of users with minimal
|
||||
configuration. However, if you want to reposition sections or contents you can
|
||||
do so with built-in helper functions, which makes it possible to create
|
||||
sections in a more declarative style.
|
||||
|
||||
------------------------------------- *airline-parts*
|
||||
A part is something that contains metadata that eventually gets rendered into
|
||||
the statusline. You can define parts that contain constant strings or
|
||||
functions. Defining parts is needed if you want to use features like automatic
|
||||
insertion of separators or hiding based on window width.
|
||||
|
||||
For example, this is how you would define a part function: >
|
||||
call airline#parts#define_function('foo', 'GetFooText')
|
||||
<
|
||||
Here is how you would define a part that is visible only if the window width
|
||||
greater than a minimum width. >
|
||||
call airline#parts#define_minwidth('foo', 50)
|
||||
<
|
||||
Parts can be configured to be visible conditionally. >
|
||||
call airline#parts#define_condition('foo', 'getcwd() =~ "work_dir"')
|
||||
<
|
||||
Note: Part definitions are combinative; e.g. the two examples above modify the
|
||||
same `foo` part.
|
||||
|
||||
Note: Look at the source code and tests for the full API.
|
||||
|
||||
------------------------------------- *airline-predefined-parts*
|
||||
Before is a list of parts that are predefined by vim-airline.
|
||||
|
||||
* `mode` displays the current mode
|
||||
* `iminsert` displays the current insert method
|
||||
* `paste` displays the paste indicator
|
||||
* `filetype` displays the file type
|
||||
* `readonly` displays the read only indicator
|
||||
* `file` displays the filename and modified indicator
|
||||
* `ffenc` displays the file format and encoding
|
||||
|
||||
And the following are defined for their respective extensions:
|
||||
|
||||
`hunks`, `branch`, `tagbar`, `syntastic`, `whitespace`
|
||||
|
||||
------------------------------------- *airline-accents*
|
||||
Accents can be defined on any part, like so: >
|
||||
call airline#parts#define_accent('foo', 'red')
|
||||
<
|
||||
This will override the colors of that part by using what is defined in that
|
||||
particular accent. In the above example, the `red` accent is used, which means
|
||||
regardless of which section the part is used in, it will have red foreground
|
||||
colors instead of the section's default foreground color.
|
||||
|
||||
The following accents are defined by default. Themes can define their variants
|
||||
of the colors, but defaults will be provided if missing. >
|
||||
bold, italic, red, green, blue, yellow, orange, purple
|
||||
<
|
||||
The defaults configure the mode and line number parts to be bold, and the
|
||||
readonly part to be red.
|
||||
|
||||
------------------------------------- *airline-sections*
|
||||
Once a part is defined, you can use helper functions to generate the
|
||||
statuslines for each section. For example, to use the part above, we could
|
||||
define a section like this: >
|
||||
function! AirlineInit()
|
||||
let g:airline_section_a = airline#section#create(['mode', ' ', 'foo'])
|
||||
let g:airline_section_b = airline#section#create_left(['ffenc','file'])
|
||||
let g:airline_section_c = airline#section#create(['%{getcwd()}'])
|
||||
endfunction
|
||||
autocmd VimEnter * call AirlineInit()
|
||||
<
|
||||
This will create a section with the `mode`, followed by a space, and our `foo`
|
||||
part in section `a`. Section `b` will have two parts with a left-side
|
||||
separator. And section `c` will contain the current path. You may notice that
|
||||
the space and cwd are not defined parts. For convenience, if a part of that
|
||||
key does not exist, it will be inserted as is. The unit tests will be a good
|
||||
resource for possibilities.
|
||||
|
||||
Note: The use of |VimEnter| is important, because most extensions are lazily
|
||||
loaded, so we must give them a chance to define their parts before we can use
|
||||
them.
|
||||
|
||||
Note: The `airline#section#create` function and friends will do its best to
|
||||
create a section with the appropriate separators, but it only works for
|
||||
function and text parts. Special 'statusline' items like %f or raw/undefined
|
||||
parts will not work as it is not possible to inspect their widths/contents
|
||||
before rendering to the statusline.
|
||||
|
||||
==============================================================================
|
||||
FUNCREFS *airline-funcrefs*
|
||||
|
||||
vim-airline internally uses funcrefs to integrate with third party plugins,
|
||||
and you can tap into this functionality to extend it for you needs. This is
|
||||
the most powerful way to customize the statusline, and sometimes it may be
|
||||
easier to go this route than the above methods.
|
||||
|
||||
Every section can have two values. The default value is the global `g:`
|
||||
variable which is used in the absense of a `w:` value. This makes it very easy
|
||||
to override only certain parts of the statusline by only defining window-local
|
||||
variables for a subset of all sections.
|
||||
|
||||
------------------------------------- *add_statusline_func*
|
||||
The following is an example of how you can extend vim-airline to support a
|
||||
new plugin. >
|
||||
function! MyPlugin(...)
|
||||
if &filetype == 'MyPluginFileType'
|
||||
let w:airline_section_a = 'MyPlugin'
|
||||
let w:airline_section_b = '%f'
|
||||
let w:airline_section_c = '%{MyPlugin#function()}'
|
||||
let g:airline_variable_referenced_in_statusline = 'foo'
|
||||
endif
|
||||
endfunction
|
||||
call airline#add_statusline_func('MyPlugin')
|
||||
<
|
||||
Notice that only the left side of the statusline is overwritten. This means
|
||||
the right side (the line/column numbers, etc) will be intact.
|
||||
|
||||
------------------------------------- *remove_statusline_func*
|
||||
You can also remove a function as well, which is useful for when you want a
|
||||
temporary override. >
|
||||
call airline#remove_statusline_func('MyPlugin')
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
PIPELINE *airline-pipeline*
|
||||
|
||||
Sometimes you want to do more than just use overrides. The statusline funcref
|
||||
is invoked and passed two arguments. The first of these arguments is the
|
||||
statusline builder. You can use this to build completely custom statuslines
|
||||
to your liking. Here is an example: >
|
||||
>
|
||||
function! MyPlugin(...)
|
||||
" first variable is the statusline builder
|
||||
let builder = a:1
|
||||
|
||||
" WARNING: the API for the builder is not finalized and may change
|
||||
call builder.add_section('Normal', '%f')
|
||||
call builder.add_section('WarningMsg', '%{getcwd()}')
|
||||
call builder.split()
|
||||
call builder.add_section('airline_z', '%p%%')
|
||||
|
||||
" tell the core to use the contents of the builder
|
||||
return 1
|
||||
endfunction
|
||||
<
|
||||
The above example uses various example highlight groups to demonstrate
|
||||
that you can use any combination from the loaded colorscheme. However, if
|
||||
you want colors to change between modes, you should use one of the section
|
||||
highlight groups, e.g. `airline_a` and `airline_b`.
|
||||
|
||||
The second variable is the context, which is a dictionary containing various
|
||||
values such as whether the statusline is active or not, and the window number.
|
||||
>
|
||||
context = {
|
||||
'winnr': 'the window number for the statusline',
|
||||
'active': 'whether the window is active or not',
|
||||
'bufnr': 'the current buffer for this window',
|
||||
}
|
||||
<
|
||||
------------------------------------- *airline-pipeline-return-codes*
|
||||
The pipeline accepts various return codes and can be used to determine the
|
||||
next action. The following are the supported codes: >
|
||||
0 the default, continue on with the next funcref
|
||||
-1 do not modify the statusline
|
||||
1 modify the statusline with the current contents of the builder
|
||||
<
|
||||
Note: Any value other than 0 will halt the pipeline and prevent the next
|
||||
funcref from executing.
|
||||
|
||||
==============================================================================
|
||||
WRITING EXTENSIONS *airline-writing-extensions*
|
||||
|
||||
For contributions into the plugin, here are the following guidelines:
|
||||
|
||||
1. For simple 'filetype' checks, they can be added directly into the
|
||||
`extensions.vim` file.
|
||||
|
||||
2. Pretty much everything else should live as a separate file under the
|
||||
`extensions/` directory.
|
||||
|
||||
a. Inside `extensions.vim`, add a check for some variable or command that
|
||||
is always available (these must be defined in `plugin/`, and _not_
|
||||
`autoload/` of the other plugin). If it exists, then initialize the
|
||||
extension. This ensures that the extension is loaded if and only if the
|
||||
user has the other plugin installed. Also, a check to
|
||||
`airline#extensions#foo_plugin#enabled` should be performed to allow the
|
||||
user to disable it.
|
||||
|
||||
b. Configuration variables for the extension should reside in the
|
||||
extension, e.g. `g:airline#extensions#foo_plugin#bar_variable`.
|
||||
|
||||
See the source of |example.vim| for documented code of how to write one.
|
||||
Looking at the other extensions is also a good resource.
|
||||
|
||||
==============================================================================
|
||||
WRITING THEMES *airline-themes*
|
||||
|
||||
Themes are written "close to the metal" -- you will need to know some basic
|
||||
VimL syntax to write a theme, but if you've written in any programming
|
||||
language before it will be easy to pick up.
|
||||
|
||||
The |dark.vim| theme fully documents this procedure and will guide you through
|
||||
the process. The |jellybeans.vim| theme is another example of how to write a
|
||||
theme, but instead of manually declaring colors, it extracts the values from
|
||||
highlight groups.
|
||||
|
||||
==============================================================================
|
||||
TROUBLESHOOTING *airline-troubleshooting*
|
||||
|
||||
Q. There are no colors.
|
||||
A. You need to set up your terminal correctly. For more details, see
|
||||
<http://vim.wikia.com/wiki/256_colors_in_vim>. Alternatively, if you want
|
||||
to bypass the automatic detection of terminal colors, you can force Vim
|
||||
into 256 color mode with this: >
|
||||
set t_Co=256
|
||||
<
|
||||
Q. The statusline does not appear until I create a split.
|
||||
A. This is the default setting of 'laststatus'. If you want it to appear all
|
||||
the time, add the following to your vimrc: >
|
||||
set laststatus=2
|
||||
<
|
||||
Q. Powerline symbols are not showing up.
|
||||
A. First, you must install patched powerline fonts. Second, you must enable
|
||||
unicode in vim. >
|
||||
set encoding=utf-8
|
||||
<
|
||||
Q. There is a pause when leaving insert mode.
|
||||
A. Add the following to your vimrc. >
|
||||
set ttimeoutlen=50
|
||||
<
|
||||
Q. The colors look a little off for some themes.
|
||||
A. Certain themes are derived from the active colorscheme by extracting colors
|
||||
from predefined highlight groups. These airline themes will look good for
|
||||
their intended matching colorschemes, but will be hit or miss when loaded
|
||||
with other colorschemes.
|
||||
|
||||
|
||||
Solutions to other common problems can be found in the Wiki:
|
||||
<https://github.com/bling/vim-airline/wiki/FAQ>
|
||||
|
||||
==============================================================================
|
||||
CONTRIBUTIONS *airline-contributions*
|
||||
|
||||
Contributions and pull requests are welcome.
|
||||
|
||||
==============================================================================
|
||||
LICENSE *airline-license*
|
||||
|
||||
MIT License. Copyright © 2013-2014 Bailey Ling.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
@@ -1,754 +0,0 @@
|
||||
*easytags.txt* Automated tag generation and syntax highlighting in Vim
|
||||
|
||||
===============================================================================
|
||||
Contents ~
|
||||
|
||||
1. Introduction |easytags-introduction|
|
||||
2. Installation |easytags-installation|
|
||||
1. A note about Windows |easytags-note-about-windows|
|
||||
3. Commands |easytags-commands|
|
||||
1. The |:UpdateTags| command
|
||||
2. The |:HighlightTags| command
|
||||
4. Options |easytags-options|
|
||||
1. The |g:easytags_cmd| option
|
||||
2. The |g:easytags_opts| option
|
||||
3. The |g:easytags_async| option
|
||||
4. The |g:easytags_syntax_keyword| option
|
||||
5. The |g:easytags_languages| option
|
||||
6. The |g:easytags_file| option
|
||||
7. The |g:easytags_dynamic_files| option
|
||||
8. The |g:easytags_by_filetype| option
|
||||
9. The |g:easytags_events| option
|
||||
10. The |g:easytags_always_enabled| option
|
||||
11. The |g:easytags_on_cursorhold| option
|
||||
12. The |g:easytags_updatetime_min| option
|
||||
13. The |g:easytags_auto_update| option
|
||||
14. The |g:easytags_auto_highlight| option
|
||||
15. The |g:easytags_autorecurse| option
|
||||
16. The |g:easytags_include_members| option
|
||||
17. The |g:easytags_resolve_links| option
|
||||
18. The |g:easytags_suppress_ctags_warning| option
|
||||
19. The |g:easytags_suppress_report| option
|
||||
5. Customizing the easytags plug-in |customizing-easytags-plug-in|
|
||||
1. Passing custom command line arguments to Exuberant Ctags |easytags-passing-custom-command-line-arguments-to-exuberant-ctags|
|
||||
2. Update & highlight tags immediately after save |easytags-update-highlight-tags-immediately-after-save|
|
||||
3. How to customize the highlighting colors? |easytags-how-to-customize-highlighting-colors|
|
||||
6. Faster syntax highlighting using Python |easytags-faster-syntax-highlighting-using-python|
|
||||
1. The |g:easytags_python_enabled| option
|
||||
2. The |g:easytags_python_script| option
|
||||
7. Troubleshooting |easytags-troubleshooting|
|
||||
8. vim-easytags is slow! |vim-easytags-is-slow|
|
||||
1. |:HighlightTags| only works for the tags file created by |:UpdateTags| |easytags-highlighttags-only-works-for-tags-file-created-by-updatetags|
|
||||
2. The plug-in complains that Exuberant Ctags isn't installed |easytags-plug-in-complains-that-exuberant-ctags-isnt-installed|
|
||||
3. Vim locks up while the plug-in is running |easytags-vim-locks-up-while-plug-in-is-running|
|
||||
4. Failed to highlight tags because pattern is too big! |easytags-failed-to-highlight-tags-because-pattern-is-too-big|
|
||||
5. The plug-in doesn't seem to work in Cygwin |easytags-plug-in-doesnt-seem-to-work-in-cygwin|
|
||||
9. Contact |easytags-contact|
|
||||
10. License |easytags-license|
|
||||
11. References |easytags-references|
|
||||
|
||||
===============================================================================
|
||||
*easytags-introduction*
|
||||
Introduction ~
|
||||
|
||||
Vim has long been my favorite text editor and combined with Exuberant Ctags [1]
|
||||
it has the potential to provide most of what I expect from an integrated
|
||||
development environment [2]. Exuberant Ctags is the latest incarnation of a
|
||||
family of computer programs [3] that scan source code files to create an index
|
||||
of identifiers (tags) and where they are defined. Vim uses this index (a so-
|
||||
called tags file) to enable you to jump to the definition of any identifier
|
||||
using the Control-] (see |CTRL-]|) mapping.
|
||||
|
||||
When you're familiar with integrated development environments you may recognize
|
||||
this feature as "Go-to definition". One advantage of the combination of Vim and
|
||||
Exuberant Ctags over integrated development environments is that Vim supports
|
||||
syntax highlighting for over 500 file types [4] (!) and Exuberant Ctags can
|
||||
generate tags for over 40 file types [5] as well...
|
||||
|
||||
There's just one problem: You have to manually keep your tags files up-to-date
|
||||
and this turns out to be a royal pain in the ass! So I set out to write a Vim
|
||||
plug-in that would do this boring work for me. When I finished the plug-in's
|
||||
basic functionality (one automatic command and a call to |system()| later) I
|
||||
became interested in dynamic syntax highlighting, so I added that as well to
|
||||
see if it would work -- surprisingly well I'm happy to report!
|
||||
|
||||
===============================================================================
|
||||
*easytags-installation*
|
||||
Installation ~
|
||||
|
||||
_Please note that the vim-easytags plug-in requires my vim-misc plug-in which
|
||||
is separately distributed._
|
||||
|
||||
Unzip the most recent ZIP archives of the vim-easytags [6] and vim-misc [7]
|
||||
plug-ins inside your Vim profile directory (usually this is '~/.vim' on UNIX
|
||||
and '%USERPROFILE%\vimfiles' on Windows), restart Vim and execute the command
|
||||
':helptags ~/.vim/doc' (use ':helptags ~\vimfiles\doc' instead on Windows).
|
||||
|
||||
If you prefer you can also use Pathogen [8], Vundle [9] or a similar tool to
|
||||
install and update the vim-easytags [10] and vim-misc [11] plug-ins using a
|
||||
local clone of the git repository.
|
||||
|
||||
Now try it out: Edit any file type supported by Exuberant Ctags and within ten
|
||||
seconds the plug-in should create/update your tags file ('~/.vimtags' on UNIX,
|
||||
'~/_vimtags' on Windows) with the tags defined in the file you just edited!
|
||||
This means that whatever file you're editing in Vim (as long as it's on the
|
||||
local file system), tags will always be available by the time you need them!
|
||||
|
||||
Additionally if the file you just opened is an AWK, C#, C, C++, Objective-C,
|
||||
Java, Lua, Perl, PHP, Python, Ruby, Shell, Tcl or Vim source file you should
|
||||
also notice that the function and/or type names defined in the file have been
|
||||
syntax highlighted.
|
||||
|
||||
The 'easytags.vim' plug-in is intended to work automatically once it's
|
||||
installed, but if you want to change how it works there are several options you
|
||||
can change and commands you can execute from your own mappings and/or automatic
|
||||
commands. These are all documented below.
|
||||
|
||||
Note that if the plug-in warns you 'ctags' isn't installed you'll have to
|
||||
download it from its homepage [1], or if you're running Debian/Ubuntu you can
|
||||
install it by executing the following shell command:
|
||||
>
|
||||
$ sudo apt-get install exuberant-ctags
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-note-about-windows*
|
||||
A note about Windows ~
|
||||
|
||||
On Windows the |system()| function used by 'easytags.vim' causes a command
|
||||
prompt window to pop up while Exuberant Ctags is executing. If this bothers you
|
||||
then you can install my shell.vim [12] plug-in which includes a DLL [13] that
|
||||
works around this issue. Once you've installed both plug-ins it should work out
|
||||
of the box! Please let me know if this doesn't work for you.
|
||||
|
||||
===============================================================================
|
||||
*easytags-commands*
|
||||
Commands ~
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *:UpdateTags* command
|
||||
|
||||
This command executes Exuberant Ctags [1] from inside Vim to update the global
|
||||
tags file defined by |g:easytags_file|. When no arguments are given the tags
|
||||
for the current file are updated, otherwise the arguments are passed on to
|
||||
'ctags'. For example when you execute the Vim command ':UpdateTags -R ~/.vim'
|
||||
(or ':UpdateTags -R ~\vimfiles' on Windows) the plug-in will execute 'ctags -R
|
||||
~/.vim' for you (with some additional arguments, see the troubleshooting
|
||||
section "|:HighlightTags| only works for the tags file created by
|
||||
|:UpdateTags|" for more information).
|
||||
|
||||
When you execute this command like ':UpdateTags!' (including the bang!) then
|
||||
all tags whose files are missing will be filtered from the global tags file.
|
||||
|
||||
Note that this command will be executed automatically every once in a while,
|
||||
assuming you haven't changed |g:easytags_on_cursorhold|.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *:HighlightTags* command
|
||||
|
||||
When you execute this command while editing one of the supported file types
|
||||
(see above) the relevant tags in the current file are highlighted. The tags to
|
||||
highlight are gathered from all tags files known to Vim (through the |'tags'|
|
||||
option).
|
||||
|
||||
Note that this command will be executed automatically every once in a while,
|
||||
assuming you haven't changed |g:easytags_on_cursorhold|.
|
||||
|
||||
===============================================================================
|
||||
*easytags-options*
|
||||
Options ~
|
||||
|
||||
The easytags plug-in should work out of the box but if you don't like the
|
||||
default configuration you can change how it works by setting the variables
|
||||
documented below. Most of these variables can also be changed for specific
|
||||
files by setting a buffer local variable instead of the global variable. For
|
||||
example to disable automatic highlighting (enabled by default) only in Python
|
||||
files you can add the following line to your |vimrc| script:
|
||||
>
|
||||
:autocmd FileType python let b:easytags_auto_highlight = 0
|
||||
<
|
||||
Note that buffer local variables always override global variables, so if you
|
||||
want to undo this for a specific file you have to use |:unlet|:
|
||||
>
|
||||
:unlet b:easytags_auto_highlight
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_cmd* option
|
||||
|
||||
The plug-in will try to determine the location where Exuberant Ctags is
|
||||
installed on its own but this might not always work because any given
|
||||
executable named 'ctags' in your '$PATH' might not in fact be Exuberant Ctags
|
||||
but some older, more primitive 'ctags' implementation which doesn't support the
|
||||
same command line options and thus breaks the easytags plug-in. If this is the
|
||||
case you can set the global variable |g:easytags_cmd| to the location where
|
||||
you've installed Exuberant Ctags, e.g.:
|
||||
>
|
||||
:let g:easytags_cmd = '/usr/local/bin/ctags'
|
||||
<
|
||||
If you rely entirely on language-specific configuration and don't have a
|
||||
general ctags program, set this to the empty string.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_opts* option
|
||||
|
||||
If you need to pass custom command line option(s) to the program specified by
|
||||
|g:easytags_cmd| you can set this option to a list of strings to be passed to
|
||||
Exuberant Ctags. Make sure to only use options that are valid in any context,
|
||||
for example the concatenation of |g:easytags_cmd|, |g:easytags_opts| and
|
||||
'--list-languages' should work as expected. Here's an example:
|
||||
>
|
||||
:let g:easytags_opts = ['--options=$VIM\ctags\ctags.cnf']
|
||||
<
|
||||
The example above (based on issue 98 [14]) overrides the location of Exuberant
|
||||
Ctags' configuration file. As you can see the command line option(s) may
|
||||
contain environment variables, these will be expanded before passing the
|
||||
options to Exuberant Ctags (to make sure it works in all environments).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_async* option
|
||||
|
||||
By default vim-easytags runs Exuberant Ctags and updates your tags file in the
|
||||
foreground, blocking Vim in the process. As your tags files get larger this
|
||||
becomes more annoying. It has been the number one complaint about vim-easytags
|
||||
since I published the first release online.
|
||||
|
||||
In version 3.5 of the vim-easytags plug-in support for asynchronous tags file
|
||||
updates was added. It's not enabled by default yet because I want to make sure
|
||||
I'm not breaking the plug-in for the majority of users. However after I've
|
||||
gathered some feedback I definitely want to make this the default mode.
|
||||
|
||||
By setting this option to true (1) you enable asynchronous tags file updates.
|
||||
Good luck! ;-)
|
||||
|
||||
Note that asynchronous updates on Windows currently require the installation of
|
||||
my vim-shell [12] plug-in (for obscure technical reasons that I want to fix but
|
||||
don't know how yet).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_syntax_keyword* option
|
||||
|
||||
When you look into how the dynamic syntax highlighting in the vim-easytags
|
||||
plug-in works you'll realize that vim-easytags is really abusing Vim's syntax
|
||||
highlighting engine. This can cause Vim to slow down to a crawl, depending on
|
||||
how big your tags files are. To make things worse in Vim 7.4 a new regex engine
|
||||
was introduced which exacerbates the problem (the patterns generated by vim-
|
||||
easytags bring out the worst of the new regex engine).
|
||||
|
||||
Since version 3.6 the vim-easytags plug-in tries to squeeze as much performance
|
||||
as possible out of Vim by using keyword highlighting where this is possible
|
||||
without sacrificing accuracy. If your Vim's syntax highlighting is still too
|
||||
slow you can add the following to your |vimrc| script:
|
||||
>
|
||||
let g:easytags_syntax_keyword = 'always'
|
||||
<
|
||||
The default value of this option is 'auto' which means to use keyword
|
||||
highlighting where this is possible without sacrificing accuracy. By changing
|
||||
it to 'always' you're telling vim-easytags to sacrifice accuracy in order to
|
||||
gain performance. Try it out and see what works best for you.
|
||||
|
||||
Please note that right now this 'feature' is not integrated with the
|
||||
"accelerated Python syntax highlighting" feature, because I'm considering
|
||||
ripping that out and replacing it with a _fast_ Vim script implementation.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_languages* option
|
||||
|
||||
Exuberant Ctags supports many languages and can be extended via regular
|
||||
expression patterns, but for some languages separate tools with ctags-
|
||||
compatible output exist (e.g. jsctags [15] for Javascript). To use these, the
|
||||
executable and its arguments must be configured:
|
||||
>
|
||||
let g:easytags_languages = {
|
||||
\ 'language': {
|
||||
\ 'cmd': g:easytags_cmd,
|
||||
\ 'args': [],
|
||||
\ 'fileoutput_opt': '-f',
|
||||
\ 'stdout_opt': '-f-',
|
||||
\ 'recurse_flag': '-R'
|
||||
\ }
|
||||
\}
|
||||
<
|
||||
Each key is a special language definition. The key is a Vim file type in
|
||||
lowercase. The above snippet shows the defaults; you only need to specify
|
||||
options that differ.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_file* option
|
||||
|
||||
As mentioned above the plug-in will store your tags in '~/.vimtags' on UNIX and
|
||||
'~/_vimtags' on Windows. To change the location of this file, set the global
|
||||
variable |g:easytags_file|, e.g.:
|
||||
>
|
||||
:let g:easytags_file = '~/.vim/tags'
|
||||
<
|
||||
A leading '~' in the |g:easytags_file| variable is expanded to your current
|
||||
home directory ('$HOME' on UNIX, '%USERPROFILE%' on Windows).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_dynamic_files* option
|
||||
|
||||
By default |:UpdateTags| only writes to the global tags file, but it can be
|
||||
configured to look for project specific tags files by adding the following
|
||||
lines to your |vimrc| script:
|
||||
>
|
||||
:set tags=./tags;
|
||||
:let g:easytags_dynamic_files = 1
|
||||
<
|
||||
You can change the name of the tags file, the important thing is that it's
|
||||
relative to your working directory or the buffer (using a leading './'). When
|
||||
|g:easytags_dynamic_files| is set to 1 the easytags plug-in will write to the
|
||||
first existing tags file seen by Vim (based on the |'tags'| option). In other
|
||||
words: If a project specific tags file is found it will be used, otherwise the
|
||||
plug-in falls back to the global tags file (or a file type specific tags file).
|
||||
|
||||
If you set |g:easytags_dynamic_files| to 2 the easytags plug-in will
|
||||
automatically create project specific tags based on the first name in the
|
||||
'tags' option. In this mode the the global tags file or file type specific tags
|
||||
files are only used for directories where you don't have write permissions.
|
||||
|
||||
The |'tags'| option is reevaluated each time the plug-in runs, so which tags
|
||||
file is selected can differ depending on the buffer and working directory.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_by_filetype* option
|
||||
|
||||
By default all tags are stored in a global tags file. When the tags file grows
|
||||
beyond a certain size Vim will be slowed down by the easytags plug-in because
|
||||
it has to read and process a large number of tags very frequently.
|
||||
|
||||
To avoid this problem you can set |g:easytags_by_filetype| to the path of an
|
||||
existing directory. The easytags plug-in will create separate tags files for
|
||||
each file type in the configured directory. These tags files are automatically
|
||||
registered by the easytags plug-in when the file type of a buffer is set.
|
||||
|
||||
Note that the |g:easytags_dynamic_files| option takes precedence over this
|
||||
option.
|
||||
|
||||
If you already have a global tags file you can create file type specific tags
|
||||
files from the global tags file using the command ':TagsByFileType'.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_events* option
|
||||
|
||||
This option can be used to customize the events that trigger the automatic
|
||||
updating and highlighting performed by the easytags plug-in. The
|
||||
|g:easytags_always_enabled| and |g:easytags_on_cursorhold| options are more
|
||||
user friendly but limited ways to accomplish the same thing.
|
||||
|
||||
Here's an example: Say you want the easytags plug-in to automatically update &
|
||||
highlight tags for the current file right after you save the file. You can
|
||||
accomplish this by adding the following line to your |vimrc| script:
|
||||
>
|
||||
:let g:easytags_events = ['BufWritePost']
|
||||
<
|
||||
Note that if you set |g:easytags_events| in your |vimrc| script, the values of
|
||||
the options |g:easytags_always_enabled| and |g:easytags_on_cursorhold| will be
|
||||
ignored completely.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_always_enabled* option
|
||||
|
||||
By default the plug-in automatically generates and highlights tags when you
|
||||
stop typing for a few seconds (this works using the |CursorHold| automatic
|
||||
command). This means that when you edit a file, the dynamic highlighting won't
|
||||
appear until you pause for a moment. If you don't like this you can configure
|
||||
the plug-in to always enable dynamic highlighting:
|
||||
>
|
||||
:let g:easytags_always_enabled = 1
|
||||
<
|
||||
Be warned that after setting this option you'll probably notice why it's
|
||||
disabled by default: Every time you edit a file in Vim, the plug-in will first
|
||||
run Exuberant Ctags and then highlight the tags, and this slows Vim down quite
|
||||
a lot. I have some ideas on how to improve this latency by running Exuberant
|
||||
Ctags in the background so stay tuned!
|
||||
|
||||
Note: If you change this option it won't apply until you restart Vim, so you'll
|
||||
have to set this option in your |vimrc| script.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_on_cursorhold* option
|
||||
|
||||
As I explained above the plug-in by default doesn't update or highlight your
|
||||
tags until you stop typing for a moment. The plug-in tries hard to do the least
|
||||
amount of work possible in this break but it might still interrupt your
|
||||
workflow. If it does you can disable the periodic update:
|
||||
>
|
||||
:let g:easytags_on_cursorhold = 0
|
||||
<
|
||||
Note: Like the |g:easytags_always_enabled| option, if you change this option it
|
||||
won't apply until you restart Vim, so you'll have to set this option in your
|
||||
|vimrc| script.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_updatetime_min* option
|
||||
|
||||
Vim's |'updatetime'| option controls how often the easytags plug-in is
|
||||
automatically executed. A lot of popular Vim plug-ins manipulate this option to
|
||||
control how often they are called. Unfortunately some of those plug-ins set
|
||||
|'updatetime'| to a very low value (less than a second) and this can break the
|
||||
easytags plug-in. Because of this the easytags plug-in compensates by keeping
|
||||
track of when it was last executed.
|
||||
|
||||
The default value of Vim's 'updatetime (see |'updatetime'|) option _and_ the
|
||||
|g:easytags_updatetime_min| option is 4000 milliseconds (4 seconds).
|
||||
|
||||
If you know what you're doing and you really want the easytags plug-in to be
|
||||
executed more than once every 4 seconds you can lower the minimum acceptable
|
||||
updatetime by setting |g:easytags_updatetime_min| to the number of milliseconds
|
||||
(an integer).
|
||||
|
||||
Note that although |g:easytags_updatetime_min| counts in milliseconds, the
|
||||
easytags plug-in does not support subsecond granularity because it is limited
|
||||
by Vim's |localtime()| function which has one-second resolution.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_auto_update* option
|
||||
|
||||
By default the plug-in automatically updates and highlights your tags when you
|
||||
stop typing for a moment. If you want to disable automatic updating while
|
||||
keeping automatic highlighting enabled you can set this option to false:
|
||||
>
|
||||
:let g:easytags_auto_update = 0
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_auto_highlight* option
|
||||
|
||||
By default the plug-in automatically updates and highlights your tags when you
|
||||
stop typing for a moment. If you want to disable automatic highlighting while
|
||||
keeping automatic updating enabled you can set this option to false:
|
||||
>
|
||||
:let g:easytags_auto_highlight = 0
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_autorecurse* option
|
||||
|
||||
When the |:UpdateTags| command is executed automatically or without arguments,
|
||||
it defaults to updating just the tags for the current file. If you'd rather
|
||||
have it recursively scan everything below the directory of the current file
|
||||
then set this option to true (1):
|
||||
>
|
||||
:let g:easytags_autorecurse = 1
|
||||
<
|
||||
You have to explicitly enable this option because it should only be used while
|
||||
navigating around small directory trees. Imagine always having this option
|
||||
enabled and then having to edit a file in e.g. the root of your home directory:
|
||||
The 'easytags.vim' plug-in would freeze Vim for a long time while you'd have to
|
||||
wait for Exuberant Ctags to scan thousands of files...
|
||||
|
||||
Note that when you enable this option the 'easytags.vim' plug-in might ignore
|
||||
other options like |g:easytags_resolve_links|. This is an implementation detail
|
||||
which I intend to fix.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_include_members* option
|
||||
|
||||
Exuberant Ctags knows how to generate tags for struct/class members in C++ and
|
||||
Java source code but doesn't do so by default because it can more than double
|
||||
the size of your tags files, thus taking much longer to read/write the tags
|
||||
file. When you enable the |g:easytags_include_members| option from your |vimrc|
|
||||
script (before the 'easytags.vim' plug-in is loaded):
|
||||
>
|
||||
:let g:easytags_include_members = 1
|
||||
<
|
||||
Exuberant Ctags will be instructed to include struct/class members using the '
|
||||
--extra=+q' command line argument and the 'easytags.vim' plug-in will highlight
|
||||
them using the 'cMember' highlighting group. Because most color schemes don't
|
||||
distinguish the Identifier and Type (see |group-name|) highlighting groups all
|
||||
members will now probably look like type definitions. You can change that by
|
||||
executing either of the following Vim commands (from your vimrc script, a file
|
||||
type plug-in, etc.):
|
||||
>
|
||||
" If you like one of the existing styles you can link them:
|
||||
highlight link cMember Special
|
||||
|
||||
" You can also define your own style if you want:
|
||||
highlight cMember gui=italic
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_resolve_links* option
|
||||
|
||||
UNIX has symbolic links [16] and hard links [17], both of which conflict with
|
||||
the concept of having one unique location for every identifier. With regards to
|
||||
hard links there's not much anyone can do, but because I use symbolic links
|
||||
quite a lot I've added this option. It's disabled by default since it has a
|
||||
small performance impact and might not do what unknowing users expect it to:
|
||||
When you enable this option the plug-in will resolve symbolic links in
|
||||
pathnames, which means your tags file will only contain entries with canonical
|
||||
pathnames [18]. To enable this option (which I strongly suggest doing when you
|
||||
run UNIX and use symbolic links) execute the following Vim command:
|
||||
>
|
||||
:let g:easytags_resolve_links = 1
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_suppress_ctags_warning* option
|
||||
|
||||
If this is set and not false, it will suppress the warning on startup if ctags
|
||||
is not found or not recent enough.
|
||||
>
|
||||
:let g:easytags_suppress_ctags_warning = 1
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_suppress_report* option
|
||||
|
||||
If this is set and not false, it will suppress the report displayed on tag
|
||||
updates.
|
||||
>
|
||||
:let g:easytags_suppress_report = 1
|
||||
<
|
||||
===============================================================================
|
||||
*customizing-easytags-plug-in*
|
||||
Customizing the easytags plug-in ~
|
||||
|
||||
Advanced users may wish to customize how the easytags plug-in works beyond the
|
||||
point of changing configuration defaults. This section contains some hints
|
||||
about this. If you have suggestions, please feel free to submit them.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-passing-custom-command-line-arguments-to-exuberant-ctags*
|
||||
Passing custom command line arguments to Exuberant Ctags ~
|
||||
|
||||
You may want to run Exuberant Ctags with specific command line options, for
|
||||
example the code_complete [19] plug-in requires the signature field to be
|
||||
present. To do this you can create a configuration file for Exuberant Ctags,
|
||||
e.g. '~/.ctags' on UNIX or '%USERPROFILE%\ctags.cnf' on Windows. The file
|
||||
should contain one command line option per line. See the Exuberant Ctags manual
|
||||
[20] for details.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-update-highlight-tags-immediately-after-save*
|
||||
Update & highlight tags immediately after save ~
|
||||
|
||||
By default the easytags plug-in automatically updates & highlights tags for the
|
||||
current file after several seconds of inactivity. This is done to prevent the
|
||||
easytags plug-in from interrupting your workflow.
|
||||
|
||||
If you want the easytags plug-in to automatically update & highlight tags for
|
||||
the current file right after you save the file, you can add the following line
|
||||
to your |vimrc| script:
|
||||
>
|
||||
:let g:easytags_events = ['BufWritePost']
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-how-to-customize-highlighting-colors*
|
||||
How to customize the highlighting colors? ~
|
||||
|
||||
The easytags plug-in defines new highlighting groups for dynamically
|
||||
highlighted tags. These groups are linked to Vim's default groups so that
|
||||
they're colored out of the box, but if you want you can change the styles. To
|
||||
do so use a 'highlight' command such as the ones given a few paragraphs back.
|
||||
Of course you'll need to change the group name. Here are the group names used
|
||||
by the easytags plug-in:
|
||||
|
||||
- **AWK**: 'awkFunctionTag'
|
||||
- **C#:**'csClassOrStructTag', 'csMethodTag'
|
||||
- **C, C++, Objective C:**'cTypeTag', 'cEnumTag', 'cPreProcTag',
|
||||
'cFunctionTag', 'cMemberTag'
|
||||
- **Java:**'javaClassTag', 'javaInterfaceTag', 'javaMethodTag'
|
||||
- **Lua:**'luaFuncTag'
|
||||
- **Perl:**'perlFunctionTag'
|
||||
- **PHP:**'phpFunctionsTag', 'phpClassesTag'
|
||||
- **Python:**'pythonFunctionTag', 'pythonMethodTag', 'pythonClassTag'
|
||||
- **Ruby:**'rubyModuleNameTag', 'rubyClassNameTag', 'rubyMethodNameTag'
|
||||
- **Shell**: 'shFunctionTag'
|
||||
- **Tcl**: 'tclCommandTag'
|
||||
- **Vim:**'vimAutoGroupTag', 'vimCommandTag', 'vimFuncNameTag',
|
||||
'vimScriptFuncNameTag'
|
||||
|
||||
As you can see each of these names ends in 'Tag' to avoid conflicts with the
|
||||
syntax modes shipped with Vim. And about the singular/plural confusion: I've
|
||||
tried to match the existing highlighting groups defined by popular syntax modes
|
||||
(except of course for the 'Tag' suffix).
|
||||
|
||||
===============================================================================
|
||||
*easytags-faster-syntax-highlighting-using-python*
|
||||
Faster syntax highlighting using Python ~
|
||||
|
||||
The Vim script implementation of dynamic syntax highlighting is quite slow on
|
||||
large tags files. When the Python Interface to Vim is enabled the easytags
|
||||
plug-in will therefor automatically use a Python script that performs dynamic
|
||||
syntax highlighting about twice as fast as the Vim script implementation. The
|
||||
following options are available to change the default configuration.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_python_enabled* option
|
||||
|
||||
To disable the Python implementation of dynamic syntax highlighting you can set
|
||||
this option to false (0).
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The *g:easytags_python_script* option
|
||||
|
||||
This option defines the pathname of the script that contains the Python
|
||||
implementation of dynamic syntax highlighting.
|
||||
|
||||
===============================================================================
|
||||
*easytags-troubleshooting*
|
||||
Troubleshooting ~
|
||||
|
||||
===============================================================================
|
||||
*vim-easytags-is-slow*
|
||||
vim-easytags is slow! ~
|
||||
|
||||
Yes, I know. I'm trying to make it faster but that's far from trivial. In the
|
||||
process of trying to speed up vim-easytags I've added reporting of elapsed time
|
||||
in several ways. If Vim seems very slow and you suspect this plug-in might be
|
||||
the one to blame, increase Vim's verbosity level:
|
||||
>
|
||||
:set vbs=1
|
||||
<
|
||||
Every time the plug-in executes it will time how long the execution takes and
|
||||
add the results to Vim's message history, which you can view by executing the
|
||||
|:messages| command. If you want a more fine grained impression of the time
|
||||
spent by vim-easytags on various operations you can call the
|
||||
'xolox#easytags#why_so_slow()' function:
|
||||
>
|
||||
:call xolox#easytags#why_so_slow()
|
||||
easytags.vim 3.6.4: Timings since you started Vim:
|
||||
- 0.094937 seconds updating tags
|
||||
- 1.850201 seconds highlighting tags
|
||||
- 0.035167 seconds highlighting tags using ':syntax match')
|
||||
- 0.493910 seconds highlighting tags using ':syntax keyword')
|
||||
- 0.413160 seconds filtering tags for highlighting (stage 1)
|
||||
- 0.141747 seconds filtering tags for highlighting (stage 2)
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-highlighttags-only-works-for-tags-file-created-by-updatetags*
|
||||
:HighlightTags only works for the tags file created by :UpdateTags ~
|
||||
|
||||
If you want to create tags files and have their tags highlighted by the
|
||||
'easytags.vim' plug-in then you'll have to create the tags file with certain
|
||||
arguments to Exuberant Ctags:
|
||||
>
|
||||
$ ctags --fields=+l --c-kinds=+p --c++-kinds=+p ...
|
||||
<
|
||||
The '--fields=+l' argument makes sure that Exuberant Ctags includes a
|
||||
'language:...' property with each entry in the tags file. This is required by
|
||||
the |:HighlightTags| command so it can filter tags by their file type. The
|
||||
other two arguments make sure Exuberant Ctags generates tags for function
|
||||
prototypes in C/C++ source code.
|
||||
|
||||
If you have the |g:easytags_include_members| option enabled (its off by
|
||||
default) then you'll also need to add the '--extra=+q' argument so that
|
||||
Exuberant Ctags generates tags for structure/class members.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-plug-in-complains-that-exuberant-ctags-isnt-installed*
|
||||
The plug-in complains that Exuberant Ctags isn't installed ~
|
||||
|
||||
After a Mac OS X user found out the hard way that the 'ctags' executable isn't
|
||||
always Exuberant Ctags and we spend a few hours debugging the problem I added
|
||||
proper version detection: The plug-in executes 'ctags --version' when Vim is
|
||||
started to verify that Exuberant Ctags 5.5 or newer is installed. If it isn't
|
||||
Vim will show the following message on startup:
|
||||
>
|
||||
easytags.vim: Plug-in not loaded because Exuberant Ctags isn't installed!
|
||||
Please download & install Exuberant Ctags from http://ctags.sf.net
|
||||
<
|
||||
If the installed Exuberant Ctags version is too old the plug-in will complain:
|
||||
>
|
||||
easytags.vim: Plug-in not loaded because Exuberant Ctags 5.5
|
||||
or newer is required while you have version %s installed!
|
||||
<
|
||||
If you have the right version of Exuberant Ctags installed but the plug-in
|
||||
still complains, try executing the following command from inside Vim:
|
||||
>
|
||||
:!which ctags
|
||||
<
|
||||
If this doesn't print the location where you installed Exuberant Ctags it means
|
||||
your system already had a 'ctags' executable but it isn't compatible with
|
||||
Exuberant Ctags 5.5 and you'll need to set the |g:easytags_cmd| option (see
|
||||
above) so the plug-in knows which 'ctags' to run.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-vim-locks-up-while-plug-in-is-running*
|
||||
Vim locks up while the plug-in is running ~
|
||||
|
||||
Once or twice now in several years I've experienced Exuberant Ctags getting
|
||||
into an infinite loop when given garbage input. In my case this happened by
|
||||
accident a few days ago :-|. Because my plug-in executes 'ctags' in the
|
||||
foreground this will block Vim indefinitely! If this happens you might be able
|
||||
to kill 'ctags' by pressing Control-C (see |CTRL-C|) but if that doesn't work
|
||||
you can also kill it without stopping Vim using a task manager or the 'pkill'
|
||||
command (available on most UNIX systems):
|
||||
>
|
||||
$ pkill -KILL ctags
|
||||
<
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-failed-to-highlight-tags-because-pattern-is-too-big*
|
||||
Failed to highlight tags because pattern is too big! ~
|
||||
|
||||
If the 'easytags.vim' plug-in fails to highlight your tags and the error
|
||||
message mentions that the pattern is too big, your tags file has grown too
|
||||
large for Vim to be able to highlight all tagged identifiers! I've had this
|
||||
happen to me with 50 KB patterns because I added most of the headers in
|
||||
'/usr/include/' to my tags file. Internally Vim raises the error |E339|:
|
||||
Pattern too long and unfortunately the only way to avoid this problem once it
|
||||
occurs is to reduce the number of tagged identifiers...
|
||||
|
||||
In my case the solution was to move most of the tags from '/usr/include/' over
|
||||
to project specific tags files which are automatically loaded by Vim when I
|
||||
edit files in different projects because I've set the |'tags'| option as
|
||||
follows:
|
||||
>
|
||||
:set tags=./.tags;,~/.vimtags
|
||||
<
|
||||
Once you've executed the above command, Vim will automatically look for a file
|
||||
named '.tags' in the directory of the current file. Because of the ';' Vim also
|
||||
recurses upwards so that you can nest files arbitrarily deep under your project
|
||||
directories.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
*easytags-plug-in-doesnt-seem-to-work-in-cygwin*
|
||||
The plug-in doesn't seem to work in Cygwin ~
|
||||
|
||||
If you want to use the plug-in with Vim under Cygwin [21], you need to have the
|
||||
Cygwin version of Ctags installed instead of the Windows version (thanks to
|
||||
Alex Zuroff for reporting this!).
|
||||
|
||||
===============================================================================
|
||||
*easytags-contact*
|
||||
Contact ~
|
||||
|
||||
If you have questions, bug reports, suggestions, etc. the author can be
|
||||
contacted at peter@peterodding.com. The latest version is available at
|
||||
http://peterodding.com/code/vim/easytags/ and http://github.com/xolox/vim-
|
||||
easytags. If you like this plug-in please vote for it on Vim Online [22].
|
||||
|
||||
===============================================================================
|
||||
*easytags-license*
|
||||
License ~
|
||||
|
||||
This software is licensed under the MIT license [23]. © 2015 Peter Odding
|
||||
<peter@peterodding.com> and Ingo Karkat.
|
||||
|
||||
Thanks go out to everyone who has helped to improve the vim-easytags plug-in
|
||||
(whether through pull requests, bug reports or personal e-mails).
|
||||
|
||||
===============================================================================
|
||||
*easytags-references*
|
||||
References ~
|
||||
|
||||
[1] http://ctags.sourceforge.net/
|
||||
[2] http://en.wikipedia.org/wiki/Integrated_development_environment
|
||||
[3] http://en.wikipedia.org/wiki/Ctags
|
||||
[4] http://ftp.vim.org/vim/runtime/syntax/
|
||||
[5] http://ctags.sourceforge.net/languages.html
|
||||
[6] http://peterodding.com/code/vim/downloads/easytags.zip
|
||||
[7] http://peterodding.com/code/vim/downloads/misc.zip
|
||||
[8] http://www.vim.org/scripts/script.php?script_id=2332
|
||||
[9] https://github.com/gmarik/vundle
|
||||
[10] http://github.com/xolox/vim-easytags
|
||||
[11] http://github.com/xolox/vim-misc
|
||||
[12] http://peterodding.com/code/vim/shell/
|
||||
[13] http://en.wikipedia.org/wiki/Dynamic-link_library
|
||||
[14] https://github.com/xolox/vim-easytags/issues/98
|
||||
[15] https://npmjs.org/package/jsctags
|
||||
[16] http://en.wikipedia.org/wiki/Symbolic_link
|
||||
[17] http://en.wikipedia.org/wiki/Hard_link
|
||||
[18] http://en.wikipedia.org/wiki/Canonicalization
|
||||
[19] http://www.vim.org/scripts/script.php?script_id=1764
|
||||
[20] http://ctags.sourceforge.net/ctags.html#FILES
|
||||
[21] http://en.wikipedia.org/wiki/Cygwin
|
||||
[22] http://www.vim.org/scripts/script.php?script_id=3114
|
||||
[23] http://en.wikipedia.org/wiki/MIT_License
|
||||
|
||||
vim: ft=help
|
||||
1212
.vim/doc/misc.txt
1212
.vim/doc/misc.txt
File diff suppressed because it is too large
Load Diff
@@ -1,109 +0,0 @@
|
||||
" MIT License. Copyright (c) 2013-2014 Bailey Ling.
|
||||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
if &cp || v:version < 702 || (exists('g:loaded_airline') && g:loaded_airline)
|
||||
finish
|
||||
endif
|
||||
let g:loaded_airline = 1
|
||||
|
||||
" autocmd VimEnter * call airline#deprecation#check()
|
||||
|
||||
let s:airline_initialized = 0
|
||||
let s:airline_theme_defined = 0
|
||||
function! s:init()
|
||||
if !s:airline_initialized
|
||||
let s:airline_initialized = 1
|
||||
|
||||
call airline#init#bootstrap()
|
||||
call airline#extensions#load()
|
||||
call airline#init#sections()
|
||||
|
||||
let s:airline_theme_defined = exists('g:airline_theme')
|
||||
if s:airline_theme_defined || !airline#switch_matching_theme()
|
||||
let g:airline_theme = get(g:, 'airline_theme', 'dark')
|
||||
call airline#switch_theme(g:airline_theme)
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:on_window_changed()
|
||||
if pumvisible()
|
||||
return
|
||||
endif
|
||||
call <sid>init()
|
||||
call airline#update_statusline()
|
||||
endfunction
|
||||
|
||||
function! s:on_colorscheme_changed()
|
||||
call <sid>init()
|
||||
if !s:airline_theme_defined
|
||||
if airline#switch_matching_theme()
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" couldn't find a match, or theme was defined, just refresh
|
||||
call airline#load_theme()
|
||||
endfunction
|
||||
|
||||
function airline#cmdwinenter(...)
|
||||
call airline#extensions#apply_left_override('Command Line', '')
|
||||
endfunction
|
||||
|
||||
function! s:airline_toggle()
|
||||
if exists("#airline")
|
||||
augroup airline
|
||||
au!
|
||||
augroup END
|
||||
augroup! airline
|
||||
|
||||
if exists("s:stl")
|
||||
let &stl = s:stl
|
||||
endif
|
||||
|
||||
silent doautocmd User AirlineToggledOff
|
||||
else
|
||||
let s:stl = &statusline
|
||||
augroup airline
|
||||
autocmd!
|
||||
|
||||
autocmd CmdwinEnter *
|
||||
\ call airline#add_statusline_func('airline#cmdwinenter')
|
||||
\ | call <sid>on_window_changed()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ call <sid>on_window_changed()
|
||||
|
||||
autocmd BufWritePost */autoload/airline/themes/*.vim
|
||||
\ exec 'source '.split(globpath(&rtp, 'autoload/airline/themes/'.g:airline_theme.'.vim', 1), "\n")[0]
|
||||
\ | call airline#load_theme()
|
||||
augroup END
|
||||
|
||||
silent doautocmd User AirlineToggledOn
|
||||
|
||||
if s:airline_initialized
|
||||
call <sid>on_window_changed()
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_airline_themes(a, l, p)
|
||||
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:a.'*'), "\n")
|
||||
return map(files, 'fnamemodify(v:val, ":t:r")')
|
||||
endfunction
|
||||
function! s:airline_theme(...)
|
||||
if a:0
|
||||
call airline#switch_theme(a:1)
|
||||
else
|
||||
echo g:airline_theme
|
||||
endif
|
||||
endfunction
|
||||
command! -nargs=? -complete=customlist,<sid>get_airline_themes AirlineTheme call <sid>airline_theme(<f-args>)
|
||||
command! AirlineToggleWhitespace call airline#extensions#whitespace#toggle()
|
||||
command! AirlineToggle call <sid>airline_toggle()
|
||||
command! AirlineRefresh call airline#load_theme() | call airline#update_statusline()
|
||||
|
||||
call <sid>airline_toggle()
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
let g:airline_theme = 'dark'
|
||||
call airline#init#bootstrap()
|
||||
call airline#init#sections()
|
||||
source plugin/airline.vim
|
||||
|
||||
function! MyFuncref(...)
|
||||
call a:1.add_raw('hello world')
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! MyIgnoreFuncref(...)
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
function! MyAppend1(...)
|
||||
call a:1.add_raw('hello')
|
||||
endfunction
|
||||
|
||||
function! MyAppend2(...)
|
||||
call a:1.add_raw('world')
|
||||
endfunction
|
||||
|
||||
describe 'airline'
|
||||
before
|
||||
let g:airline_statusline_funcrefs = []
|
||||
end
|
||||
|
||||
it 'should run user funcrefs first'
|
||||
call airline#add_statusline_func('MyFuncref')
|
||||
let &statusline = ''
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ 'hello world'
|
||||
end
|
||||
|
||||
it 'should not change the statusline with -1'
|
||||
call airline#add_statusline_funcref(function('MyIgnoreFuncref'))
|
||||
let &statusline = 'foo'
|
||||
call airline#update_statusline()
|
||||
Expect &statusline == 'foo'
|
||||
end
|
||||
|
||||
it 'should support multiple chained funcrefs'
|
||||
call airline#add_statusline_func('MyAppend1')
|
||||
call airline#add_statusline_func('MyAppend2')
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ 'helloworld'
|
||||
end
|
||||
|
||||
it 'should allow users to redefine sections'
|
||||
let g:airline_section_a = airline#section#create(['mode', 'mode'])
|
||||
call airline#update_statusline()
|
||||
Expect airline#statusline(1) =~ '%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#%#airline_a_bold#%{airline#util#wrap(airline#parts#mode(),0)}%#airline_a#'
|
||||
end
|
||||
|
||||
it 'should remove funcrefs properly'
|
||||
let c = len(g:airline_statusline_funcrefs)
|
||||
call airline#add_statusline_func('MyIgnoreFuncref')
|
||||
call airline#remove_statusline_func('MyIgnoreFuncref')
|
||||
Expect len(g:airline_statusline_funcrefs) == c
|
||||
end
|
||||
|
||||
it 'should overwrite the statusline with active and inactive splits'
|
||||
wincmd s
|
||||
Expect airline#statusline(1) !~ 'inactive'
|
||||
Expect airline#statusline(2) =~ 'inactive'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should collapse the inactive split if the variable is set true'
|
||||
let g:airline_inactive_collapse = 1
|
||||
wincmd s
|
||||
Expect getwinvar(2, '&statusline') !~ 'airline#parts#mode'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should not collapse the inactive split if the variable is set false'
|
||||
let g:airline_inactive_collapse = 0
|
||||
wincmd s
|
||||
Expect getwinvar(2, '&statusline') != 'airline#parts#mode'
|
||||
wincmd c
|
||||
end
|
||||
|
||||
it 'should include check_mode'
|
||||
Expect airline#statusline(1) =~ 'airline#check_mode'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user