diff --git a/etc/soft/vim/vim/+plugins/vim-airline/.gitignore b/etc/soft/vim/vim/+plugins/vim-airline/.gitignore new file mode 100644 index 0000000..296f094 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/.gitignore @@ -0,0 +1,3 @@ +doc/tags +*.lock +.vim-flavor diff --git a/etc/soft/vim/vim/+plugins/vim-airline/.travis.yml b/etc/soft/vim/vim/+plugins/vim-airline/.travis.yml new file mode 100644 index 0000000..9ed483e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/.travis.yml @@ -0,0 +1,4 @@ +language: ruby +rvm: + - 1.9.3 +script: rake ci diff --git a/etc/soft/vim/vim/+plugins/vim-airline/Gemfile b/etc/soft/vim/vim/+plugins/vim-airline/Gemfile new file mode 100644 index 0000000..088f22e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'vim-flavor', '~> 1.1' diff --git a/etc/soft/vim/vim/+plugins/vim-airline/README.md b/etc/soft/vim/vim/+plugins/vim-airline/README.md index 5442dd0..dd59b88 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/README.md +++ b/etc/soft/vim/vim/+plugins/vim-airline/README.md @@ -1,18 +1,96 @@ -# vim-airline +# vim-airline [![Build Status](https://travis-ci.org/bling/vim-airline.png)](https://travis-ci.org/bling/vim-airline) -Lean & mean statusline for vim that's light as air. +Lean & mean status/tabline for vim that's light as air. ![img](https://github.com/bling/vim-airline/wiki/screenshots/demo.gif) # Features -* tiny core (under 200 lines), written with extensibility in mind (specifically adhering to the [open/closed principle][8]). -* integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [syntastic][5] and [lawrencium][21]. -* 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. -* extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. -* supports 7.2 as the minimum Vim version +* Tiny core written with extensibility in mind ([open/closed principle][8]). +* Integrates with a variety of plugins, including: [vim-bufferline][6], [fugitive][4], [unite][9], [ctrlp][10], [minibufexpl][15], [gundo][16], [undotree][17], [nerdtree][18], [tagbar][19], [vim-gitgutter][29], [vim-signify][30], [syntastic][5], [eclim][34], [lawrencium][21] and [virtualenv][31]. +* 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. +* Extensive suite of themes for popular colorschemes including [solarized][23] (dark and light), [tomorrow][24] (all variants), [base16][32] (all variants), [molokai][25], [jellybeans][26] and others; have a look at the [screenshots][14] in the wiki. +* Supports 7.2 as the minimum Vim version. +* The master branch tries to be as stable as possible, and new features are merged in only after they have gone through a [full regression test][33]. +* Unit testing suite. + +## Straightforward customization + +If you don't like the defaults, you can replace all sections with standard `statusline` syntax. Give your statusline that you've built over the years a face lift. + +![image](https://f.cloud.github.com/assets/306502/1009429/d69306da-0b38-11e3-94bf-7c6e3eef41e9.png) + +## Automatic truncation + +Sections and parts within sections can be configured to automatically hide when the window size shrinks. + +![image](https://f.cloud.github.com/assets/306502/1060831/05c08aac-11bc-11e3-8470-a506a3037f45.png) + +## Smarter tab line + +Automatically displays all buffers when there's only one tab open. + +![tabline](https://f.cloud.github.com/assets/306502/1072623/44c292a0-1495-11e3-9ce6-dcada3f1c536.gif) + +This is disabled by default; add the following to your vimrc to enable the extension: + + let g:airline#extensions#tabline#enabled = 1 + +Separators can be configured independently for the tabline, so here is how you can define "straight" tabs: + + let g:airline#extensions#tabline#left_sep = ' ' + let g:airline#extensions#tabline#left_alt_sep = '|' + +## Seamless integration + +vim-airline integrates with a variety of plugins out of the box. These extensions will be lazily loaded if and only if you have the other plugins installed (and of course you can turn them off). + +#### [ctrlp.vim][10] +![image](https://f.cloud.github.com/assets/306502/962258/7345a224-04ec-11e3-8b5a-f11724a47437.png) + +#### [unite.vim][9] +![image](https://f.cloud.github.com/assets/306502/962319/4d7d3a7e-04ed-11e3-9d59-ab29cb310ff8.png) + +#### [tagbar][19] +![image](https://f.cloud.github.com/assets/306502/962150/7e7bfae6-04ea-11e3-9e28-32af206aed80.png) + +#### [csv.vim][28] +![image](https://f.cloud.github.com/assets/306502/962204/cfc1210a-04eb-11e3-8a93-42e6bcd21efa.png) + +#### [syntastic][5] +![image](https://f.cloud.github.com/assets/306502/962864/9824c484-04f7-11e3-9928-da94f8c7da5a.png) + +#### hunks ([vim-gitgutter][29] & [vim-signify][30]) +![image](https://f.cloud.github.com/assets/306502/995185/73fc7054-09b9-11e3-9d45-618406c6ed98.png) + +#### [virtualenv][31] +![image](https://f.cloud.github.com/assets/390964/1022566/cf81f830-0d98-11e3-904f-cf4fe3ce201e.png) + +## Extras + +vim-airline also supplies some supplementary stand-alone extensions. In addition to the tabline extension mentioned earlier, there is also: + +#### whitespace +![image](https://f.cloud.github.com/assets/306502/962401/2a75385e-04ef-11e3-935c-e3b9f0e954cc.png) + +## Configurable and extensible + +#### Fine-tuned configuration + +Every section is composed of parts, and you can reorder and reconfigure them at will. + +![image](https://f.cloud.github.com/assets/306502/1073278/f291dd4c-14a3-11e3-8a83-268e2753f97d.png) + +Sections can contain accents, which allows for very granular control of visuals (see configuration [here](https://github.com/bling/vim-airline/issues/299#issuecomment-25772886)). + +![image](https://f.cloud.github.com/assets/306502/1195815/4bfa38d0-249d-11e3-823e-773cfc2ca894.png) + +#### Extensible pipeline + +Completely transform the statusline to your liking. Build out the statusline as you see fit by extracting colors from the current colorscheme's highlight groups. + +![allyourbase](https://f.cloud.github.com/assets/306502/1022714/e150034a-0da7-11e3-94a5-ca9d58a297e8.png) # Rationale @@ -22,9 +100,7 @@ There's already [powerline][2], why yet another statusline? What about [vim-powerline][1]? -* the author has been active developing powerline, which was rewritten in python and expands its capabilities to tools outside of Vim, such as bash, zsh, and tmux. -* vim-powerline has been deprecated as a result, and no features will be added to it. -* vim-powerline uses different font codes, so if you want to use it with a powerline themed tmux (for example), it will not work. +* vim-powerline has been deprecated in favor of the newer, unifying powerline, which is under active development; the new version is written in python at the core and exposes various bindings such that it can style statuslines not only in vim, but also tmux, bash, zsh, and others. # Where did the name come from? @@ -53,36 +129,36 @@ This plugin follows the standard runtime path structure, and as such it can be i For the nice looking powerline symbols to appear, you will need to install a patched font. Instructions can be found in the official powerline [documentation][20]. Prepatched fonts can be found in the [powerline-fonts][3] repository. -Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1` to your vimrc. +Finally, you can add the convenience variable `let g:airline_powerline_fonts = 1` to your vimrc which will automatically populate the `g:airline_symbols` dictionary with the powerline symbols. # FAQ Solutions to common problems can be found in the [Wiki][27]. -# Themes/Screenshots +# Screenshots -A full list of screenshots can be found in the [Wiki][14]. +A full list of screenshots for various themes can be found in the [Wiki][14]. # Bugs Tracking down bugs can take a very long time due to different configurations, versions, and operating systems. To ensure a timely response, please help me out by doing the following: -* reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. -* a link to your vimrc or a gist which shows how you configured the plugin(s). -* and so I can reproduce; your `:version` of vim, and the commit of vim-airline you're using. +* Reproduce it with this [minivimrc][7] repository to rule out any configuration conflicts. +* A link to your vimrc or a gist which shows how you configured the plugin(s). +* And so I can reproduce; your `:version` of vim, and the commit of vim-airline you're using. # Contributions Contributions and pull requests are welcome. Please take note of the following guidelines: -* adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords. -* keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend. -* any changes to the core should be tested against Vim 7.2. -* if you submit a theme, please create a screenshot so it can be added to the [Wiki][14]. +* Adhere to the existing style as much as possible; notably, 2 space indents and long-form keywords. +* Keep the history clean! squash your branches before you submit a pull request. `pull --rebase` is your friend. +* Any changes to the core should be tested against Vim 7.2. +* If you submit a theme, please create a screenshot so it can be added to the [Wiki][14]. # License -MIT license. Copyright (c) 2013 Bailey Ling. +MIT License. Copyright (c) 2013 Bailey Ling. [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bling/vim-airline/trend.png)](https://bitdeli.com/free "Bitdeli Badge") @@ -114,3 +190,10 @@ MIT license. Copyright (c) 2013 Bailey Ling. [25]: https://github.com/tomasr/molokai [26]: https://github.com/nanotech/jellybeans.vim [27]: https://github.com/bling/vim-airline/wiki/FAQ +[28]: https://github.com/chrisbra/csv.vim +[29]: https://github.com/airblade/vim-gitgutter +[30]: https://github.com/mhinz/vim-signify +[31]: https://github.com/jmcantrell/vim-virtualenv +[32]: https://github.com/chriskempson/base16-vim +[33]: https://github.com/bling/vim-airline/wiki/Test-Plan +[34]: http://eclim.org diff --git a/etc/soft/vim/vim/+plugins/vim-airline/Rakefile b/etc/soft/vim/vim/+plugins/vim-airline/Rakefile new file mode 100644 index 0000000..741cfc2 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/Rakefile @@ -0,0 +1,14 @@ +#!/usr/bin/env rake + +task :default => [:test] + +task :ci => [:dump, :test] + +task :dump do + sh 'vim --version' +end + +task :test do + sh 'bundle exec vim-flavor test' +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline.vim index 45d6688..664c78e 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline.vim @@ -1,187 +1,170 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +let g:airline_statusline_funcrefs = get(g:, 'airline_statusline_funcrefs', []) -let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') let s:sections = ['a','b','c','gutter','x','y','z','warning'] +let s:inactive_funcrefs = [] -let s:airline_highlight_map = { - \ 'mode' : 'Al2', - \ 'mode_separator' : 'Al3', - \ 'info' : 'Al4', - \ 'info_separator' : 'Al5', - \ 'statusline' : 'Al6', - \ 'file' : 'Al7', - \ } - -function! airline#exec_highlight(group, colors) - let colors = a:colors - if s:is_win32term - let colors = map(a:colors, 'v:val != "" && v:val > 128 ? v:val - 128 : v:val') - endif - exec printf('hi %s %s %s %s %s %s %s %s', - \ a:group, - \ colors[0] != '' ? 'guifg='.colors[0] : '', - \ colors[1] != '' ? 'guibg='.colors[1] : '', - \ colors[2] != '' ? 'ctermfg='.colors[2] : '', - \ colors[3] != '' ? 'ctermbg='.colors[3] : '', - \ len(colors) > 4 && colors[4] != '' ? 'gui='.colors[4] : '', - \ len(colors) > 4 && colors[4] != '' ? 'cterm='.colors[4] : '', - \ len(colors) > 4 && colors[4] != '' ? 'term='.colors[4] : '') +function! airline#add_statusline_func(name) + call airline#add_statusline_funcref(function(a:name)) endfunction -function! airline#reload_highlight() - call airline#highlight(['inactive']) - call airline#highlight(['normal']) +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#load_theme(name) - let g:airline_theme = a:name - let inactive_colors = g:airline#themes#{g:airline_theme}#inactive "also lazy loads the theme - let w:airline_lastmode = '' - call airline#highlight(['inactive']) - call airline#update_highlight() - call airline#extensions#load_theme() +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#highlight(modes) - " 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') - for mode in mapped - if exists('g:airline#themes#{g:airline_theme}#{mode}') - for key in keys(g:airline#themes#{g:airline_theme}#{mode}) - let colors = g:airline#themes#{g:airline_theme}#{mode}[key] - let suffix = a:modes[0] == 'inactive' ? '_inactive' : '' - call airline#exec_highlight(s:airline_highlight_map[key].suffix, colors) - endfor - endif - endfor +function! airline#add_inactive_statusline_func(name) + call add(s:inactive_funcrefs, function(a:name)) endfunction -" for 7.2 compatibility -function! s:getwinvar(winnr, key, ...) - let winvals = getwinvar(a:winnr, '') - return get(winvals, a:key, (a:0 ? a:1 : '')) -endfunction +function! airline#load_theme() + if exists('*airline#themes#{g:airline_theme}#refresh') + call airline#themes#{g:airline_theme}#refresh() + endif -function! s:get_section(winnr, key, ...) - let text = s:getwinvar(a:winnr, 'airline_section_'.a:key, g:airline_section_{a:key}) - let [prefix, suffix] = [get(a:000, 0, '%( '), get(a:000, 1, ' %)')] - return empty(text) ? '' : prefix.text.suffix -endfunction + let palette = g:airline#themes#{g:airline_theme}#palette + call airline#themes#patch(palette) -function! s:get_statusline(winnr, active) - let l:mode_color = a:active ? "%#Al2#" : "%#Al2_inactive#" - let l:mode_sep_color = a:active ? "%#Al3#" : "%#Al3_inactive#" - let l:info_color = a:active ? "%#Al4#" : "%#Al4_inactive#" - let l:info_sep_color = a:active ? "%#Al5#" : "%#Al5_inactive#" - let l:status_color = a:active ? "%#Al6#" : "%#Al6_inactive#" - let l:file_flag_color = a:active ? "%#Al7#" : "%#Al7_inactive#" - - let sl = '%{airline#update_highlight()}' - if a:active || s:getwinvar(a:winnr, 'airline_left_only', 0) - let sl.=l:mode_color.s:get_section(a:winnr, 'a') - let sl.='%{g:airline_detect_paste && &paste ? g:airline_paste_symbol." " : ""}' - let sl.=l:mode_sep_color - let sl.=a:active ? g:airline_left_sep : g:airline_left_alt_sep - let sl.=l:info_color - let sl.=s:get_section(a:winnr, 'b') - let sl.=l:info_sep_color - let sl.=g:airline_left_sep - let sl.=l:status_color.'%<'.s:get_section(a:winnr, 'c') - let sl.=' '.l:file_flag_color."%(%{&ro ? g:airline_readonly_symbol : ''}%)".l:status_color - let sl.=s:get_section(a:winnr, 'gutter', '', '') - let sl.=l:status_color - else - let sl.=l:status_color.' %f%m' - endif - if !s:getwinvar(a:winnr, 'airline_left_only', 0) - let sl.='%=' - let sl.=s:get_section(a:winnr, 'x') - let sl.=l:info_sep_color - let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep - let sl.=l:info_color - let sl.=s:get_section(a:winnr, 'y') - let sl.=l:mode_sep_color - let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep - let sl.=l:mode_color - let sl.=s:get_section(a:winnr, 'z') - let sl.='%(%#warningmsg#'.s:getwinvar(a:winnr, 'airline_section_warning', '').'%)' + if exists('g:airline_theme_patch_func') + let Fn = function(g:airline_theme_patch_func) + call Fn(palette) endif - return sl + + call airline#highlighter#load_theme() + call airline#extensions#load_theme() endfunction -function! airline#exec_funcrefs(list, break_early) - " for 7.2; we cannot iterate 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] - if a:break_early - if Fn{i}() - return 1 - endif +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 - call Fn{i}() + let g:airline_theme = 'dark' endif - endfor - return 0 + 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#update_statusline() - if airline#exec_funcrefs(g:airline_exclude_funcrefs, 1) - call setwinvar(winnr(), '&statusline', '') - return +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 - for nr in range(1, winnr('$')) - if nr != winnr() && getwinvar(nr, 'airline_active') - call setwinvar(nr, '&statusline', s:get_statusline(nr, 0)) - call setwinvar(nr, 'airline_active', 0) - endif +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 - let w:airline_active = 1 - - unlet! w:airline_left_only + unlet! w:airline_render_left + unlet! w:airline_render_right for section in s:sections unlet! w:airline_section_{section} endfor - call airline#exec_funcrefs(g:airline_statusline_funcrefs, 0) - call setwinvar(winnr(), '&statusline', s:get_statusline(winnr(), 1)) + 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#update_highlight() +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|)' - let l:mode = ['visual'] - elseif l:m =~# '\v(s|S|)' + elseif l:m =~# '\v(v|V||s|S|)' let l:mode = ['visual'] else let l:mode = ['normal'] endif - let g:airline_current_mode_text = get(g:airline_mode_map, l:m, l:m) - if g:airline_detect_iminsert && &iminsert - if get(g:, 'airline_powerline_fonts', 0) - let g:airline_current_mode_text .= ' '.g:airline_left_alt_sep - endif - let g:airline_current_mode_text .= ' '.toupper(get(b:, 'keymap_name', 'lang')) - 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 g:airline_detect_modified + if &modified + call add(l:mode, 'modified') + endif + endif + + if g:airline_detect_paste && &paste + call add(l:mode, 'paste') + endif let mode_string = join(l:mode) if get(w:, 'airline_lastmode', '') != mode_string - call airline#highlight(l:mode) + call airline#highlighter#highlight_modified_inactive(context.bufnr) + call airline#highlighter#highlight(l:mode) let w:airline_lastmode = mode_string endif + return '' endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/builder.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/builder.vim new file mode 100644 index 0000000..c165897 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/builder.vim @@ -0,0 +1,74 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +let s:prototype = {} + +function! s:prototype.split(...) + let self._side = 0 + let self._line .= '%#'.self._curgroup.'#'.(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) + if self._curgroup != '' + if self._curgroup == a:group + let self._line .= self._side ? self._context.left_alt_sep : self._context.right_alt_sep + else + call airline#highlighter#add_separator(self._curgroup, a:group, self._side) + let self._line .= '%#'.self._curgroup.'_to_'.a:group.'#' + let self._line .= self._side ? self._context.left_sep : self._context.right_sep + endif + endif + + if self._curgroup != a:group + let self._line .= '%#'.a:group.'#' + endif + + if 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 + + let self._line .= line + let self._curgroup = a:group +endfunction + +function! s:prototype.add_raw(text) + let self._line .= a:text +endfunction + +function! s:prototype.build() + if !self._context.active + let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g') + endif + return self._line +endfunction + +function! airline#builder#new(context) + let builder = copy(s:prototype) + let builder._context = a:context + let builder._side = 1 + let builder._curgroup = '' + let builder._line = '' + + 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/debug.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/debug.vim new file mode 100644 index 0000000..04d7e59 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/debug.vim @@ -0,0 +1,50 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/deprecation.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/deprecation.vim new file mode 100644 index 0000000..dd0567f --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/deprecation.vim @@ -0,0 +1,32 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions.vim index 9ac211d..385fcb6 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions.vim @@ -1,52 +1,78 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 let s:ext = {} -let s:ext._cursormove_funcrefs = [] -function! s:ext.add_statusline_funcref(funcref) dict - call add(g:airline_statusline_funcrefs, a:funcref) +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_cursormove_funcref(funcref) dict - call add(self._cursormove_funcrefs, a:funcref) +function! s:ext.add_theme_func(name) dict + call add(self._theme_funcrefs, function(a:name)) endfunction +let s:script_path = tolower(resolve(expand(':p:h'))) + let s:filetype_overrides = { \ 'netrw': [ 'netrw', '%f' ], - \ 'unite': [ 'Unite', '%{unite#get_status_string()}' ], \ 'nerdtree': [ 'NERD', '' ], - \ 'undotree': [ 'undotree', '' ], \ 'gundo': [ 'Gundo', '' ], \ 'diff': [ 'diff', '' ], - \ 'vimshell': [ 'vimshell', '%{vimshell#get_status_string()}' ], \ 'vimfiler': [ 'vimfiler', '%{vimfiler#get_status_string()}' ], \ 'minibufexpl': [ 'MiniBufExplorer', '' ], \ 'startify': [ 'startify', '' ], \ } +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 check_defined_section(a:name) + let w:airline_section_{a:name} .= a:value +endfunction + +function! airline#extensions#prepend_to_section(name, value) + call 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 = '' - let w:airline_section_gutter = ' ' - let w:airline_left_only = 1 + 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#update_statusline() +function! airline#extensions#apply(...) let s:active_winnr = winnr() + if s:is_excluded_window() + return -1 + endif + if &buftype == 'quickfix' - let w:airline_section_a = 'Quickfix' - let w:airline_section_b = '' + let w:airline_section_a = '%q' + let w:airline_section_b = '%{get(w:, "quickfix_title", "")}' let w:airline_section_c = '' let w:airline_section_x = '' elseif &buftype == 'help' - let w:airline_section_a = 'Help' - let w:airline_section_b = '%f' - let w:airline_section_c = '' - let w:airline_section_gutter = ' ' + 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 @@ -59,9 +85,15 @@ function! airline#extensions#update_statusline() 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! airline#extensions#is_excluded_window() +function! s:is_excluded_window() for matchft in g:airline_exclude_filetypes if matchft ==# &ft return 1 @@ -82,16 +114,11 @@ function! airline#extensions#is_excluded_window() endfunction function! airline#extensions#load_theme() - if get(g:, 'loaded_ctrlp', 0) - call airline#extensions#ctrlp#load_theme() - endif + call airline#util#exec_funcrefs(s:ext._theme_funcrefs, g:airline#themes#{g:airline_theme}#palette) endfunction function! s:sync_active_winnr() - if winnr() != s:active_winnr - if airline#exec_funcrefs(s:ext._cursormove_funcrefs, 1) - return - endif + if exists('#airline') && winnr() != s:active_winnr call airline#update_statusline() endif endfunction @@ -100,12 +127,8 @@ function! airline#extensions#load() " non-trivial number of external plugins use eventignore=all, so we need to account for that autocmd CursorMoved * call sync_active_winnr() - " load core funcrefs - call add(g:airline_exclude_funcrefs, function('airline#extensions#is_excluded_window')) - call add(g:airline_statusline_funcrefs, function('airline#extensions#update_statusline')) - if get(g:, 'loaded_unite', 0) - let g:unite_force_overwrite_statusline = 0 + call airline#extensions#unite#init(s:ext) endif if get(g:, 'loaded_vimfiler', 0) @@ -120,26 +143,76 @@ function! airline#extensions#load() call airline#extensions#commandt#init(s:ext) endif - if exists(':TagbarToggle') + 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')) + 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 g:airline_enable_branch && (get(g:, 'loaded_fugitive', 0) || get(g:, 'loaded_lawrencium', 0)) + 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')) call airline#extensions#branch#init(s:ext) endif - if g:airline_enable_syntastic && get(g:, 'loaded_syntastic_plugin') + 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 get(g:, 'virtualenv_loaded', 0) && 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 g:airline_enable_bufferline && exists('*bufferline#get_status_string') - call airline#extensions#bufferline#init(s:ext) + if (get(g:, 'airline#extensions#whitespace#enabled', 1) && get(g:, 'airline_detect_whitespace', 1)) + call airline#extensions#whitespace#init(s:ext) endif - if g:airline_detect_whitespace - call airline#extensions#whitespace#init() + if get(g:, 'airline#extensions#tabline#enabled', 0) + call airline#extensions#tabline#init(s:ext) endif - call airline#exec_funcrefs(g:airline_statusline_funcrefs, 0) + " load all other extensions not part of the default distribution + 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 endfunction diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/branch.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/branch.vim index aa6db6e..254ce7b 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/branch.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/branch.vim @@ -1,15 +1,66 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent - -function! airline#extensions#branch#apply() - let g:airline_current_branch = exists('*fugitive#head') && strlen(fugitive#head()) > 0 - \ ? g:airline_branch_prefix.fugitive#head() - \ : exists('*lawrencium#statusline') && strlen(lawrencium#statusline()) > 0 - \ ? g:airline_branch_prefix.lawrencium#statusline() - \ : '' +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +let s:has_fugitive = exists('*fugitive#head') +let s:has_fugitive_detect = exists('*fugitive#detect') +let s:has_lawrencium = exists('*lawrencium#statusline') + +if !s:has_fugitive && !s:has_lawrencium + finish +endif + +let s:empty_message = get(g:, 'airline#extensions#branch#empty_message', + \ get(g:, 'airline_branch_empty_message', '')) +let s:symbol = get(g:, 'airline#extensions#branch#symbol', g:airline_symbols.branch) + +function! airline#extensions#branch#get_head() + let head = '' + + if s:has_fugitive && !exists('b:mercurial_dir') + let head = fugitive#head() + + if empty(head) && s:has_fugitive_detect && !exists('b:git_dir') + call fugitive#detect(getcwd()) + let head = fugitive#head() + endif + endif + + if empty(head) + if s:has_lawrencium + let head = lawrencium#statusline() + endif + endif + + return empty(head) || !s:check_in_path() + \ ? s:empty_message + \ : printf('%s%s', empty(s:symbol) ? '' : s: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:h')) + + 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 a:ext.add_statusline_funcref(function('airline#extensions#branch#apply')) + call airline#parts#define_function('branch', 'airline#extensions#branch#get_head') + + autocmd BufReadPost * unlet! b:airline_file_in_root endfunction diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/bufferline.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/bufferline.vim index 852b33c..0c6013c 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/bufferline.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/bufferline.vim @@ -1,16 +1,23 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 -function! airline#extensions#bufferline#init(ext) - highlight AlBl_active gui=bold cterm=bold term=bold - highlight link AlBl_inactive Al6 - let g:bufferline_inactive_highlight = 'AlBl_inactive' - let g:bufferline_active_highlight = 'AlBl_active' - let g:bufferline_active_buffer_left = '' - let g:bufferline_active_buffer_right = '' - let g:bufferline_separator = ' ' +if !exists('*bufferline#get_status_string') + finish +endif + +let s:overwrite = get(g:, 'airline#extensions#bufferline#overwrite_variables', 1) - if g:airline_section_c == '%f%m' - let g:airline_section_c = '%{bufferline#refresh_status()}'.bufferline#get_status_string() +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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/commandt.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/commandt.vim index ac74aff..1353940 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/commandt.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/commandt.vim @@ -1,12 +1,16 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 -function! airline#extensions#commandt#apply() +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_funcref(function('airline#extensions#commandt#apply')) + call a:ext.add_statusline_func('airline#extensions#commandt#apply') endfunction diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/csv.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/csv.vim new file mode 100644 index 0000000..d3a8cc8 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/csv.vim @@ -0,0 +1,31 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/ctrlp.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/ctrlp.vim index d17ce2f..64e2885 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/ctrlp.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/ctrlp.vim @@ -1,5 +1,11 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 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 { @@ -12,31 +18,40 @@ function! airline#extensions#ctrlp#generate_color_map(dark, light, white) \ } endfunction -function! airline#extensions#ctrlp#load_theme() - if exists('g:airline#themes#{g:airline_theme}#ctrlp') - let theme = g:airline#themes#{g:airline_theme}#ctrlp +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( - \ g:airline#themes#{g:airline_theme}#insert['statusline'], - \ g:airline#themes#{g:airline_theme}#insert['info'], - \ g:airline#themes#{g:airline_theme}#insert['mode']) + \ 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#exec_highlight(key, theme[key]) + call airline#highlighter#exec(key, theme[key]) endfor endfunction -" Arguments: focus, byfname, s:regexp, prv, item, nxt, marked +" Arguments: focus, byfname, regexp, prv, item, nxt, marked function! airline#extensions#ctrlp#ctrlp_airline(...) - let regex = a:3 ? '%#CtrlPlight# regex %*' : '' - let prv = '%#CtrlPlight# '.a:4.' %#Ctrlparrow1#'.g:airline_left_sep - let item = '%#CtrlPwhite# '.a:5.' %#CtrlParrow2#'.g:airline_left_sep - let nxt = '%#CtrlPlight# '.a:6.' %#CtrlParrow3#'.g:airline_left_sep - let marked = '%#CtrlPdark# '.a:7.' ' - let focus = '%=%<%#CtrlPdark# '.a:1.' %*' - let byfname = '%#CtrlParrow3#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*' - let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*' - return regex.prv.item.nxt.marked.focus.byfname.dir + let b = airline#builder#new({'active': 1}) + 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_raw('%#CtrlPdark#'.a:1.(g:airline_symbols.space)) + call b.add_section_spaced('CtrlPdark', a:2) + call b.add_section_spaced('CtrlPlight', '%{getcwd()}') + return b.build() endfunction " Argument: len @@ -46,8 +61,9 @@ function! airline#extensions#ctrlp#ctrlp_airline_status(...) return len.dir endfunction -function! airline#extensions#ctrlp#is_statusline_overwritten() - return match(&statusline, 'CtrlPlight') >= 0 +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) @@ -55,5 +71,7 @@ function! airline#extensions#ctrlp#init(ext) \ 'main': 'airline#extensions#ctrlp#ctrlp_airline', \ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status', \ } - call a:ext.add_cursormove_funcref(function('airline#extensions#ctrlp#is_statusline_overwritten')) + call a:ext.add_statusline_func('airline#extensions#ctrlp#apply') + call a:ext.add_theme_func('airline#extensions#ctrlp#load_theme') endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/default.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/default.vim new file mode 100644 index 0000000..5d21996 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/default.vim @@ -0,0 +1,77 @@ +" MIT License. Copyright (c) 2013 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 build_sections(a:builder, a:context, s:layout[0]) + else + call a:builder.add_section('airline_c'.(a:context.bufnr), ' %f%m ') + endif + + call a:builder.split(s:get_section(winnr, 'gutter', '', '')) + + if airline#util#getwinvar(winnr, 'airline_render_right', 1) + call build_sections(a:builder, a:context, s:layout[1]) + endif + + return 1 +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/eclim.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/eclim.vim new file mode 100644 index 0000000..ff6a84f --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/eclim.vim @@ -0,0 +1,35 @@ +" MIT License. Copyright (c) 2013 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) + let errorsLine = eclimList[0]['line'] + let errorsNumber = len(eclimList) + let errors = "[Eclim: line:".string(errorsLine)." (".string(errorsNumber).")]" + if !exists(':SyntasticCheck') || SyntasticStatuslineFlag() == '' + return errors.(g:airline_symbols.space) + 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/example.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/example.vim new file mode 100644 index 0000000..0c64f2c --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/example.vim @@ -0,0 +1,54 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/hunks.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/hunks.vim new file mode 100644 index 0000000..73c0e2e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/hunks.vim @@ -0,0 +1,63 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !get(g:, 'loaded_signify', 0) && !get(g:, 'loaded_gitgutter', 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:get_hunks_gitgutter() + if !get(g:, 'gitgutter_enabled', 0) + return '' + endif + return GitGutterGetHunkSummary() +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' + 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/syntastic.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/syntastic.vim index 8506903..3ecc1eb 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/syntastic.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/syntastic.vim @@ -1,12 +1,19 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 -function! airline#extensions#syntastic#apply() - if exists('w:airline_active') && w:airline_active - let w:airline_section_warning = ' %#warningmsg#%{SyntasticStatuslineFlag()}' +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 a:ext.add_statusline_funcref(function('airline#extensions#syntastic#apply')) + call airline#parts#define_function('syntastic', 'airline#extensions#syntastic#get_warnings') endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline.vim new file mode 100644 index 0000000..f686003 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline.vim @@ -0,0 +1,225 @@ +" MIT License. Copyright (c) 2013 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: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 s:builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , "\ue0b0") + let s:builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , "\ue0b1") +else + let s:builder_context.left_sep = get(g:, 'airline#extensions#tabline#left_sep' , ' ') + let s:builder_context.left_alt_sep = get(g:, 'airline#extensions#tabline#left_alt_sep' , '|') +endif + +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) + +function! airline#extensions#tabline#init(ext) + if has('gui_running') + set guioptions-=e + endif + + set tabline=%!airline#extensions#tabline#get() + + if s:buf_min_count <= 0 && s:tab_min_count <= 1 + set showtabline=2 + else + if s:show_buffers == 1 + autocmd CursorMoved * call on_cursormove(s:buf_min_count, len(s:get_buffer_list())) + else + autocmd TabEnter * call on_cursormove(s:tab_min_count, tabpagenr('$')) + endif + endif + + call a:ext.add_theme_func('airline#extensions#tabline#load_theme') +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) + 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_tabhid', l:tabhid) +endfunction + +function! s:on_cursormove(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() + if s:show_buffers && tabpagenr('$') == 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#formatters#{s:formatter}(a:nr, get(s:, 'current_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 + + return buffers +endfunction + +function! s:get_buffers() + let b = airline#builder#new(s:builder_context) + let cur = bufnr('%') + 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 + else + if index(tab_bufs, nr) > -1 + let group = 'airline_tab' + else + let group = 'airline_tabhid' + endif + endif + call b.add_section(group, '%( %{airline#extensions#tabline#get_buffer_name('.nr.')} %)') + endfor + + call b.add_section('airline_tabfill', '') + call b.split() + call b.add_section('airline_tabtype', ' buffers ') + return b.build() +endfunction + +function! s:get_tabs() + let b = airline#builder#new(s:builder_context) + for i in range(1, tabpagenr('$')) + if i == tabpagenr() + 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 + else + let group = 'airline_tab' + endif + let val = '%(' + if s:tab_nr_type == 0 + let val .= ' %{len(tabpagebuflist('.i.'))}' + else + let val .= (g:airline_symbols.space).i + 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() + call b.add_section('airline_tab', ' %999XX ') + call b.add_section('airline_tabtype', ' tabs ') + return b.build() +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline/formatters.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline/formatters.vim new file mode 100644 index 0000000..9485bb3 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tabline/formatters.vim @@ -0,0 +1,34 @@ +" MIT License. Copyright (c) 2013 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#formatters#default(bufnr, buffers) + let _ = '' + + if s:buf_nr_show + let _ .= printf(s:buf_nr_format, a:bufnr) + endif + + 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 + + if getbufvar(a:bufnr, '&modified') == 1 + let _ .= s:buf_modified_symbol + endif + + return _ +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tagbar.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tagbar.vim index 27fe0b0..061a47f 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tagbar.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/tagbar.vim @@ -1,14 +1,39 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 -function! airline#extensions#tagbar#apply() - let w:airline_section_x = '%(%{tagbar#currenttag("%s","")} '.g:airline_right_alt_sep.' %)'.g:airline_section_x - if &ft == 'tagbar' - call airline#extensions#apply_left_override('Tagbar', '%{TagbarGenerateStatusline()}') +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 +function! airline#extensions#tagbar#currenttag() + if get(w:, 'airline_active', 0) + return tagbar#currenttag('%s', '', s:flags) + endif + return '' +endfunction + function! airline#extensions#tagbar#init(ext) - call a:ext.add_statusline_funcref(function('airline#extensions#tagbar#apply')) + 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 diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/undotree.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/undotree.vim new file mode 100644 index 0000000..d897f04 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/undotree.vim @@ -0,0 +1,27 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/unite.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/unite.vim new file mode 100644 index 0000000..4db3858 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/unite.vim @@ -0,0 +1,23 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/virtualenv.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/virtualenv.vim new file mode 100644 index 0000000..c052282 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/virtualenv.vim @@ -0,0 +1,20 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +if !get(g:, 'virtualenv_loaded', 0) + 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" + call airline#extensions#append_to_section('x', + \ s:spc.g:airline_right_alt_sep.s:spc.'%{virtualenv#statusline()}') + endif +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/whitespace.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/whitespace.vim index a37659a..99dfd76 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/whitespace.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/extensions/whitespace.vim @@ -1,26 +1,51 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 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:checks = get(g:, 'airline#extensions#whitespace#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:enabled = 1 + function! airline#extensions#whitespace#check() - if &readonly || !g:airline_detect_whitespace + if &readonly || !&modifiable || !s:enabled return '' endif if !exists('b:airline_whitespace_check') let b:airline_whitespace_check = '' - let trailing = search(' $', 'nw') - let mixed = search('^ ', 'nw') != 0 && search('^\t', 'nw') != 0 + + let trailing = 0 + if index(s:checks, 'trailing') > -1 + let trailing = search(' $', 'nw') + endif + + let mixed = 0 + if index(s:checks, 'indent') > -1 + let indents = [search('^ \{2,}', 'nb'), search('^ \{2,}', 'n'), search('^\t', 'nb'), search('^\t', 'n')] + let mixed = indents[0] != 0 && indents[1] != 0 && indents[2] != 0 && indents[3] != 0 + endif if trailing != 0 || mixed - let b:airline_whitespace_check = g:airline_whitespace_symbol." " - if g:airline_detect_whitespace == 1 + let b:airline_whitespace_check = s:symbol + if s:show_message if trailing != 0 - let b:airline_whitespace_check .= 'trailing['.trailing.'] ' + let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:trailing_format, trailing) endif if mixed - let b:airline_whitespace_check .= 'mixed-indent ' + let mixnr = indents[0] == indents[1] ? indents[0] : indents[2] + let b:airline_whitespace_check .= (g:airline_symbols.space).printf(s:mixed_indent_format, mixnr) endif endif endif @@ -28,31 +53,22 @@ function! airline#extensions#whitespace#check() return b:airline_whitespace_check endfunction! -function! airline#extensions#whitespace#apply() - if exists('w:airline_active') && w:airline_active - if !exists('w:airline_section_warning') - let w:airline_section_warning = ' ' - endif - let w:airline_section_warning .= '%{airline#extensions#whitespace#check()}' - endif -endfunction - function! airline#extensions#whitespace#toggle() - let g:airline_detect_whitespace = !g:airline_detect_whitespace - if g:airline_detect_whitespace - call airline#extensions#whitespace#init() - else + if s:enabled autocmd! airline_whitespace CursorHold,BufWritePost + augroup! airline_whitespace + let s:enabled = 0 + else + call airline#extensions#whitespace#init() + let s:enabled = 1 endif + echo 'Whitespace checking: '.(s:enabled ? 'Enabled' : 'Disabled') endfunction -let s:initialized = 0 -function! airline#extensions#whitespace#init() - if !s:initialized - let s:initialized = 1 - call add(g:airline_statusline_funcrefs, function('airline#extensions#whitespace#apply')) - endif +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 diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/highlighter.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/highlighter.vim new file mode 100644 index 0000000..24aa6fa --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/highlighter.vim @@ -0,0 +1,148 @@ +" MIT License. Copyright (c) 2013 Bailey Ling. +" vim: et ts=2 sts=2 sw=2 + +let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') +let s:separators = {} + +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 = synIDattr(synIDtrans(hlID(a:group)), 'reverse', has('gui_running') ? 'gui' : '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 exec_separator({}, a:from, a:to, a:inverse, '') +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(p.accents) + 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 exec_separator(dict, sep[1][0], sep[1][1], sep[1][2], suffix) + endfor + endif + endfor +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/init.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/init.vim new file mode 100644 index 0000000..98e662e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/init.vim @@ -0,0 +1,113 @@ +" MIT License. Copyright (c) 2013 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']) + + 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', '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(['%3p%%'.spc, 'linenr', ':%3c ']) + endif + if !exists('g:airline_section_warning') + let g:airline_section_warning = airline#section#create(['syntastic', 'eclim', 'whitespace']) + endif +endfunction + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/parts.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/parts.vim new file mode 100644 index 0000000..bec4504 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/parts.vim @@ -0,0 +1,79 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/section.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/section.vim new file mode 100644 index 0000000..aba88a0 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/section.vim @@ -0,0 +1,72 @@ +" MIT License. Copyright (c) 2013 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') + 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes.vim index c7a571a..110a9dc 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes.vim @@ -1,46 +1,67 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 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(section1, section2, section3, file) - " guifg guibg ctermfg ctermbg gui/term - return { - \ 'mode': [ a:section1[0] , a:section1[1] , a:section1[2] , a:section1[3] , get(a:section1, 4, 'bold') ] , - \ 'mode_separator': [ a:section1[1] , a:section2[1] , a:section1[3] , a:section2[3] , '' ] , - \ 'info': [ a:section2[0] , a:section2[1] , a:section2[2] , a:section2[3] , get(a:section2, 4, '' ) ] , - \ 'info_separator': [ a:section2[1] , a:section3[1] , a:section2[3] , a:section3[3] , '' ] , - \ 'statusline': [ a:section3[0] , a:section3[1] , a:section3[2] , a:section3[3] , get(a:section3, 4, '' ) ] , - \ 'file': [ a:file[0] , a:file[1] , a:file[2] , a:file[3] , get(a:file , 4, '' ) ] , - \ } -endfunction +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 , '') ] , + \ } -function! s:get_syn(group, what) - let color = synIDattr(synIDtrans(hlID(a:group)), a:what) - if empty(color) || color == -1 - let color = synIDattr(synIDtrans(hlID('Normal')), a:what) - endif - if empty(color) || color == -1 - let color = a:what ==# 'fg' ? 0 : 1 + 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 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, ',') ] + return palette endfunction function! airline#themes#get_highlight(group, ...) - let fg = s:get_syn(a:group, 'fg') - let bg = s:get_syn(a:group, 'bg') - return s:get_array(fg, bg, a:000) + return call('airline#highlighter#get_highlight', [a:group] + a:000) endfunction function! airline#themes#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) + 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/badwolf.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/badwolf.vim index 94b97f8..41a25d1 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/badwolf.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/badwolf.vim @@ -15,40 +15,38 @@ let s:V4 = [ '#c7915b' , 173 ] " coffee let s:PA = [ '#f4cf86' , 222 ] " dirtyblonde let s:RE = [ '#ff9eb8' , 211 ] " dress -let s:file = [ '#ff2c4b' , s:N3[1] , 196 , s:N3[3] , '' ] -let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#badwolf#normal_modified = { - \ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] , - \ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , - \ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#badwolf#insert_modified = { - \ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } -let g:airline#themes#badwolf#insert_paste = { - \ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] , - \ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[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#replace = copy(airline#themes#badwolf#insert) -let g:airline#themes#badwolf#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] -let g:airline#themes#badwolf#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ] -let g:airline#themes#badwolf#replace_modified = g:airline#themes#badwolf#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#badwolf#visual_modified = { - \ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] , - \ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } +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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#badwolf#inactive_modified = { - \ 'statusline' : [ s:V1[1] , '' , s:V1[3] , '' , '' ] } + +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] , '' , '' ] } diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/base16.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/base16.vim new file mode 100644 index 0000000..469435e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/base16.vim @@ -0,0 +1,107 @@ +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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/bubblegum.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/bubblegum.vim index f6e3d0c..d18e032 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/bubblegum.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/bubblegum.vim @@ -20,45 +20,43 @@ let s:cterm_red = 174 let s:gui_pink = '#d7afd7' let s:cterm_pink = 182 -let s:file = ['#ff0000', '#1c1c1c', 160, 233, ''] +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#bubblegum#normal_modified = { - \ 'statusline': [s:gui_orange, s:gui_med_gray_hi, s:cterm_orange, s:cterm_med_gray_hi, ''], +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#insert = airline#themes#generate_color_map(s:I1, s:N2, s:I3, s:file) -let g:airline#themes#bubblegum#insert_modified = copy(g:airline#themes#bubblegum#normal_modified) -let g:airline#themes#bubblegum#insert_paste = { - \ 'mode': [s:gui_dark_gray, s:gui_orange, s:cterm_dark_gray, s:cterm_orange, ''], - \ 'mode_separator': [s:gui_orange, s:gui_med_gray_lo, s:cterm_orange, s:cterm_med_gray_lo, ''], +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#replace = { - \ 'mode': [s:gui_dark_gray, s:gui_red, s:cterm_dark_gray, s:cterm_red, ''], - \ 'mode_separator': [s:gui_red, s:N2[1], s:cterm_red, s:N2[3], ''], - \ 'statusline': [s:gui_red, s:gui_med_gray_hi, s:cterm_red, s:cterm_med_gray_hi, ''], +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#replace_modified = copy(g:airline#themes#bubblegum#insert_modified) +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#visual = airline#themes#generate_color_map(s:V1, s:N2, s:V3, s:file) -let g:airline#themes#bubblegum#visual_modified = copy(g:airline#themes#bubblegum#insert_modified) +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_dark_gray, s:gui_med_gray_hi, s:cterm_dark_gray, s:cterm_med_gray_hi, ''] -let g:airline#themes#bubblegum#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#bubblegum#inactive_modified = { - \ 'statusline': [s:gui_orange, '', s:cterm_orange, '', ''], +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, '', ''], \ } diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/dark.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/dark.vim index f3f9dd6..217b2f1 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/dark.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/dark.vim @@ -16,73 +16,75 @@ " 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 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. " -" The array is in the format [ guifg, guibg, ctermfg, ctermbg, opts ]. -" The opts takes in values from ":help attr-list". -let s:file = [ '#ff0000' , '#1c1c1c' , 160 , 233 , '' ] -let s:N1 = [ '#00005f' , '#dfff00' , 17 , 190 ] -let s:N2 = [ '#ffffff' , '#444444' , 255 , 238 ] -let s:N3 = [ '#9cffd3' , '#202020' , 85 , 234 ] - -" vim-airline is made up of multiple sections, but for theming purposes there -" is only 3 sections: the mode, the branch indicator, and the gutter (which -" then get mirrored on the right side). generate_color_map is a helper -" function which generates a dictionary which declares the full colorscheme -" for the statusline. See the source code of "autoload/airline/themes.vim" -" for the full set of keys available for theming. +" 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 = {} -" Now let's define the global g: variable that declares the colors used for -" normal mode. The # is a separator that maps with the directory structure. -" If you get this wrong, Vim will complain loudly. -let g:airline#themes#dark#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) +" 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#normal, hence why only certain keys are +" applied after g:airline#themes#dark#palette.normal, hence why only certain keys are " declared. -let g:airline#themes#dark#normal_modified = { - \ 'info_separator': [ '#444444' , '#5f005f' , 238 , 53 , '' ] , - \ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#dark#insert_modified = { - \ 'info_separator': [ '#005fff' , '#5f005f' , 27 , 53 , '' ] , - \ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , +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#insert_paste = { - \ 'mode': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , - \ 'mode_separator': [ '#d78700' , s:I2[1] , 172 , s:I2[3] , '' ] , +let g:airline#themes#dark#palette.insert_paste = { + \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , \ } -let g:airline#themes#dark#replace = copy(g:airline#themes#dark#insert) -let g:airline#themes#dark#replace.mode = [ s:I2[0] , '#af0000' , s:I2[2] , 124 , '' ] -let g:airline#themes#dark#replace.mode_separator = [ '#af0000' , s:I2[1] , 124 , s:I2[3] , '' ] -let g:airline#themes#dark#replace_modified = g:airline#themes#dark#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#dark#visual_modified = { - \ 'info_separator': [ '#ff5f00' , '#5f005f' , 202 , 53 , '' ] , - \ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] , +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 , '' , '' ] , \ } -let s:IA = [ '#4e4e4e' , '#1c1c1c' , 239 , 234 , '' ] -let g:airline#themes#dark#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#dark#inactive_modified = { - \ 'statusline': [ '#5f005f' , '' , '53' , '' , '' ] , +" 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 , '' ] \ } @@ -90,9 +92,11 @@ let g:airline#themes#dark#inactive_modified = { " 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) - let g:airline#themes#dark#ctrlp = airline#extensions#ctrlp#generate_color_map( - \ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ], - \ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ], - \ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ]) +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' ]) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/jellybeans.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/jellybeans.vim index 91e95ef..201068c 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/jellybeans.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/jellybeans.vim @@ -1,4 +1,7 @@ -function! s:generate() +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, @@ -6,42 +9,44 @@ function! s:generate() " Here are examples where the entire highlight group is copied and an airline " compatible color array is generated. - let s:file = airline#themes#get_highlight('Constant') 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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) - let g:airline#themes#jellybeans#normal_modified = { - \ 'statusline': [ '#ffb964', '', 215, '', '' ] + + 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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) - let g:airline#themes#jellybeans#insert_modified = g:airline#themes#jellybeans#normal_modified + 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#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file) - let g:airline#themes#jellybeans#replace_modified = g:airline#themes#jellybeans#normal_modified + 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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) - let g:airline#themes#jellybeans#visual_modified = g:airline#themes#jellybeans#normal_modified + 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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) + 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 s:generate() -augroup airline_jellybeans - autocmd! - autocmd ColorScheme * call generate() -augroup END +call airline#themes#jellybeans#refresh() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/laederon.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/laederon.vim index 26ab957..115c107 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/laederon.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/laederon.vim @@ -24,39 +24,39 @@ let s:RE = [ '#233e09' , 22 ] " oakleaf " Paste mode let s:PA = [ '#ab3e5d' , 161 ] " raspberry -let s:file = [ '#ef393d' , s:N3[1] , 196 , s:N3[3] , '' ] -let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] +let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] -let g:airline#themes#laederon#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#laederon#normal_modified = { - \ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] , - \ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , - \ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } +let g:airline#themes#laederon#palette = {} +let g:airline#themes#laederon#palette.accents = { + \ 'red': [ '#ef393d' , '' , 196 , '' , '' ] + \ } -let g:airline#themes#laederon#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#laederon#insert_modified = { - \ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] } -let g:airline#themes#laederon#insert_paste = { - \ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] , - \ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[3] , '' ] } +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#replace = copy(airline#themes#laederon#insert) -let g:airline#themes#laederon#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] -let g:airline#themes#laederon#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ] -let g:airline#themes#laederon#replace_modified = g:airline#themes#laederon#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#laederon#visual_modified = { - \ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] , - \ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#laederon#inactive_modified = { - \ 'statusline' : [ s:V1[1] , '', s:V1[3] , '', '' ] } +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] , '' , '' ] } + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/light.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/light.vim index cba9186..d9fe844 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/light.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/light.vim @@ -1,47 +1,45 @@ -let s:file = [ '#df0000' , '#ffffff' , 160 , 255 ] +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#light#normal_modified = { - \ 'info_separator': [ '#00dfff' , '#ffdfdf' , 45 , 224 , '' ] , - \ 'statusline': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#light#insert_modified = { - \ 'info_separator': [ '#00df87' , '#ffdfdf' , 42 , 224 , '' ] , - \ 'statusline': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , +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#insert_paste = { - \ 'mode': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , - \ 'mode_separator': [ '#d78700' , s:I2[1] , 172 , s:I2[3] , '' ] , +let g:airline#themes#light#palette.insert_paste = { + \ 'airline_a': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , \ } -let g:airline#themes#light#replace = copy(g:airline#themes#light#insert) -let g:airline#themes#light#replace.mode = [ s:I2[0] , '#ff0000' , s:I1[2] , 196 , '' ] -let g:airline#themes#light#replace.mode_separator = [ '#ff0000' , s:I2[1] , 196 , s:I2[3] , '' ] -let g:airline#themes#light#replace_modified = g:airline#themes#light#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#light#visual_modified = { - \ 'info_separator': [ '#ffaf00' , '#ffdfdf' , 214 , 224 , '' ] , - \ 'statusline': [ '#df0000' , '#ffdfdf' , 160 , 224 , '' ] , +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:IA = [ '#9e9e9e' , '#ffffff' , 247 , 255 , '' ] -let g:airline#themes#light#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#light#inactive_modified = { - \ 'statusline': [ '#df0000' , '' , '160' , '', '' ] +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 , '' , '' ] , \ } diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/lucius.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/lucius.vim new file mode 100644 index 0000000..e386900 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/lucius.vim @@ -0,0 +1,56 @@ +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() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/luna.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/luna.vim index 38f7e02..0024188 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/luna.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/luna.vim @@ -1,56 +1,92 @@ " vim-airline companion theme of Luna " (https://github.com/Pychimp/vim-luna) -let s:file = [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] -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 = {} + +let g:airline#themes#luna#palette.accents = { + \ 'red': [ '#ffffff' , '' , 231 , '' , '' ], + \ } -let g:airline#themes#luna#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#luna#normal_modified = { - \ 'info_separator': [ '#003f3f' , '#450000' , 29 , 52 , '' ] , - \ 'statusline': [ '#ffffff' , '#450000' , 231 , 52 , '' ] , +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#luna#insert_modified = { - \ 'info_separator': [ '#003f3f' , '#005e5e' , 29 , 52 , '' ] , - \ 'statusline': [ '#ffffff' , '#005e5e' , 255 , 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#insert_paste = { - \ 'mode': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] , - \ 'mode_separator': [ '#789f00' , s:I2[1] , 106 , s:I2[3] , '' ] , +let g:airline#themes#luna#palette.insert_paste = { + \ 'airline_a': [ s:I1[0] , '#789f00' , s:I1[2] , 106 , '' ] , \ } -let g:airline#themes#luna#replace = copy(g:airline#themes#luna#insert) -let g:airline#themes#luna#replace.mode = [ s:I2[0] , '#920000' , s:I2[2] , 88 , '' ] -let g:airline#themes#luna#replace.mode_separator = [ '#920000' , s:I2[1] , 88 , s:I2[3] , '' ] -let g:airline#themes#luna#replace_modified = g:airline#themes#luna#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#luna#visual_modified = { - \ 'info_separator': [ '#003f3f' , '#450000' , 29 , 52 , '' ] , - \ 'statusline': [ '#ffffff' , '#450000' , 231 , 52 , '' ] , +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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#luna#inactive_modified = { - \ 'statusline': [ '#f88379' , '' , '210' , '' , '' ] , +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': [ '#450000' , '' , 52 , '' , '' ] , + \ } + +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, ''], \ } -if get(g:, 'loaded_ctrlp', 0) - let g:airline#themes#luna#ctrlp = airline#extensions#ctrlp#generate_color_map( - \ [ '#ffffff' , '#002b2b' , 231 , 23 , '' ] , - \ [ '#ffffff' , '#005252' , 231 , 36 , '' ] , - \ [ '#ffffff' , '#973d45' , 231 , 95 , '' ] ) +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 , '' ] ) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/molokai.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/molokai.vim index 7fe6fed..1998f00 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/molokai.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/molokai.vim @@ -1,14 +1,18 @@ -let s:file = [ '#66d9ef' , '#465457' , 81 , 67 , 'bold' ] +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#molokai#normal_modified = { - \ 'info_separator': [ '#232526' , '#e6db74' , 16 , 144 , '' ] , - \ 'statusline': [ '#080808' , '#e6db74' , 232 , 144 , '' ] , +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 , '' ] , \ } @@ -17,20 +21,17 @@ 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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#molokai#insert_modified = { - \ 'info_separator': [ '#232526' , '#66d9ef' , 16 , 81 , '' ] , - \ 'statusline': [ '#080808' , '#66d9ef' , 232 , 81 , '' ] , +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#replace = copy(g:airline#themes#molokai#insert) -let g:airline#themes#molokai#replace.mode = [ s:I1[0] , '#ef5939' , s:I1[2] , 166 , '' ] -let g:airline#themes#molokai#replace.mode_separator = [ '#ef5939' , s:I2[1] , 166 , s:I2[3] , '' ] -let g:airline#themes#molokai#replace_modified = { - \ 'info_separator': [ '#232526' , '#ef5939' , 16 , 166 , '' ] , - \ 'statusline': [ '#080808' , '#ef5939' , 232 , 166 , '' ] , +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 , '' ] , \ } @@ -39,23 +40,26 @@ 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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#molokai#visual_modified = { - \ 'info_separator': [ '#232526' , '#fd971f' , 16 , 208 , '' ] , - \ 'statusline': [ '#080808' , '#fd971f' , 232 , 208 , '' ] , +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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) +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) - let g:airline#themes#molokai#ctrlp = airline#extensions#ctrlp#generate_color_map( - \ [ '#f8f8f0' , '#465457' , 253 , 67 , '' ] , - \ [ '#f8f8f0' , '#232526' , 253 , 16 , '' ] , - \ [ '#080808' , '#e6db74' , 232 , 144 , 'bold' ] ) +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' ] ) diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/monochrome.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/monochrome.vim new file mode 100644 index 0000000..7dd1a17 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/monochrome.vim @@ -0,0 +1,15 @@ +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() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/murmur.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/murmur.vim new file mode 100644 index 0000000..adebf3b --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/murmur.vim @@ -0,0 +1,46 @@ +let g:airline#themes#murmur#palette = {} + +let s:termbg = 237 " Background for branch and file format blocks +let s:termbg2= 234 " Background for middle block +let s:normalbg= 27 " Background for normal mode and file position blocks +let s:insertbg= 70 " Background for insert mode and file position blocks +let s:visualbg= 166 " Background for visual mode and file position blocks +let s:replacebg=88 " Background for replace mode and file position blocks +let s:alert= 88 " Modefied file alert color + +let s:BB = ['#AFAF87', '#5F5F5F', 144, s:termbg] " Branch and file format blocks + +let s:N1 = ['#FFFFFF', '#5F87FF', 15, s:normalbg] " Outside blocks in normal mode +let s:N2 = ['#AFAF87', '#5F5F5F', 39, s: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': ['#ffffff', '#5f005f', s:alert, s:termbg2, 'bold'] ,} + +let s:I1 = ['#FFFFFF', '#87AF5F', 15, s:insertbg] " Outside blocks in insert mode +let s:I2 = ['#AFAF87', '#5F5F5F', s:insertbg, s: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': ['#AFAF87', '#5F5F5F', s:alert, s:termbg2, 'bold'] ,} + +let s:R1 = ['#FFFFFF', '#870000', 15, s:replacebg] " Outside blocks in replace mode +let s:R2 = ['#AFAF87', '#5F5F5F', 255, s: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': ['#AFAF87', '#5f005f', s:alert, s:termbg2, 'bold'] ,} + +let s:V1 = ['#FFFFFF', '#AF5F00', 15, s:visualbg] " Outside blocks in visual mode +let s:V2 = ['#AFAF87', '#5F5F5F', s:visualbg, s: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': [ '#AFAF87', '#5f005f', s:alert, s:termbg2, 'bold'] ,} + +" Inactive mode +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#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( + \ ['#FFFFFF', '#5F87FF', 15, s:normalbg, ''], + \ ['#AFAF87', '#5F5F5F', 144, s:termbg, ''], + \ ['#AFAF87', '#5F5F5F', 39, s:termbg2, 'bold']) diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/powerlineish.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/powerlineish.vim index 93d7ffd..d550e11 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/powerlineish.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/powerlineish.vim @@ -26,23 +26,21 @@ let s:V1 = [ '#080808' , '#ffaf00' , 232 , 214 ] " gray3 & brightestora " Replace mode " fg & bg let s:RE = [ '#ffffff' , '#d70000' , 231 , 160 ] " white & brightred -let s:file = copy(s:N3) +let g:airline#themes#powerlineish#palette = {} -let g:airline#themes#powerlineish#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) +let g:airline#themes#powerlineish#palette.normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3) -let g:airline#themes#powerlineish#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#powerlineish#insert_replace = { - \ 'mode' : [ s:RE[0] , s:I1[1] , s:RE[1] , s:I1[3] , '' ] , - \ 'mode_separator' : [ s:I1[1] , s:I2[1] , s:I1[3] , s:I2[3] , '' ] } +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#visual = { - \ 'mode' : [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , '' ] , - \ 'mode_separator' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[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#replace = copy(airline#themes#powerlineish#normal) -let g:airline#themes#powerlineish#replace.mode = [ s:RE[0] , s:RE[1] , s:RE[2] , s:RE[3] , '' ] -let g:airline#themes#powerlineish#replace.mode_separator = [ s:RE[1] , s:N2[1] , s:RE[3] , s:N2[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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) +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) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/serene.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/serene.vim new file mode 100644 index 0000000..9191c07 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/serene.vim @@ -0,0 +1,41 @@ +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) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/simple.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/simple.vim index 460665a..a111a1c 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/simple.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/simple.vim @@ -1,102 +1,46 @@ -let s:swap = 0 -if exists('g:airline_powerline_fonts') && g:airline_powerline_fonts - let s:swap = 1 - - let s:left = 0 - function! airline#themes#simple#left() - if s:left == 1 - let s:left = 0 - return '' - else - let s:left = 1 - return '' - endif - endfunction - let g:airline_left_sep = '%{airline#themes#simple#left()}' - - let s:right = 0 - function! airline#themes#simple#right() - if s:right == 1 - let s:right = 0 - return '' - else - let s:right = 1 - return '' - endif - endfunction - let g:airline_right_sep = '%{airline#themes#simple#right()}' -endif - -if g:airline_left_sep == '' && g:airline_right_sep == '' - let s:swap = 1 -endif +let g:airline#themes#simple#palette = {} let s:guibg = '#080808' +let s:guibg2 = '#1c1c1c' let s:termbg = 232 -let s:termsep = 236 -let s:guisep = '#303030' - -let s:file = [ '#ff0000' , s:guibg , 160 , s:termbg , '' ] -let s:N1 = s:swap ? [ s:guibg , '#00dfff' , s:termbg , 45 ] : [ '#00dfff' , s:guibg , 45 , s:termbg ] -let s:N2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ] -let s:N3 = [ '#767676' , s:guibg, 243 , s:termbg ] -let g:airline#themes#simple#normal = { - \ 'mode': [ s:N1[0] , s:N1[1] , s:N1[2] , s:N1[3] , 'bold' ] , - \ 'mode_separator': s:swap - \ ? [ '#00dfff' , s:N2[1] , 45 , s:N2[3] , 'bold' ] - \ : [ s:guisep , s:N2[1] , s:termsep , s:N2[3] , 'bold' ] , - \ 'info': [ s:N2[0] , s:N2[1] , s:N2[2] , s:N2[3] , '' ] , - \ 'info_separator': [ s:guisep , s:N3[1] , s:termsep , s:N3[3] , 'bold' ] , - \ 'statusline': [ s:N3[0] , s:N3[1] , s:N3[2] , s:N3[3] , '' ] , - \ 'file': s:file, - \ } -let g:airline#themes#simple#normal_modified = { - \ 'statusline': [ '#df0000' , s:guibg, 160 , s:termbg , '' ] , +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:swap ? [ s:guibg, '#5fff00' , s:termbg , 82 ] : [ '#5fff00' , s:guibg, 82 , s:termbg ] -let s:I2 = [ '#ff5f00' , s:guibg, 202 , 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#insert = { - \ 'mode': [ s:I1[0] , s:I1[1] , s:I1[2] , s:I1[3] , 'bold' ] , - \ 'mode_separator': s:swap - \ ? [ '#5fff00' , s:I2[1] , 82 , s:I2[3] , 'bold' ] - \ : [ s:guisep , s:I2[1] , s:termsep , s:I2[3] , 'bold' ] , - \ 'info': [ s:I2[0] , s:I2[1] , s:I2[2] , s:I2[3] , '' ] , - \ 'info_separator': [ s:guisep , s:I3[1] , s:termsep , s:I3[3] , 'bold' ] , - \ 'statusline': [ s:I3[0] , s:I3[1] , s:I3[2] , s:I3[3] , '' ] , - \ } -let g:airline#themes#simple#insert_modified = copy(g:airline#themes#simple#normal_modified) -let g:airline#themes#simple#insert_paste = { - \ 'mode': [ s:I1[0] , '#d78700' , s:I1[2] , 172 , '' ] , - \ 'mode_separator': [ '#d78700' , s:I2[1] , 172 , s:I2[3] , '' ] , +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#replace = { - \ 'mode': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] , - \ 'mode_separator': [ '#af0000' , s:I2[1] , 124 , s:I2[3] , '' ] , +let g:airline#themes#simple#palette.replace = { + \ 'airline_a': [ s:I1[0] , '#af0000' , s:I1[2] , 124 , '' ] , \ } -let g:airline#themes#simple#replace_modified = copy(g:airline#themes#simple#normal_modified) +let g:airline#themes#simple#palette.replace_modified = copy(g:airline#themes#simple#palette.normal_modified) -let s:V1 = s:swap ? [ s:guibg, '#dfdf00' , s:termbg , 184 ] : [ '#dfdf00' , s:guibg, 184 , s:termbg ] -let s:V2 = [ '#ff5f00' , s:guibg, 202 , s:termbg ] +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#visual = { - \ 'mode': [ s:V1[0] , s:V1[1] , s:V1[2] , s:V1[3] , 'bold' ] , - \ 'mode_separator': s:swap - \ ? [ '#dfdf00' , s:V2[1] , 184 , s:V2[3] , 'bold' ] - \ : [ s:guisep , s:V2[1] , s:termsep , s:V2[3] , 'bold' ] , - \ 'info': [ s:V2[0] , s:V2[1] , s:V2[2] , s:V2[3] , '' ] , - \ 'info_separator': [ s:guisep , s:V3[1] , s:termsep , s:V3[3] , 'bold' ] , - \ 'statusline': [ s:V3[0] , s:V3[1] , s:V3[2] , s:V3[3] , '' ] , - \ } -let g:airline#themes#simple#visual_modified = copy(g:airline#themes#simple#normal_modified) +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 g:airline#themes#simple#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#simple#inactive_modified = copy(g:airline#themes#simple#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, '', '' ] , + \ } diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/sol.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/sol.vim new file mode 100644 index 0000000..31aa34f --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/sol.vim @@ -0,0 +1,90 @@ +" 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' , '#ff3535' , 231 , 203 , '' ] , + \ } + + +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': [ '#ffffff' , '#ff6868' , 225 , 167 , '' ] , + \ } +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': [ '#ffffff' , '#ff3535' , 231 , 203 , '' ] , + \ } + +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': ['#ffffff', '#ff6868', 231, 167, ''], + \ } + +let s:WI = [ '#eeeeee', '#ff0f38', 255, 201 ] +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 , '' ] ) diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/solarized.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/solarized.vim index 720b02a..db52bcf 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/solarized.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/solarized.vim @@ -1,32 +1,33 @@ -function! s:generate() +let g:airline#themes#solarized#palette = {} + +function! airline#themes#solarized#refresh() """""""""""""""""""""""""""""""""""""""""""""""" " Options """""""""""""""""""""""""""""""""""""""""""""""" - let s:reduced = get(g:, 'airline_solarized_reduced', 1) - let s:background = get(g:, 'airline_solarized_bg', &background) + 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': 234, 'g': '#002b36'} - let s:base02 = {'t': 235, 'g': '#073642'} - let s:base01 = {'t': 240, 'g': '#586e75'} - let s:base00 = {'t': 241, 'g': '#657b83'} - let s:base0 = {'t': 244, 'g': '#839496'} - let s:base1 = {'t': 245, 'g': '#93a1a1'} - let s:base2 = {'t': 254, 'g': '#eee8d5'} - let s:base3 = {'t': 230, 'g': '#fdf6e3'} - let s:yellow = {'t': 136, 'g': '#b58900'} - let s:orange = {'t': 166, 'g': '#cb4b16'} - let s:red = {'t': 160, 'g': '#dc322f'} - let s:magenta = {'t': 125, 'g': '#d33682'} - let s:violet = {'t': 61, 'g': '#6c71c4'} - let s:blue = {'t': 33, 'g': '#268bd2'} - let s:cyan = {'t': 37, 'g': '#2aa198'} - let s:green = {'t': 64, 'g': '#859900'} - let s:c218 = {'t': 218, 'g': '#ffafd7'} - let s:c52 = {'t': 52, 'g': '#5f0000'} + 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 @@ -34,75 +35,43 @@ function! s:generate() " the specific gui and terminal colors from the base color dicts. """""""""""""""""""""""""""""""""""""""""""""""" " Normal mode - let s:N1 = [s:base2, s:blue, 'bold'] if s:background == 'dark' - let s:N2 = [s:base2, s:base01, ''] - let s:N3 = [s:base1, s:base02, ''] + 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:N2 = [s:base2, s:base1, ''] - let s:N3 = [s:base00, s:base2, ''] + 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], ''] - if s:reduced - if s:background == 'dark' - let s:NM = { - \ 'info_separator': [s:N2[1], s:N3[1], ''], - \ 'statusline': [s:magenta, s:N3[1], ''], - \ } - else - let s:NM = { - \ 'info_separator': [s:N2[1], s:N3[1], ''], - \ 'statusline': [s:magenta, s:N3[1], ''], - \ } - endif + let s:NW = [s:base3, s:orange, ''] + if s:background == 'dark' + let s:NM = [s:base1, s:N3[1], ''] else - if s:background == 'dark' - let s:NM = { - \ 'info_separator': [s:N2[1], s:c52, ''], - \ 'statusline': [s:c218, s:c52, ''] - \ } - else - let s:NM = { - \ 'info_separator': [s:N2[1], s:c218, ''], - \ 'statusline': [s:red, s:c218, ''] - \ } - endif + let s:NM = [s:base01, s:N3[1], ''] endif - " Insert mode - let s:I1 = [s:N1[0], s:green, 'bold'] - if s:reduced - let s:I2 = s:N2 - else - let s:I2 = [s:base3, s:base1, ''] - endif + let s:I1 = [s:N1[0], s:yellow, 'bold'] + let s:I2 = s:N2 let s:I3 = s:N3 let s:IF = s:NF - if s:reduced - let s:IM = s:NM - else - let s:IM = { - \ 'info_separator': [s:I2[1], s:NM.statusline[1], ''], - \ 'statusline': s:NM.statusline - \ } - endif + let s:IM = s:NM " Visual mode - let s:V1 = [s:N1[0], s:orange, 'bold'] - if s:reduced - let s:V2 = s:N2 - let s:V3 = s:N3 - else - let s:V2 = s:I2 - let s:V3 = s:I3 - endif + let s:V1 = [s:N1[0], s:magenta, 'bold'] + let s:V2 = s:N2 + let s:V3 = s:N3 let s:VF = s:NF - if s:reduced - let s:VM = s:NM - else - let s:VM = s:IM - endif + 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 if s:background == 'dark' @@ -118,55 +87,87 @@ function! s:generate() 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#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]], + 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:NFa) - - let g:airline#themes#solarized#inactive_modified = { - \ 'statusline': [s:NM.statusline[0].g, '', s:NM.statusline[0].t, '', ''] } + \ [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:NM[0].g, '', s:NM[0].t, '', s:NM[2]]} - let g:airline#themes#solarized#normal = airline#themes#generate_color_map( + 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]], - \ s:NFa) + \ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]]) - let g:airline#themes#solarized#normal_modified = { - \ 'info_separator': [s:NM.info_separator[0].g, s:NM.info_separator[1].g, - \ s:NM.info_separator[0].t, s:NM.info_separator[1].t, s:NM.info_separator[2]], - \ 'statusline': [s:NM.statusline[0].g, s:NM.statusline[1].g, - \ s:NM.statusline[0].t, s:NM.statusline[1].t, s:NM.statusline[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#insert = airline#themes#generate_color_map( + 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]], - \ s:IFa) + \ [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#insert_modified = { - \ 'info_separator': [s:IM.info_separator[0].g, s:IM.info_separator[1].g, - \ s:IM.info_separator[0].t, s:IM.info_separator[1].t, s:IM.info_separator[2]], - \ 'statusline': [s:IM.statusline[0].g, s:IM.statusline[1].g, - \ s:IM.statusline[0].t, s:IM.statusline[1].t, s:IM.statusline[2]]} + let g:airline#themes#solarized#palette.insert_modified.airline_warning = + \ g:airline#themes#solarized#palette.normal.airline_warning - let g:airline#themes#solarized#visual = airline#themes#generate_color_map( + 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]], - \ s:VFa) - - let g:airline#themes#solarized#visual_modified = { - \ 'info_separator': [s:VM.info_separator[0].g, s:VM.info_separator[1].g, - \ s:VM.info_separator[0].t, s:VM.info_separator[1].t, s:VM.info_separator[2]], - \ 'statusline': [s:VM.statusline[0].g, s:VM.statusline[1].g, - \ s:VM.statusline[0].t, s:VM.statusline[1].t, s:VM.statusline[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 s:generate() -augroup airline_solarized - autocmd! - autocmd ColorScheme * call generate() | call airline#reload_highlight() -augroup END +call airline#themes#solarized#refresh() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/tomorrow.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/tomorrow.vim index b188681..f382fc1 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/tomorrow.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/tomorrow.vim @@ -1,40 +1,44 @@ -function! s:generate() - let s:file = airline#themes#get_highlight('Constant') +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) + 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#normal_modified = { - \ 'statusline': [ group[0], '', group[2], '', '' ] + 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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) - let g:airline#themes#tomorrow#insert_modified = g:airline#themes#tomorrow#normal_modified + 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#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file) - let g:airline#themes#tomorrow#replace_modified = g:airline#themes#tomorrow#normal_modified + 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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) - let g:airline#themes#tomorrow#visual_modified = g:airline#themes#tomorrow#normal_modified + 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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) + 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 s:generate() -augroup airline_tomorrow - autocmd! - autocmd ColorScheme * call generate() | call airline#reload_highlight() -augroup END +call airline#themes#tomorrow#refresh() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/ubaryd.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/ubaryd.vim index b2e1401..70232ef 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/ubaryd.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/ubaryd.vim @@ -24,41 +24,41 @@ let s:RE = [ '#c7915b' , 173 ] " nut " Paste mode let s:PA = [ '#f9ef6d' , 154 ] " bleaklemon -let s:file = [ '#ff7400' , s:N3[1] , 196 , s:N3[3] , '' ] -let s:IA = [ s:N2[1] , s:N3[1] , s:N2[3], s:N3[3] , '' ] +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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#ubaryd#normal_modified = { - \ 'mode_separator' : [ s:N1[1] , s:N4[0] , s:N1[3] , s:N4[1] , 'bold' ] , - \ 'info' : [ s:N2[0] , s:N4[0] , s:N2[2] , s:N4[1] , '' ] , - \ 'info_separator' : [ s:N4[0] , s:N2[1] , s:N4[1] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V1[1] , s:N2[1] , s:V1[3] , s:N2[3] , '' ] } -let g:airline#themes#ubaryd#inactive = { - \ 'mode' : [ s:N2[1] , s:N3[1] , s:N2[3] , s:N3[3] , '' ] } +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#ubaryd#insert_modified = { - \ 'info_separator' : [ s:I2[1] , s:N2[1] , s:I2[3] , s:N2[3] , 'bold' ] , - \ 'statusline' : [ s:V2[1] , s:N2[1] , s:V2[3] , s:N2[3] , '' ] } -let g:airline#themes#ubaryd#insert_paste = { - \ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] , - \ 'mode_separator' : [ s:PA[0] , s:I2[1] , s:PA[1] , s:I2[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#replace = copy(airline#themes#ubaryd#insert) -let g:airline#themes#ubaryd#replace.mode = [ s:I1[0] , s:RE[0] , s:I1[2] , s:RE[1] , '' ] -let g:airline#themes#ubaryd#replace.mode_separator = [ s:RE[0] , s:I2[1] , s:RE[1] , s:I2[3] , '' ] -let g:airline#themes#ubaryd#replace_modified = g:airline#themes#ubaryd#insert_modified +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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#ubaryd#visual_modified = { - \ 'info_separator' : [ s:V2[1] , s:V4[0] , s:V2[3] , s:V4[1] , 'bold' ] , - \ 'statusline' : [ s:V3[0] , s:V4[0] , s:V3[2] , s:V4[1] , '' ] } -let g:airline#themes#ubaryd#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#ubaryd#inactive_modified = { - \ 'statusline' : [ s:V1[1] , '', s:V1[3], '', ''] - \ } +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] , '' , '' ] } + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/understated.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/understated.vim new file mode 100644 index 0000000..b3e7917 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/understated.vim @@ -0,0 +1,43 @@ +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']) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/wombat.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/wombat.vim index 1e0d67a..39fdc4c 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/wombat.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/wombat.vim @@ -32,65 +32,59 @@ let s:PA = [ '#94E42C' , 47 ] " Info modified let s:IM = [ '#40403C' , 238 ] -" File permissions (RO, etc) -let s:file = [ '#E5786D' , s:N3[1] , 203 , s:N3[3] , '' ] - " 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#normal = airline#themes#generate_color_map(s:N1, s:N2, s:N3, s:file) -let g:airline#themes#wombat#normal_modified = { - \ 'mode' : [ s:N1[0] , s:N4[0] , s:N1[2] , s:N4[1] , '' ] , - \ 'mode_separator' : [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , 'bold' ] , - \ 'info' : [ s:N4[0] , s:IM[0] , s:N4[1] , s:IM[1] , '' ] , - \ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] , - \ 'statusline' : [ s:N4[0] , s:N3[1] , s:N4[1] , s:N3[3] , '' ] } +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#insert = airline#themes#generate_color_map(s:I1, s:I2, s:I3, s:file) -let g:airline#themes#wombat#insert_modified = { - \ 'mode' : [ s:I1[0] , s:I4[0] , s:I1[2] , s:I4[1] , '' ] , - \ 'mode_separator' : [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , 'bold' ] , - \ 'info' : [ s:I4[0] , s:IM[0] , s:I4[1] , s:IM[1] , '' ] , - \ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] , - \ 'statusline' : [ s:I4[0] , s:N3[1] , s:I4[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#visual = airline#themes#generate_color_map(s:V1, s:V2, s:V3, s:file) -let g:airline#themes#wombat#visual_modified = { - \ 'mode' : [ s:V1[0] , s:V4[0] , s:V1[2] , s:V4[1] , '' ] , - \ 'mode_separator' : [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , 'bold' ] , - \ 'info' : [ s:V4[0] , s:IM[0] , s:V4[1] , s:IM[1] , '' ] , - \ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] , - \ 'statusline' : [ s:V4[0] , s:N3[1] , s:V4[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#replace = airline#themes#generate_color_map(s:R1, s:R2, s:R3, s:file) -let g:airline#themes#wombat#replace_modified = { - \ 'mode' : [ s:R1[0] , s:R4[0] , s:R1[2] , s:R4[1] , '' ] , - \ 'mode_separator' : [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , 'bold' ] , - \ 'info' : [ s:R4[0] , s:IM[0] , s:R4[1] , s:IM[1] , '' ] , - \ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] , - \ 'statusline' : [ s:R4[0] , s:N3[1] , s:R4[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#insert_paste = { - \ 'mode' : [ s:I1[0] , s:PA[0] , s:I1[2] , s:PA[1] , '' ] , - \ 'mode_separator' : [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , 'bold' ] , - \ 'info' : [ s:PA[0] , s:IM[0] , s:PA[1] , s:IM[1] , '' ] , - \ 'info_separator' : [ s:IM[0] , s:N3[1] , s:IM[1] , s:N3[3] , 'bold' ] , - \ 'statusline' : [ s:PA[0] , s:N3[1] , s:PA[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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file) -let g:airline#themes#wombat#inactive_modified = { - \ 'statusline' : [ '#BCBCBC' , '' , 250 , '' , '' ] } +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) - let g:airline#themes#wombat#ctrlp = airline#extensions#ctrlp#generate_color_map( - \ [ '#DADADA' , '#242424' , 253 , 234 , '' ] , - \ [ '#DADADA' , '#40403C' , 253 , 238 , '' ] , - \ [ '#141413' , '#DADADA' , 232 , 253 , 'bold' ] ) +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' ] ) + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/zenburn.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/zenburn.vim new file mode 100644 index 0000000..9883c21 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/themes/zenburn.vim @@ -0,0 +1,44 @@ +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() + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/util.vim b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/util.vim new file mode 100644 index 0000000..b97c086 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/autoload/airline/util.vim @@ -0,0 +1,64 @@ +" MIT License. Copyright (c) 2013 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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/doc/airline.txt b/etc/soft/vim/vim/+plugins/vim-airline/doc/airline.txt index 4412094..9a2d465 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/doc/airline.txt +++ b/etc/soft/vim/vim/+plugins/vim-airline/doc/airline.txt @@ -1,7 +1,32 @@ -*airline.txt* Lean and mean statusline that's light as air +*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* +INTRODUCTION *airline-intro* vim-airline is a fast and lightweight alternative to powerline, written in 100% vimscript with no outside dependencies. @@ -14,10 +39,9 @@ FEATURES *airline-features* * 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 +* fully customizable; if you know a little 'statusline' syntax you can tweak it to your needs. -* trivial to write colorschemes; for a minimal theme you need to edit - 9 lines of colors. (please send pull requests) +* extremely easy to write themes. ============================================================================== NAME *airline-name* @@ -33,87 +57,75 @@ CONFIGURATION *airline-configuration* There are a couple configuration values available (shown with their default values): -* the separator used on the left side -> +* the separator used on the left side > let g:airline_left_sep='>' < - -* the separator used on the right side -> +* the separator used on the right side > let g:airline_right_sep='<' < - -* enable/disable fugitive/lawrencium integration -> - let g:airline_enable_branch=1 -< - -* enable/disable syntastic integration -> - let g:airline_enable_syntastic=1 -< - -* enable/disable tagbar integration -> - let g:airline_enable_tagbar=1 -< - -* enable modified detection -> +* enable modified detection > let g:airline_detect_modified=1 -< -* enable paste detection -> +* enable paste detection > let g:airline_detect_paste=1 < - -* enable iminsert detection -> - let g:airline_detect_iminsert=1 +* enable iminsert detection > + let g:airline_detect_iminsert=0 < - -* enable whitespace detection -> - let g:airline_detect_whitespace=0 "disabled - let g:airline_detect_whitespace=1 "icon and message (default) - let g:airline_detect_whitespace=2 "icon only +* determine whether inactive windows should have the left section collapsed to + only the filename of that buffer. > + let g:airline_inactive_collapse=1 < - -* change the default theme -> - let g:airline_theme='dark' +* themes are automatically selected based on the matching colorscheme. this + can be overridden by defining a value. > + let g:airline_theme= < - -* enable/disable usage of patched powerline font symbols -> +* 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 current list +* 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 -> + 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 -> + 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) -> + heavily) > let g:airline_exclude_preview = 0 < - ============================================================================== COMMANDS *airline-commands* @@ -123,56 +135,73 @@ COMMANDS *airline-commands* :AirlineToggleWhitespace *:AirlineToggleWhitespace* Toggles whitespace detection. +:AirlineToggle *:AirlineToggle* + Toggles between the standard 'statusline' and airline. + +:AirlineRefresh *:AirlineRefresh* + Refreshes all highlight groups. + ============================================================================== 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_linecolumn_prefix = '␊ ' - let g:airline_linecolumn_prefix = '␤ ' - let g:airline_linecolumn_prefix = '¶ ' - let g:airline_branch_prefix = '⎇ ' - let g:airline_paste_symbol = 'ρ' - let g:airline_paste_symbol = 'Þ' - let g:airline_paste_symbol = '∥' - let g:airline_whitespace_symbol = 'Ξ' + 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_branch_prefix = ' ' - let g:airline_readonly_symbol = '' - let g:airline_linecolumn_prefix = ' ' + 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_branch_prefix = '⭠' - let g:airline_readonly_symbol = '⭤' - let g:airline_linecolumn_prefix = '⭡' + 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. > - " here are the the default values - let g:airline_section_a (the mode/paste indicator) - let g:airline_section_b (the fugitive/lawrencium branch indicator) + 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 - let g:airline_section_x (tagbar, filetype) + 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) @@ -182,19 +211,294 @@ with the usual statusline syntax. 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. + +------------------------------------- *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 = {} +< +------------------------------------- *airline-bufferline* +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 +lawrencium + +* 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 = '' +< +------------------------------------- *airline-syntastic* +syntastic + +* enable/disable syntastic integration > + let g:airline#extensions#syntastic#enabled = 1 +< +------------------------------------- *airline-tagbar* +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 + +* 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 +vim-signify + +* 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 + +* 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 + +* enable/disable virtualenv integration > + let g:airline#extensions#virtualenv#enabled = 1 +< +------------------------------------- *airline-eclim* +eclim + +* 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 whitespace symbol. > + let g:airline#extensions#whitespace#symbol = '!' +< +* configure which whitespace checks to enable. > + let g:airline#extensions#whitespace#checks = [ 'indent', 'trailing' ] +< +* 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 +< +* 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#formatters#foo(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 +< +* 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 = '' +< +Note: Enabling this extension will modify 'showtabline' and 'guioptions'. + +============================================================================== +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. - - *g:airline_statusline_funcrefs* -The g:airline_statusline_funcrefs variable is an array of funcrefs that get -invoked before the statusline gets overwritten for each window. The following -is an example of how you can extend vim-airline to support a new plugin. -> - function! MyPlugin() +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' @@ -202,18 +506,87 @@ is an example of how you can extend vim-airline to support a new plugin. let g:airline_variable_referenced_in_statusline = 'foo' endif endfunction - call add(g:airline_statusline_funcrefs, function('MyPlugin')) + 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') < - *g:airline_exclude_funcrefs* -The g:airline_exclude_funcrefs variable is an array that's returns 1 or 0 to -determine whether that particular window should be excluded from having its -statusline modified. Here is an example: + +============================================================================== +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! ExcludeFoo() - return &filetype == 'FooType' + 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 - call add(g:airline_exclude_funcrefs, function('ExcludeFoo')) < +The above example uses various some 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* @@ -231,37 +604,32 @@ highlight groups. TROUBLESHOOTING *airline-troubleshooting* Q. There are no colors. - A. You need to set up your terminal correctly. For more details, see -. Alternatively, if you want to -bypass the automatic detection of terminal colors, you can force Vim into 256 -colors with this: -> + . 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: -> +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. -> + unicode in vim. > set encoding=utf-8 < - Q. There is a pause when leaving insert mode. - -A. Add the following to your vimrc. -> +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: @@ -274,7 +642,7 @@ Contributions and pull requests are welcome. ============================================================================== LICENSE *airline-license* -MIT license. Copyright © 2013 Bailey Ling. +MIT License. Copyright © 2013 Bailey Ling. vim:tw=78:ts=8:ft=help:norl: diff --git a/etc/soft/vim/vim/+plugins/vim-airline/plugin/airline.vim b/etc/soft/vim/vim/+plugins/vim-airline/plugin/airline.vim index d001057..1292c96 100644 --- a/etc/soft/vim/vim/+plugins/vim-airline/plugin/airline.vim +++ b/etc/soft/vim/vim/+plugins/vim-airline/plugin/airline.vim @@ -1,93 +1,104 @@ -" MIT license. Copyright (c) 2013 Bailey Ling. -" vim: ts=2 sts=2 sw=2 fdm=indent +" MIT License. Copyright (c) 2013 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 -function! s:check_defined(variable, default) - if !exists(a:variable) - let {a:variable} = a:default - endif -endfunction -if exists('g:airline_enable_fugitive') || exists('g:airline_fugitive_prefix') - echom 'The g:airline_enable_fugitive and g:airline_fugitive_prefix variables have been deprecated and renamed to g:airline_enable_branch and g:airline_branch_prefix respectively. Please update your vimrc.' -endif -if exists('g:airline_window_override_funcrefs') - echom 'The g:airline_window_override_funcrefs variable has been deprecated. Please use g:airline_statusline_funcrefs instead.' -endif -call s:check_defined('g:airline_left_sep', exists('g:airline_powerline_fonts')?"":">") -call s:check_defined('g:airline_left_alt_sep', exists('g:airline_powerline_fonts')?"":">") -call s:check_defined('g:airline_right_sep', exists('g:airline_powerline_fonts')?"":"<") -call s:check_defined('g:airline_right_alt_sep', exists('g:airline_powerline_fonts')?"":"<") -call s:check_defined('g:airline_enable_bufferline', 1) -call s:check_defined('g:airline_enable_branch', 1) -call s:check_defined('g:airline_enable_syntastic', 1) -call s:check_defined('g:airline_enable_tagbar', 1) -call s:check_defined('g:airline_detect_iminsert', 0) -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_whitespace', 1) -call s:check_defined('g:airline_whitespace_symbol', '✹') -call s:check_defined('g:airline_branch_prefix', exists('g:airline_powerline_fonts')?' ':'') -call s:check_defined('g:airline_readonly_symbol', exists('g:airline_powerline_fonts')?'':'RO') -call s:check_defined('g:airline_linecolumn_prefix', exists('g:airline_powerline_fonts')?' ':':') -call s:check_defined('g:airline_paste_symbol', (exists('g:airline_powerline_fonts') ? ' ' : '').'PASTE') -call s:check_defined('g:airline_theme', 'dark') -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_statusline_funcrefs', []) -call s:check_defined('g:airline_exclude_funcrefs', []) - -call s:check_defined('g:airline_mode_map', { - \ 'n' : 'NORMAL', - \ 'i' : 'INSERT', - \ 'R' : 'REPLACE', - \ 'v' : 'VISUAL', - \ 'V' : 'V-LINE', - \ 'c' : 'CMD ', - \ '' : 'V-BLOCK', - \ 's' : 'SELECT', - \ 'S' : 'S-LINE', - \ '' : 'S-BLOCK', - \ }) - -call s:check_defined('g:airline_section_a', '%{get(g:, "airline_current_mode_text", "")}') -call s:check_defined('g:airline_section_b', '%{get(g:, "airline_current_branch", "")}') -call s:check_defined('g:airline_section_c', '%f%m') -call s:check_defined('g:airline_section_gutter', '') -call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}") -call s:check_defined('g:airline_section_y', "%{strlen(&fenc)>0?&fenc:''}%{strlen(&ff)>0?'['.&ff.']':''}") -call s:check_defined('g:airline_section_z', '%3p%% '.g:airline_linecolumn_prefix.'%3l:%3c') + +" autocmd VimEnter * call airline#deprecation#check() let s:airline_initialized = 0 -function! s:on_window_changed() +let s:airline_theme_defined = 0 +function! s:init() if !s:airline_initialized - call airline#extensions#load() - call airline#load_theme(g:airline_theme) 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 init() call airline#update_statusline() endfunction +function! s:on_colorscheme_changed() + call 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 + else + let s:stl = &stl + augroup airline + autocmd! + + autocmd CmdwinEnter * + \ call airline#add_statusline_func('airline#cmdwinenter') + \ | call on_window_changed() + autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter') + + autocmd ColorScheme * call on_colorscheme_changed() + autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized * + \ call 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 + if s:airline_initialized + call 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#load_theme(a:1) + call airline#switch_theme(a:1) else echo g:airline_theme endif endfunction command! -nargs=? -complete=customlist,get_airline_themes AirlineTheme call airline_theme() command! AirlineToggleWhitespace call airline#extensions#whitespace#toggle() +command! AirlineToggle call airline_toggle() +command! AirlineRefresh call airline#load_theme() + +call airline_toggle() -augroup airline - autocmd! - autocmd ColorScheme * call airline#reload_highlight() - autocmd WinEnter,BufWinEnter,FileType,BufUnload,ShellCmdPost * - \ call on_window_changed() -augroup END diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/airline.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/airline.vim new file mode 100644 index 0000000..78ab6d7 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/airline.vim @@ -0,0 +1,87 @@ +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 + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/builder.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/builder.vim new file mode 100644 index 0000000..3d1afcd --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/builder.vim @@ -0,0 +1,80 @@ +let g:airline_theme = 'dark' +call airline#init#bootstrap() + +describe 'active builder' + before + let s:builder = airline#builder#new({'active': 1}) + end + + it 'should start with an empty statusline' + let stl = s:builder.build() + Expect stl == '' + end + + it 'should transition colors from one to the next' + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('NonText', 'world') + let stl = s:builder.build() + Expect stl =~ '%#Normal#hello%#Normal_to_NonText#>%#NonText#world' + end + + it 'should split left/right sections' + call s:builder.split() + let stl = s:builder.build() + Expect stl =~ '%=' + end + + it 'after split, sections use the right separator' + call s:builder.split() + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('NonText', 'world') + let stl = s:builder.build() + Expect stl =~ '%#Normal#hello%#Normal_to_NonText#<%#NonText#world' + end + + it 'should not repeat the same highlight group' + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('Normal', 'hello') + let stl = s:builder.build() + Expect stl == '%#Normal#hello>hello' + end + + it 'should replace accent groups with the specified group' + call s:builder.add_section('Normal', '%#__accent_foo#hello') + let stl = s:builder.build() + Expect stl == '%#Normal#%#Normal_foo#hello' + end + + it 'should replace two accent groups with correct groups' + call s:builder.add_section('Normal', '%#__accent_foo#hello%#__accent_bar#world') + let stl = s:builder.build() + Expect stl =~ '%#Normal_foo#hello%#Normal_bar#world' + end + + it 'should special restore group should go back to previous group' + call s:builder.add_section('Normal', '%#__restore__#') + let stl = s:builder.build() + Expect stl !~ '%#__restore__#' + Expect stl =~ '%#Normal#' + end +end + +describe 'inactive builder' + before + let s:builder = airline#builder#new({'active': 0}) + end + + it 'should transition colors from one to the next' + call s:builder.add_section('Normal', 'hello') + call s:builder.add_section('NonText', 'world') + let stl = s:builder.build() + Expect stl =~ '%#Normal_inactive#hello%#Normal_to_NonText_inactive#>%#NonText_inactive#world' + end + + it 'should not render accents' + call s:builder.add_section('Normal', '%#__accent_foo#hello%#foo#foo%#__accent_bar#world') + let stl = s:builder.build() + Expect stl == '%#Normal_inactive#hello%#foo_inactive#fooworld' + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/commands.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/commands.vim new file mode 100644 index 0000000..b56b881 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/commands.vim @@ -0,0 +1,33 @@ +call airline#init#bootstrap() +call airline#init#sections() + +source plugin/airline.vim + +describe 'commands' + it 'should toggle off and on' + execute 'AirlineToggle' + Expect exists('#airline') to_be_false + execute 'AirlineToggle' + Expect exists('#airline') to_be_true + end + + it 'should toggle whitespace off and on' + call airline#extensions#load() + execute 'AirlineToggleWhitespace' + Expect exists('#airline_whitespace') to_be_false + execute 'AirlineToggleWhitespace' + Expect exists('#airline_whitespace') to_be_true + end + + it 'should display theme name with no args' + execute 'AirlineTheme simple' + Expect g:airline_theme == 'simple' + execute 'AirlineTheme dark' + Expect g:airline_theme == 'dark' + end + + it 'should have a refresh command' + Expect exists(':AirlineRefresh') to_be_true + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/extensions_default.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/extensions_default.vim new file mode 100644 index 0000000..b98e816 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/extensions_default.vim @@ -0,0 +1,32 @@ +let g:airline_theme = 'dark' +call airline#init#bootstrap() +call airline#init#sections() +source plugin/airline.vim + +describe 'default' + before + let s:builder = airline#builder#new({'active': 1}) + end + + it 'should use the layout' + let g:airline#extensions#default#layout = [ + \ [ 'c', 'a', 'b', 'warning' ], + \ [ 'x', 'z', 'y' ] + \ ] + call airline#extensions#default#apply(s:builder, { 'winnr': 1, 'active': 1 }) + let stl = s:builder.build() + Expect stl =~ 'airline_c_to_airline_a' + Expect stl =~ 'airline_a_to_airline_b' + Expect stl =~ 'airline_b_to_airline_warning' + Expect stl =~ 'airline_x_to_airline_z' + Expect stl =~ 'airline_z_to_airline_y' + end + + it 'should only render warning section in active splits' + wincmd s + Expect airline#statusline(1) =~ 'warning' + Expect airline#statusline(2) !~ 'warning' + wincmd c + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/highlighter.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/highlighter.vim new file mode 100644 index 0000000..0a10c19 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/highlighter.vim @@ -0,0 +1,20 @@ +let g:airline_theme = 'dark' + +describe 'highlighter' + it 'should create separator highlight groups' + hi Foo1 ctermfg=1 ctermbg=2 + hi Foo2 ctermfg=3 ctermbg=4 + call airline#highlighter#add_separator('Foo1', 'Foo2', 0) + let hl = airline#highlighter#get_highlight('Foo1_to_Foo2') + Expect hl == [ '', '', '4', '2', '' ] + end + + it 'should populate accent colors' + Expect exists('g:airline#themes#dark#palette.normal.airline_c_red') to_be_false + Expect hlID('airline_c_red') == 0 + call airline#themes#patch(g:airline#themes#dark#palette) + call airline#highlighter#highlight(['normal']) + Expect hlID('airline_c_red') != 0 + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/init.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/init.vim new file mode 100644 index 0000000..86efe58 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/init.vim @@ -0,0 +1,77 @@ +let s:sections = ['a', 'b', 'c', 'gutter', 'x', 'y', 'z', 'warning'] + +function! s:clear() + for key in s:sections + unlet! g:airline_section_{key} + endfor +endfunction + +call airline#init#bootstrap() + +describe 'init sections' + before + call s:clear() + call airline#init#sections() + end + + after + call s:clear() + end + + it 'section a should have mode, paste, iminsert' + Expect g:airline_section_a =~ 'mode' + Expect g:airline_section_a =~ 'paste' + Expect g:airline_section_a =~ 'iminsert' + end + + it 'section b should be blank because no extensions are installed' + Expect g:airline_section_b == '' + end + + it 'section c should be file' + Expect g:airline_section_c == '%<%f%m %#__accent_red#%{airline#util#wrap(airline#parts#readonly(),0)}%#__restore__#' + end + + it 'section x should be filetype' + Expect g:airline_section_x == '%{airline#util#wrap(airline#parts#filetype(),0)}' + end + + it 'section y should be fenc and ff' + Expect g:airline_section_y =~ 'ff' + Expect g:airline_section_y =~ 'fenc' + end + + it 'section z should be line numbers' + Expect g:airline_section_z =~ '%3p%%' + Expect g:airline_section_z =~ '%4l' + Expect g:airline_section_z =~ '%3c' + end + + it 'should not redefine sections already defined' + for s in s:sections + let g:airline_section_{s} = s + endfor + call airline#init#bootstrap() + for s in s:sections + Expect g:airline_section_{s} == s + endfor + end + + it 'all default statusline extensions should be blank' + Expect airline#parts#get('hunks').raw == '' + Expect airline#parts#get('branch').raw == '' + Expect airline#parts#get('tagbar').raw == '' + Expect airline#parts#get('syntastic').raw == '' + Expect airline#parts#get('eclim').raw == '' + Expect airline#parts#get('whitespace').raw == '' + end +end + +describe 'init parts' + it 'should not redefine parts already defined' + call airline#parts#define_raw('linenr', 'bar') + call airline#init#sections() + Expect g:airline_section_z =~ 'bar' + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/parts.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/parts.vim new file mode 100644 index 0000000..ee7c92e --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/parts.vim @@ -0,0 +1,39 @@ +describe 'parts' + it 'overwrites existing values' + call airline#parts#define('foo', { 'test': '123' }) + Expect airline#parts#get('foo').test == '123' + call airline#parts#define('foo', { 'test': '321' }) + Expect airline#parts#get('foo').test == '321' + end + + it 'can define a function part' + call airline#parts#define_function('func', 'bar') + Expect airline#parts#get('func').function == 'bar' + end + + it 'can define a text part' + call airline#parts#define_text('text', 'bar') + Expect airline#parts#get('text').text == 'bar' + end + + it 'can define a raw part' + call airline#parts#define_raw('raw', 'bar') + Expect airline#parts#get('raw').raw == 'bar' + end + + it 'can define a minwidth' + call airline#parts#define_minwidth('mw', 123) + Expect airline#parts#get('mw').minwidth == 123 + end + + it 'can define a condition' + call airline#parts#define_condition('part', '1') + Expect airline#parts#get('part').condition == '1' + end + + it 'can define a accent' + call airline#parts#define_accent('part', 'red') + Expect airline#parts#get('part').accent == 'red' + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/section.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/section.vim new file mode 100644 index 0000000..034440c --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/section.vim @@ -0,0 +1,76 @@ +function! SectionSpec() +endfunction + +describe 'section' + before + call airline#parts#define_text('text', 'text') + call airline#parts#define_raw('raw', 'raw') + call airline#parts#define_function('func', 'SectionSpec') + end + + it 'should be able to reference default parts' + let s = airline#section#create(['paste']) + Expect s == '%{airline#util#wrap(airline#parts#paste(),0)}' + end + + it 'should create sections with no separators' + let s = airline#section#create(['text', 'raw', 'func']) + Expect s == '%{airline#util#wrap("text",0)}raw%{airline#util#wrap(SectionSpec(),0)}' + end + + it 'should create left sections with separators' + let s = airline#section#create_left(['text', 'text']) + Expect s == '%{airline#util#wrap("text",0)}%{airline#util#append("text",0)}' + end + + it 'should create right sections with separators' + let s = airline#section#create_right(['text', 'text']) + Expect s == '%{airline#util#prepend("text",0)}%{airline#util#wrap("text",0)}' + end + + it 'should prefix with accent group if provided and restore afterwards' + call airline#parts#define('hi', { + \ 'raw': 'hello', + \ 'accent': 'red', + \ }) + let s = airline#section#create(['hi']) + Expect s == '%#__accent_red#hello%#__restore__#' + end + + it 'should accent functions' + call airline#parts#define_function('hi', 'Hello') + call airline#parts#define_accent('hi', 'bold') + let s = airline#section#create(['hi']) + Expect s == '%#__accent_bold#%{airline#util#wrap(Hello(),0)}%#__restore__#' + end + + it 'should parse out a section from the distro' + call airline#extensions#load() + let s = airline#section#create(['whitespace']) + Expect s =~ 'airline#extensions#whitespace#check' + end + + it 'should use parts as is if they are not found' + let s = airline#section#create(['asdf', 'func']) + Expect s == 'asdf%{airline#util#wrap(SectionSpec(),0)}' + end + + it 'should force add separators for raw and missing keys' + let s = airline#section#create_left(['asdf', 'raw']) + Expect s == 'asdf > raw' + let s = airline#section#create_left(['asdf', 'aaaa', 'raw']) + Expect s == 'asdf > aaaa > raw' + let s = airline#section#create_right(['raw', '%f']) + Expect s == 'raw < %f' + let s = airline#section#create_right(['%t', 'asdf', '%{getcwd()}']) + Expect s == '%t < asdf < %{getcwd()}' + end + + it 'should empty out parts that do not pass their condition' + call airline#parts#define_text('conditional', 'conditional') + call airline#parts#define_condition('conditional', '0') + let s = airline#section#create(['conditional']) + Expect s == '%{0 ? airline#util#wrap("conditional",0) : ""}' + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/themes.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/themes.vim new file mode 100644 index 0000000..d735229 --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/themes.vim @@ -0,0 +1,68 @@ +describe 'themes' + after + highlight clear Foo + highlight clear Normal + end + + it 'should extract correct colors' + highlight Foo ctermfg=1 ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '1' + Expect colors[3] == '2' + end + + it 'should extract from normal if colors unavailable' + highlight Normal ctermfg=100 ctermbg=200 + highlight Foo ctermbg=2 + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '100' + Expect colors[3] == '2' + end + + it 'should flip target group if it is reversed' + highlight Foo ctermbg=222 ctermfg=103 term=reverse + let colors = airline#themes#get_highlight('Foo') + Expect colors[2] == '222' + Expect colors[3] == '103' + end + + it 'should pass args through correctly' + let hl = airline#themes#get_highlight('Foo', 'bold', 'italic') + Expect hl == ['', '', 0, 1, 'bold,italic'] + + let hl = airline#themes#get_highlight2(['Foo','bg'], ['Foo','fg'], 'italic', 'bold') + Expect hl == ['', '', 1, 0, 'italic,bold'] + end + + it 'should generate color map with mirroring' + let map = airline#themes#generate_color_map( + \ [ 1, 1, 1, 1, '1' ], + \ [ 2, 2, 2, 2, '2' ], + \ [ 3, 3, 3, 3, '3' ], + \ ) + Expect map.airline_a[0] == 1 + Expect map.airline_b[0] == 2 + Expect map.airline_c[0] == 3 + Expect map.airline_x[0] == 3 + Expect map.airline_y[0] == 2 + Expect map.airline_z[0] == 1 + end + + it 'should generate color map with full set of colors' + let map = airline#themes#generate_color_map( + \ [ 1, 1, 1, 1, '1' ], + \ [ 2, 2, 2, 2, '2' ], + \ [ 3, 3, 3, 3, '3' ], + \ [ 4, 4, 4, 4, '4' ], + \ [ 5, 5, 5, 5, '5' ], + \ [ 6, 6, 6, 6, '6' ], + \ ) + Expect map.airline_a[0] == 1 + Expect map.airline_b[0] == 2 + Expect map.airline_c[0] == 3 + Expect map.airline_x[0] == 4 + Expect map.airline_y[0] == 5 + Expect map.airline_z[0] == 6 + end +end + diff --git a/etc/soft/vim/vim/+plugins/vim-airline/t/util.vim b/etc/soft/vim/vim/+plugins/vim-airline/t/util.vim new file mode 100644 index 0000000..913de9d --- /dev/null +++ b/etc/soft/vim/vim/+plugins/vim-airline/t/util.vim @@ -0,0 +1,54 @@ +call airline#init#bootstrap() + +function! Util1() + let g:count += 1 +endfunction +function! Util2() + let g:count += 2 +endfunction +function! Util3(...) + let g:count = a:0 +endfunction + +describe 'util' + before + let g:count = 0 + end + + it 'has append wrapper function' + Expect airline#util#append('', 0) == '' + Expect airline#util#append('1', 0) == ' > 1' + end + + it 'has prepend wrapper function' + Expect airline#util#prepend('', 0) == '' + Expect airline#util#prepend('1', 0) == '1 < ' + end + + it 'has getwinvar function' + Expect airline#util#getwinvar(1, 'asdf', '123') == '123' + call setwinvar(1, 'vspec', 'is cool') + Expect airline#util#getwinvar(1, 'vspec', '') == 'is cool' + end + + it 'has exec funcrefs helper functions' + call airline#util#exec_funcrefs([function('Util1'), function('Util2')]) + Expect g:count == 3 + + call airline#util#exec_funcrefs([function('Util3')], 1, 2, 3, 4) + Expect g:count == 4 + end + + it 'should ignore minwidth if less than 0' + Expect airline#util#append('foo', -1) == ' > foo' + Expect airline#util#prepend('foo', -1) == 'foo < ' + Expect airline#util#wrap('foo', -1) == 'foo' + end + + it 'should return empty if winwidth() > minwidth' + Expect airline#util#append('foo', 99999) == '' + Expect airline#util#prepend('foo', 99999) == '' + Expect airline#util#wrap('foo', 99999) == '' + end +end + diff --git a/etc/soft/vim/vim/+plugins/Join/README.md b/etc/soft/vim/vim/+plugins_disabled/Join/README.md similarity index 100% rename from etc/soft/vim/vim/+plugins/Join/README.md rename to etc/soft/vim/vim/+plugins_disabled/Join/README.md diff --git a/etc/soft/vim/vim/+plugins/Join/doc/Join.txt b/etc/soft/vim/vim/+plugins_disabled/Join/doc/Join.txt similarity index 100% rename from etc/soft/vim/vim/+plugins/Join/doc/Join.txt rename to etc/soft/vim/vim/+plugins_disabled/Join/doc/Join.txt diff --git a/etc/soft/vim/vim/+plugins/Join/plugin/Join.vim b/etc/soft/vim/vim/+plugins_disabled/Join/plugin/Join.vim similarity index 100% rename from etc/soft/vim/vim/+plugins/Join/plugin/Join.vim rename to etc/soft/vim/vim/+plugins_disabled/Join/plugin/Join.vim diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/EXAMPLES.md b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/EXAMPLES.md similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/EXAMPLES.md rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/EXAMPLES.md diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/README.md b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/README.md similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/README.md rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/README.md diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/autoload/easy_align.vim b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/autoload/easy_align.vim similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/autoload/easy_align.vim rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/autoload/easy_align.vim diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/doc/easy_align.txt b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/doc/easy_align.txt similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/doc/easy_align.txt rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/doc/easy_align.txt diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/plugin/easy_align.vim b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/plugin/easy_align.vim similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/plugin/easy_align.vim rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/plugin/easy_align.vim diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.expected b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.expected similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.expected rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.expected diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.md b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.md similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.md rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.md diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.script b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.script similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/basic.script rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/basic.script diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/include.vim b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/include.vim similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/include.vim rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/include.vim diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.expected b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.expected similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.expected rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.expected diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.md b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.md similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.md rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.md diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.script b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.script similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/regexp.script rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/regexp.script diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/test/run.vim b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/run.vim similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/test/run.vim rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/test/run.vim diff --git a/etc/soft/vim/vim/+plugins/vim-easy-align/zip b/etc/soft/vim/vim/+plugins_disabled/vim-easy-align/zip similarity index 100% rename from etc/soft/vim/vim/+plugins/vim-easy-align/zip rename to etc/soft/vim/vim/+plugins_disabled/vim-easy-align/zip diff --git a/etc/soft/vim/vim/autoload/pathogen.vim b/etc/soft/vim/vim/autoload/pathogen.vim index 7b89cca..a13ae08 100644 --- a/etc/soft/vim/vim/autoload/pathogen.vim +++ b/etc/soft/vim/vim/autoload/pathogen.vim @@ -1,6 +1,6 @@ " pathogen.vim - path option manipulation " Maintainer: Tim Pope -" Version: 2.2 +" Version: 2.3 " Install in ~/.vim/autoload (or ~\vimfiles\autoload). " @@ -8,52 +8,49 @@ " ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your " .vimrc is the only other setup necessary. " -" The API is documented inline below. For maximum ease of reading, -" :set foldmethod=marker +" The API is documented inline below. if exists("g:loaded_pathogen") || &cp finish endif let g:loaded_pathogen = 1 -function! s:warn(msg) - echohl WarningMsg - echomsg a:msg - echohl NONE -endfunction - " Point of entry for basic default usage. Give a relative path to invoke -" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke -" pathogen#surround(). For backwards compatibility purposes, a full path that -" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories() -" instead. -function! pathogen#infect(...) abort " {{{1 - for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}'] - if path =~# '^[^\\/]\+$' - call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') - call pathogen#incubate(path . '/{}') - elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$' - call pathogen#incubate(path) - elseif path =~# '[\\/]\%({}\|\*\)$' +" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke +" pathogen#surround(). Curly braces are expanded with pathogen#expand(): +" "bundle/{}" finds all subdirectories inside "bundle" inside all directories +" in the runtime path. +function! pathogen#infect(...) abort + for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}'] + if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]' call pathogen#surround(path) - else + elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)' call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') call pathogen#surround(path . '/{}') + elseif path =~# '[{}*]' + call pathogen#interpose(path) + else + call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')') + call pathogen#interpose(path . '/{}') endif endfor call pathogen#cycle_filetype() + if pathogen#is_disabled($MYVIMRC) + return 'finish' + endif return '' -endfunction " }}}1 +endfunction " Split a path into a list. -function! pathogen#split(path) abort " {{{1 +function! pathogen#split(path) abort if type(a:path) == type([]) | return a:path | endif + if empty(a:path) | return [] | endif let split = split(a:path,'\\\@"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags')) - silent! execute 'helptags' pathogen#fnameescape(dir.'/doc') + for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep') + if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags')) + silent! execute 'helptags' pathogen#fnameescape(dir) endif endfor endfor -endfunction " }}}1 +endfunction command! -bar Helptags :call pathogen#helptags() " Execute the given command. This is basically a backdoor for --remote-expr. -function! pathogen#execute(...) abort " {{{1 +function! pathogen#execute(...) abort for command in a:000 execute command endfor return '' -endfunction " }}}1 +endfunction + +" Section: Unofficial + +function! pathogen#is_absolute(path) abort + return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]') +endfunction + +" Given a string, returns all possible permutations of comma delimited braced +" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields +" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard +" and globbed. Actual globs are preserved. +function! pathogen#expand(pattern) abort + if a:pattern =~# '{[^{}]\+}' + let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1) + let found = map(split(pat, ',', 1), 'pre.v:val.post') + let results = [] + for pattern in found + call extend(results, pathogen#expand(pattern)) + endfor + return results + elseif a:pattern =~# '{}' + let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)') + let post = a:pattern[strlen(pat) : -1] + return map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post') + else + return [a:pattern] + endif +endfunction + +" \ on Windows unless shellslash is set, / everywhere else. +function! pathogen#slash() abort + return !exists("+shellslash") || &shellslash ? '/' : '\' +endfunction + +function! pathogen#separator() abort + return pathogen#slash() +endfunction + +" Convenience wrapper around glob() which returns a list. +function! pathogen#glob(pattern) abort + let files = split(glob(a:pattern),"\n") + return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")') +endfunction "}}}1 + +" Like pathogen#glob(), only limit the results to directories. +function! pathogen#glob_directories(pattern) abort + return filter(pathogen#glob(a:pattern),'isdirectory(v:val)') +endfunction "}}}1 + +" Remove duplicates from a list. +function! pathogen#uniq(list) abort + let i = 0 + let seen = {} + while i < len(a:list) + if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i]) + call remove(a:list,i) + elseif a:list[i] ==# '' + let i += 1 + let empty = 1 + else + let seen[a:list[i]] = 1 + let i += 1 + endif + endwhile + return a:list +endfunction + +" Backport of fnameescape(). +function! pathogen#fnameescape(string) abort + if exists('*fnameescape') + return fnameescape(a:string) + elseif a:string ==# '-' + return '\-' + else + return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') + endif +endfunction " Like findfile(), but hardcoded to use the runtimepath. function! pathogen#runtime_findfile(file,count) abort "{{{1 @@ -246,18 +247,38 @@ function! pathogen#runtime_findfile(file,count) abort "{{{1 else return fnamemodify(file,':p') endif -endfunction " }}}1 +endfunction -" Backport of fnameescape(). -function! pathogen#fnameescape(string) abort " {{{1 - if exists('*fnameescape') - return fnameescape(a:string) - elseif a:string ==# '-' - return '\-' +" Section: Deprecated + +function! s:warn(msg) abort + echohl WarningMsg + echomsg a:msg + echohl NONE +endfunction + +" Prepend all subdirectories of path to the rtp, and append all 'after' +" directories in those subdirectories. Deprecated. +function! pathogen#runtime_prepend_subdirectories(path) abort + call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')') + return pathogen#surround(a:path . pathogen#slash() . '{}') +endfunction + +function! pathogen#incubate(...) abort + let name = a:0 ? a:1 : 'bundle/{}' + call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')') + return pathogen#interpose(name) +endfunction + +" Deprecated alias for pathogen#interpose(). +function! pathogen#runtime_append_all_bundles(...) abort + if a:0 + call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')') else - return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','') + call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()') endif -endfunction " }}}1 + return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}') +endfunction if exists(':Vedit') finish @@ -265,7 +286,7 @@ endif let s:vopen_warning = 0 -function! s:find(count,cmd,file,lcd) " {{{1 +function! s:find(count,cmd,file,lcd) let rtp = pathogen#join(1,pathogen#split(&runtimepath)) let file = pathogen#runtime_findfile(a:file,a:count) if file ==# '' @@ -284,10 +305,10 @@ function! s:find(count,cmd,file,lcd) " {{{1 else return a:cmd.' '.pathogen#fnameescape(file) . warning endif -endfunction " }}}1 +endfunction -function! s:Findcomplete(A,L,P) " {{{1 - let sep = pathogen#separator() +function! s:Findcomplete(A,L,P) + let sep = pathogen#slash() let cheats = { \'a': 'autoload', \'d': 'doc', @@ -312,7 +333,7 @@ function! s:Findcomplete(A,L,P) " {{{1 endfor endfor return sort(keys(found)) -endfunction " }}}1 +endfunction command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(,'edit',,0) command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',,0) @@ -323,4 +344,4 @@ command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabed command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',,1) command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',,1) -" vim:set et sw=2: +" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=': diff --git a/etc/soft/vim/vimrc b/etc/soft/vim/vimrc index f4a3932..e26ba03 100644 --- a/etc/soft/vim/vimrc +++ b/etc/soft/vim/vimrc @@ -615,10 +615,10 @@ let g:airline_left_sep = '' let g:airline_right_sep = '' let g:airline_linecolumn_prefix = '/ ' let g:airline_branch_prefix = '⇵ ' -let g:airline_paste_symbol = '⬎' +let g:airline_paste_symbol = '' let g:airline_whitespace_symbol = '∅' -let g:airline_section_c = '%t%m%r%h%w%{VicleStatus()}' +let g:airline_section_c = '%t%m%r%h%w' let g:airline_section_z = '%L:%03l,%03v %p%%' " enable/disable fugitive/lawrencium integration @@ -649,20 +649,10 @@ let g:airline_theme='wombat' let g:airline_powerline_fonts=0 " define the set of text to display for each mode. -let g:airline_mode_map = { 'i': '+', 'n': '⚫', 'v': '⋕', 'V': '⇄', '': '⇅', 'R': '✂', 'c': '#', 's': 'SELECT', '^S': 'S-BLOCK', 'S': 'S-LINE' } +let g:airline_mode_map = { 'i': '+', 'n': ' ', 'v': '⇄', 'V': '⇄', '': '⇅', 'R': '✂', 'c': '#', 's': 'SELECT', '^S': 'S-BLOCK', 'S': 'S-LINE' } " }}} -" Vicle {{{ -function VicleStatus() - if exists('t:vicle_screen_sn') - return ' :: ' . t:vicle_screen_sn - else - return '' - endif -endfunction -" }}} - " GIT"{{{ " Смена ветки Git function GetGitBranches() @@ -685,12 +675,6 @@ au! BufEnter * if bufname("") !~ ".*COMMIT_EDITMSG.*" | lcd %:p:h | endif "}}} -" {{{ Gitv -map gv :Gitv --all - -let g:Gitv_OpenHorizontal = 1 -" }}} - " VimWiki"{{{ let wiki = {}