47 Commits
v0.1 ... v0.2

Author SHA1 Message Date
Bailey Ling
161daa7942 deprecate fugitive variable names in favour of scm-agnostic variable names 2013-07-27 18:15:00 -04:00
Bailey Ling
0c7687889e reduce complexity of themes for ctrlp, fix luna right separator color 2013-07-27 17:54:05 -04:00
Bailey Ling
60cba9cfc4 refactor ctrlp themes with generate_color_map helper function 2013-07-27 20:16:13 +00:00
Bailey Ling
f0982fa310 Merge pull request #99 from Pychimp/master
updated few values and added ctrlp theme
2013-07-27 12:44:11 -07:00
Pychimp
20372d5fb7 updated few values and added ctrlp theme 2013-07-28 00:21:58 +05:30
Bailey Ling
d1ee91eadf update the ctrlp theme when the airline theme changes 2013-07-27 14:02:43 +00:00
Bailey Ling
4683616391 Merge pull request #98 from zenbro/master
add ctrlp theme for wombat
2013-07-27 06:51:31 -07:00
zenbro
8afd815fe1 add ctrlp theme for wombat 2013-07-27 13:04:22 +04:00
Bailey Ling
68ac156256 make ctrlp themeable (#97). 2013-07-26 17:21:43 +00:00
Bailey Ling
b1975b4eb8 Merge pull request #91 from crazymaster/master
fix for out of sync statusline when buffers are unloaded.
2013-07-26 05:13:23 -07:00
Bailey Ling
6bfc2f9631 include percentage, line/column numbers for help windows 2013-07-26 12:12:39 +00:00
crazymaster
90b32f5c26 Remove unnecessary autocmds 2013-07-26 10:47:28 +09:00
Bailey Ling
77a177cc01 add more info about theming algorithm, add VAM to readme 2013-07-25 23:21:26 +00:00
Bailey Ling
c095a48aad add documentation about airline_exclude_funcrefs 2013-07-25 22:48:15 +00:00
Bailey Ling
bce1632c42 clearly separate core functionality from implementation 2013-07-25 22:29:18 +00:00
Bailey Ling
ec86f66510 move paste detection into statusline and check enabled 2013-07-25 22:09:17 +00:00
Bailey Ling
8819ab272d add commandt support. resolves #92. 2013-07-25 21:54:55 +00:00
Bailey Ling
950eb41ab6 Merge pull request #96 from zenbro/master
add wombat theme
2013-07-25 11:50:16 -07:00
zenbro
1f292621d0 add wombat theme 2013-07-25 22:23:47 +04:00
Bailey Ling
fd0628b188 add help support. resolves #95. 2013-07-25 17:49:03 +00:00
Bailey Ling
3bd1df94bc Merge branch 'master' of github.com:bling/vim-airline 2013-07-25 16:55:52 +00:00
Bailey Ling
407d8728c0 iterate available keys for each mode 2013-07-25 14:23:24 +00:00
Bailey Ling
2d63123260 Merge pull request #94 from Pychimp/master
Added Luna compatiable vim-airline theme
2013-07-25 07:00:10 -07:00
Bailey Ling
c00cd767d0 fix statusline not getting updated with some plugins (#91). 2013-07-25 13:58:48 +00:00
Pychimp
1bc2cddc74 Added Luna compatiable vim-airline theme 2013-07-25 19:11:03 +05:30
Bailey Ling
dcc0c7c84b avoid using funcrefs in the core implementation (#91). 2013-07-25 12:00:17 +00:00
Bailey Ling
34675c5d9b default iminsert to false 2013-07-25 01:48:23 +00:00
crazymaster
fbb7d1512e Fix update's condition 2013-07-25 00:53:35 +09:00
Bailey Ling
443cd8d9c8 Merge pull request #90 from klen/master
Support &iminsert
2013-07-24 06:14:39 -07:00
Kirill Klenov
efa3773bcf Merge branch 'master' of github.com:klen/vim-airline 2013-07-24 15:36:20 +04:00
Kirill Klenov
c16cafb2bb Support &iminsert. 2013-07-24 15:35:31 +04:00
Bailey Ling
ef518e5604 Merge pull request #89 from crazymaster/master
Fix vimfiler support
2013-07-24 04:26:18 -07:00
crazymaster
5951cc7ce3 Fix vimfiler support 2013-07-24 18:02:38 +09:00
Bailey Ling
dd6e952c60 update readme to demo gif 2013-07-23 23:31:15 -04:00
bling
44ac11bed3 fully document the dark theme. resolves #88. 2013-07-23 23:00:23 -04:00
Bailey Ling
8d44832c1c Merge pull request #87 from crazymaster/master
Add vimfiler support
2013-07-23 10:31:53 -07:00
crazymaster
0c88e5a7cd Add vimfiler support 2013-07-24 01:22:43 +09:00
Bailey Ling
5fd3105aae update externals after shell commands. resolves #85 and #42. 2013-07-23 14:44:05 +00:00
Bailey Ling
221864cfdc make modified/paste detection an option 2013-07-22 21:23:41 +00:00
Bailey Ling
fce0e3e8da use only a slight accent for the active buffer in the bufferline 2013-07-21 21:29:31 -04:00
Bailey Ling
ee90b7c6b3 add colorized support for selected buffers with bufferline 2013-07-20 22:31:05 -04:00
Bailey Ling
8a2890625b prepare for bufferline highlight support 2013-07-20 22:22:16 -04:00
Bailey Ling
043256f96b add reference to the FAQ in the vim doc (#81). 2013-07-20 13:24:15 +00:00
Bailey Ling
70dd963c8e Merge pull request #80 from bjauy/lawrencium
Add lawrencium support
2013-07-18 05:27:06 -07:00
maciej
645c67731c Add lawrencium support 2013-07-18 07:56:29 +02:00
Bailey Ling
6388005c46 allow g: gutter to be specified, integrate with vimshell, use get() for :w variables 2013-07-17 22:28:21 -04:00
Bailey Ling
1385667168 add old vim-powerline font symbols into the doc. resolves #76. 2013-07-17 19:09:18 +00:00
11 changed files with 444 additions and 125 deletions

View File

@@ -2,26 +2,26 @@
Lean & mean statusline for vim that's light as air.
![img](https://github.com/bling/vim-airline/wiki/screenshots/light.png)
![img](https://github.com/bling/vim-airline/wiki/screenshots/demo.gif)
# Rationale
There's already [powerline][b], why yet another statusline?
* it's 100% vimscript; no python needed.
* it's small. i want the core plugin to be *less than 200 lines* as a rule (specifically adhering to the [open/closed principle][h]).
* despite the small size, it is fully featured and already integrates with: [vim-bufferline][f], [fugitive][d], [unite][i], [ctrlp][j], [minibufexpl][o], [gundo][p], [undotree][q], [nerdtree][r], [tagbar][s] and [syntastic][e].
* it looks good with regular fonts, and provides configuration points so you can use unicode or powerline symbols.
* it's fast to load, taking roughly 1ms. by comparison, powerline needs 60ms on the same machine.
* it's fully customizable; if you know a little `statusline` syntax you can tweak it to your needs.
* it's trivial to write colorschemes; for a minimal theme you need to edit 9 lines of colors. (please send pull requests if you create new themes!)
* 100% vimscript; no python needed.
* small. i want the core plugin to be *less than 200 lines* as a rule (specifically adhering to the [open/closed principle][h]).
* integrates with a variety of plugins: [vim-bufferline][f], [fugitive][d], [unite][i], [ctrlp][j], [minibufexpl][o], [gundo][p], [undotree][q], [nerdtree][r], [tagbar][s], [syntastic][e] and [lawrencium][u].
* looks good with regular fonts and provides configuration points so you can use unicode or powerline symbols.
* fast to load, taking roughly 1ms. by comparison, powerline needs 60ms on the same machine.
* 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).
What about [old powerline][a]?
* the old version still works well, but since it's deprecated new features won't get added
* it uses different font codes, which makes it incompatible with other powerline bindings in the same terminal (e.g. bash, zsh, tmux, etc.)
* the old version still works well, but since it's deprecated new features won't get added.
* it uses different font codes, which makes it incompatible with other powerline bindings in the same terminal (e.g. bash, zsh, tmux, etc.).
# Why's it called airline?
# Where did the name come from?
I wrote the initial version on an airplane, and since it's light as air it turned out to be a good name. Thanks for flying vim!
@@ -29,12 +29,14 @@ I wrote the initial version on an airplane, and since it's light as air it turne
This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:
* [pathogen][k]
* [Pathogen][k]
* `git clone https://github.com/bling/vim-airline ~/.vim/bundle/vim-airline`
* [neobundle][l]
* [NeoBundle][l]
* `NeoBundle 'bling/vim-airline'`
* [vundle][m]
* [Vundle][m]
* `Bundle 'bling/vim-airline'`
* [VAM][v]
* `call vam#ActivateAddons([ 'vim-airline' ])`
* manual
* copy all of the files into your `~/.vim` directory
@@ -48,22 +50,22 @@ For the nice looking powerline symbols to appear, you will need to install a pat
Finally, enable them in vim-airline by adding `let g:airline_powerline_fonts = 1` to your vimrc.
# Bugs
If you encounter a bug, please do the following:
* reproduce it with this [minivimrc][g] repository to rule out any configuration conflicts.
* specify your version and patch level, as well as operating system (found with `:version`).
* a link to a gist or your vimrc where it can be reproduced.
# FAQ
Solutions to common problems can be found in the [Wiki](https://github.com/bling/vim-airline/wiki/FAQ).
# Screenshots
# Themes/Screenshots
A full list of screenshots can be found in the [Wiki][n].
# 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][g] repository to rule out any configuration conflicts.
* include your version of vim, including patches, and operating system (`:version` will contain this information).
* a link to your vimrc or a gist which shows how you configured the plugin(s).
# Contributions
Contributions and pull requests are welcome. Please take note of the following guidelines:
@@ -98,3 +100,5 @@ Distributed under the same terms as the Vim license. See `:help license`.
[r]: https://github.com/scrooloose/nerdtree
[s]: https://github.com/majutsushi/tagbar
[t]: https://powerline.readthedocs.org/en/latest/fontpatching.html
[u]: https://bitbucket.org/ludovicchabant/vim-lawrencium
[v]: https://github.com/MarcWeber/vim-addon-manager

View File

@@ -1,5 +1,6 @@
" vim: ts=2 sts=2 sw=2 fdm=indent
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
let s:sections = ['a','b','c','gutter','x','y','z']
let s:airline_highlight_map = {
\ 'mode' : 'Al2',
@@ -9,7 +10,6 @@ let s:airline_highlight_map = {
\ 'statusline' : 'Al6',
\ 'file' : 'Al7',
\ }
let s:airline_highlight_groups = keys(s:airline_highlight_map)
function! airline#exec_highlight(group, colors)
let colors = a:colors
@@ -31,68 +31,56 @@ 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 = ''
let w:airline_active = 1
call airline#highlight(['inactive'])
call airline#update_highlight()
call airline#extensions#load_theme()
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
for key in s:airline_highlight_groups
if exists('g:airline#themes#{g:airline_theme}#{mode}[key]')
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)
endif
endfor
endfor
endif
endfor
endfunction
function! s:is_excluded_window()
for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
for Fn in g:airline_exclude_funcrefs
if Fn()
return 1
endif
endfor
for matchw in g:airline_exclude_filenames
if matchstr(expand('%'), matchw) ==# matchw
return 1
endif
endfor
if g:airline_exclude_preview && &previewwindow
return 1
endif
return 0
endfunction
function! s:apply_window_overrides()
call airline#extensions#clear_window_overrides()
if &buftype == 'quickfix'
let w:airline_section_a = 'Quickfix'
let w:airline_section_b = ''
let w:airline_section_c = ''
let w:airline_section_x = ''
endif
if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
for FuncRef in g:airline_window_override_funcrefs
call FuncRef()
unlet! w:airline_left_only
for section in s:sections
unlet! w:airline_section_{section}
endfor
for Fn in g:airline_window_override_funcrefs
call Fn()
endfor
endfunction
function! airline#update_externals()
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('g:bufferline_loaded') ? '%{bufferline#generate_string()}' : "%f%m"
let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('g:loaded_syntastic_plugin') ? '%{SyntasticStatuslineFlag()}' : ''
let g:airline_externals_fugitive = g:airline_enable_fugitive && exists('g:loaded_fugitive') && strlen(fugitive#head()) > 0
\ ? g:airline_fugitive_prefix.fugitive#head() : ''
let g:airline_externals_bufferline = g:airline_enable_bufferline && exists('*bufferline#get_status_string')
\ ? '%{bufferline#refresh_status()}'.bufferline#get_status_string()
\ : "%f%m"
let g:airline_externals_syntastic = g:airline_enable_syntastic && exists('*SyntasticStatuslineFlag') ? '%{SyntasticStatuslineFlag()}' : ''
let g:airline_externals_branch = g:airline_enable_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()
\ : '')
\ : ''
endfunction
function! s:get_section(key)
@@ -119,6 +107,7 @@ function! airline#update_statusline(active)
let sl = '%{airline#update_highlight()}'
if a:active
let sl.=l:mode_color.' '.s:get_section('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
@@ -126,8 +115,9 @@ function! airline#update_statusline(active)
let sl.=l:info_sep_color
let sl.=g:airline_left_sep
let sl.=l:status_color.' %<'.s:get_section('c').' '
let sl.=exists('w:airline_section_gutter')
\ ? s:get_section('gutter')
let gutter = get(w:, 'airline_section_gutter', get(g:, 'airline_section_gutter', ''))
let sl.=gutter != ''
\ ? gutter
\ : '%#warningmsg#'.g:airline_externals_syntastic.l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color
else
let sl.=l:status_color.' %f%m'
@@ -148,7 +138,7 @@ endfunction
let g:airline_current_mode_text = ''
function! airline#update_highlight()
if w:airline_active
if get(w:, 'airline_active', 1)
let l:m = mode()
if l:m ==# "i"
let l:mode = ['insert']
@@ -160,15 +150,22 @@ function! airline#update_highlight()
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 exists('b:keymap_name')
let g:airline_current_mode_text .= ' ' . toupper(b:keymap_name)
else
let g:airline_current_mode_text .= ' LANG'
endif
endif
else
let l:mode = ['inactive']
endif
if &modified | call add(l:mode, 'modified') | endif
if &paste | call add(l:mode, 'paste') | 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
let mode_string = join(l:mode)
if !exists('w:airline_lastmode') || w:airline_lastmode != mode_string
if get(w:, 'airline_lastmode', '') != mode_string
call airline#highlight(l:mode)
let w:airline_lastmode = mode_string
endif

View File

@@ -1,50 +1,110 @@
let s:sections = ['a','b','c','gutter','x','y','z']
function! s:override_left_only(section1, section2)
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_left_only = 1
endfunction
function! airline#extensions#clear_window_overrides()
silent! unlet w:airline_left_only
for section in s:sections
silent! unlet w:airline_section_{section}
endfor
function! airline#extensions#apply_window_overrides()
if &buftype == 'quickfix'
let w:airline_section_a = 'Quickfix'
let w:airline_section_b = ''
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 = ' '
let w:airline_section_x = ''
let w:airline_section_y = ''
endif
if &previewwindow
let w:airline_section_a = 'Preview'
let w:airline_section_b = ''
let w:airline_section_c = bufname(winbufnr(winnr()))
endif
if &ft == 'netrw'
call airline#extensions#apply_left_override('netrw', '%f')
elseif &ft == 'unite'
call airline#extensions#apply_left_override('Unite', '%{unite#get_status_string()}')
elseif &ft == 'nerdtree'
call airline#extensions#apply_left_override('NERD', '')
elseif &ft == 'undotree'
call airline#extensions#apply_left_override('undotree', '')
elseif &ft == 'gundo'
call airline#extensions#apply_left_override('Gundo', '')
elseif &ft == 'diff'
call airline#extensions#apply_left_override('diff', '')
elseif &ft == 'tagbar'
call airline#extensions#apply_left_override('Tagbar', '')
elseif &ft == 'vimshell'
call airline#extensions#apply_left_override('vimshell', '%{vimshell#get_status_string()}')
elseif &ft == 'vimfiler'
call airline#extensions#apply_left_override('vimfiler', '%{vimfiler#get_status_string()}')
elseif &ft == 'minibufexpl'
call airline#extensions#apply_left_override('MiniBufExplorer', '')
endif
endfunction
function! airline#extensions#apply_window_overrides()
if &ft == 'netrw'
call s:override_left_only('netrw', '%f')
elseif &ft == 'unite'
call s:override_left_only('Unite', unite#get_status_string())
elseif &ft == 'nerdtree'
call s:override_left_only('NERD', '')
elseif &ft == 'undotree'
call s:override_left_only('undotree', '')
elseif &ft == 'gundo'
call s:override_left_only('Gundo', '')
elseif &ft == 'diff'
call s:override_left_only('diff', '')
elseif &ft == 'tagbar'
call s:override_left_only('Tagbar', '')
elseif &ft == 'minibufexpl'
call s:override_left_only('MiniBufExplorer', '')
function! airline#extensions#is_excluded_window()
for matchft in g:airline_exclude_filetypes
if matchft ==# &ft
return 1
endif
endfor
for matchw in g:airline_exclude_filenames
if matchstr(expand('%'), matchw) ==# matchw
return 1
endif
endfor
if g:airline_exclude_preview && &previewwindow
return 1
endif
return 0
endfunction
function! airline#extensions#load_theme()
if get(g:, 'loaded_ctrlp', 0)
call airline#extensions#ctrlp#load_theme()
endif
endfunction
function! airline#extensions#load()
let g:unite_force_overwrite_statusline = 0
if get(g:, 'loaded_unite', 0)
let g:unite_force_overwrite_statusline = 0
endif
if get(g:, 'loaded_vimfiler', 0)
let g:vimfiler_force_overwrite_statusline = 0
endif
if exists('g:loaded_ctrlp') && g:loaded_ctrlp
call airline#extensions#ctrlp#load_ctrlp_hi()
if get(g:, 'loaded_ctrlp', 0)
let g:ctrlp_status_func = {
\ 'main': 'airline#extensions#ctrlp#ctrlp_airline',
\ 'prog': 'airline#extensions#ctrlp#ctrlp_airline_status',
\ }
endif
if get(g:, 'command_t_loaded', 0)
call add(g:airline_window_override_funcrefs, function('airline#extensions#commandt#apply_window_override'))
endif
if g:airline_enable_bufferline && get(g:, 'loaded_bufferline', 0)
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 = ' '
endif
call add(g:airline_window_override_funcrefs, function('airline#extensions#apply_window_overrides'))
call add(g:airline_exclude_funcrefs, function('airline#extensions#is_excluded_window'))
endfunction

View File

@@ -0,0 +1,5 @@
function! airline#extensions#commandt#apply_window_override()
if bufname('%') ==# 'GoToFile'
call airline#extensions#apply_left_override('CommandT', '')
endif
endfunction

View File

@@ -1,14 +1,26 @@
" TODO: support loading color palette from g:airline_theme
function! airline#extensions#ctrlp#generate_color_map(dark, light, white)
return {
\ 'CtrlPdark' : a:dark,
\ 'CtrlPlight' : a:light,
\ 'CtrlPwhite' : a:white,
\ 'CtrlParrow1' : [ a:light[1] , a:white[1] , a:light[3] , a:white[3] , '' ] ,
\ 'CtrlParrow2' : [ a:white[1] , a:light[1] , a:white[3] , a:light[3] , '' ] ,
\ 'CtrlParrow3' : [ a:light[1] , a:dark[1] , a:light[3] , a:dark[3] , '' ] ,
\ }
endfunction
function! airline#extensions#ctrlp#load_ctrlp_hi()
hi! CtrlPdark ctermfg=189 ctermbg=55 guifg=#d7d7ff guibg=#5f00af
hi! CtrlPlight ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7
hi! CtrlPwhite ctermfg=55 ctermbg=231 term=bold guifg=#5f00af guibg=#ffffff gui=bold
hi! CtrlParrow1 ctermfg=98 ctermbg=231 guifg=#875fd7 guibg=#ffffff
hi! CtrlParrow2 ctermfg=231 ctermbg=98 guifg=#ffffff guibg=#875fd7
hi! CtrlParrow3 ctermfg=98 ctermbg=55 guifg=#875fd7 guibg=#5f00af
hi! CtrlParrow4 ctermfg=231 ctermbg=55 guifg=#ffffff guibg=#5f00af
hi! CtrlParrow5 ctermfg=98 ctermbg=231 guifg=#875fd7 guibg=#ffffff
function! airline#extensions#ctrlp#load_theme()
if exists('g:airline#themes#{g:airline_theme}#ctrlp')
let theme = g:airline#themes#{g:airline_theme}#ctrlp
else
let theme = airline#extensions#ctrlp#generate_color_map(
\ [ '#d7d7ff' , '#5f00af' , 189 , 55 , '' ],
\ [ '#ffffff' , '#875fd7' , 231 , 98 , '' ],
\ [ '#5f00af' , '#ffffff' , 55 , 231 , 'bold' ])
endif
for key in keys(theme)
call airline#exec_highlight(key, theme[key])
endfor
endfunction
" Recreate Ctrl-P status line with some slight modifications
@@ -22,7 +34,7 @@ function! airline#extensions#ctrlp#ctrlp_airline(...)
let nxt = '%#CtrlPlight# '.a:6.' %#CtrlParrow3#'.g:airline_left_sep
let marked = '%#CtrlPdark# '.a:7.' '
let focus = '%=%<%#CtrlPdark# '.a:1.' %*'
let byfname = '%#CtrlParrow4#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*'
let byfname = '%#CtrlParrow3#'.g:airline_right_alt_sep.'%#CtrlPdark# '.a:2.' %*'
let dir = '%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
" Return the full statusline
return regex.prv.item.nxt.marked.focus.byfname.dir
@@ -31,8 +43,8 @@ endfunction
" Argument: len
" a:1
function! airline#extensions#ctrlp#ctrlp_airline_status(...)
let len = '%#CtrlPwhite# '.a:1
let dir = '%=%<%#CtrlParrow5#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
let len = '%#CtrlPdark# '.a:1
let dir = '%=%<%#CtrlParrow3#'.g:airline_right_sep.'%#CtrlPlight# '.getcwd().' %*'
" Return the full statusline
return len.dir
endfunction

View File

@@ -1,4 +1,4 @@
" generates a hashtable which defines the colors for each highlight group
" 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 {

View File

@@ -1,8 +1,44 @@
" Each theme is contained in its own file and declares variables scoped to the file.
" These variables represent the possible "modes" that airline can detect. The mode
" is the return value of mode(), which gets converted to a readable string. The
" following is a list currently supported modes: normal, insert, replace, visual,
" and inactive.
"
" Each mode can also have overrides. These are small changes to the mode that don't
" require a completely different look. "modified" and "paste" are two such supported
" overrides. These are simply suffixed to the major mode, separated by an underscore.
" For example, "normal_modified" would be normal mode where the current buffer is
" modified.
"
" The theming algorithm is a 2-pass system where the mode will draw over all parts of
" the statusline, and then the override is applied after. This means it is possible
" to specify a subset of the theme in overrides, as it will simply overwrite the
" previous colors. If you want simultaneous overrides, then they will need to
" change different parts of the statusline so they do not conflict with each other.
" First let's define 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.
" 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)
" 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 declared.
let g:airline#themes#dark#normal_modified = {
\ 'info_separator': [ '#444444' , '#5f005f' , 238 , 53 , '' ] ,
\ 'statusline': [ '#ffffff' , '#5f005f' , 255 , 53 , '' ] ,

View File

@@ -0,0 +1,56 @@
" 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#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: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 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#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 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 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' , '' , '' ] ,
\ }
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 , '' ] )
endif

View File

@@ -0,0 +1,96 @@
" vim-airline companion theme of Wombat
" looks great with wombat256 vim colorscheme
" Normal mode
" [ guifg, guibg, ctermfg, ctermbg, opts ]
let s:N1 = [ '#141413' , '#CAE682' , 232 , 192 ] " mode
let s:N2 = [ '#CAE682' , '#32322F' , 192 , 236 ] " info
let s:N3 = [ '#CAE682' , '#242424' , 192 , 234 ] " statusline
let s:N4 = [ '#86CD74' , 113 ] " mode modified
" Insert mode
let s:I1 = [ '#141413' , '#FDE76E' , 232 , 227 ]
let s:I2 = [ '#FDE76E' , '#32322F' , 227 , 236 ]
let s:I3 = [ '#FDE76E' , '#242424' , 227 , 234 ]
let s:I4 = [ '#FADE3E' , 221 ]
" Visual mode
let s:V1 = [ '#141413' , '#B5D3F3' , 232 , 153 ]
let s:V2 = [ '#B5D3F3' , '#32322F' , 153 , 236 ]
let s:V3 = [ '#B5D3F3' , '#242424' , 153 , 234 ]
let s:V4 = [ '#7CB0E6' , 111 ]
" Replace mode
let s:R1 = [ '#141413' , '#E5786D' , 232 , 173 ]
let s:R2 = [ '#E5786D' , '#32322F' , 173 , 236 ]
let s:R3 = [ '#E5786D' , '#242424' , 173 , 234 ]
let s:R4 = [ '#E55345' , 203 ]
" Paste mode
let s:PA = [ '#94E42C' , 47 ]
" Info modified
let s:IM = [ '#40403C' , 238 ]
" 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#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#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#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#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#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#inactive = airline#themes#generate_color_map(s:IA, s:IA, s:IA, s:file)
let g:airline#themes#wombat#inactive_modified = {
\ 'statusline' : [ '#BCBCBC' , '' , 250 , '' , '' ] }
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' ] )
endif

View File

@@ -15,6 +15,7 @@ another statusline?
* vim-bufferline <https://github.com/bling/vim-bufferline>
* unite <https://github.com/Shougo/unite.vim>
* ctrlp <https://github.com/kien/ctrlp.vim>
* lawrencium <https://bitbucket.org/ludovicchabant/vim-lawrencium>
* it looks good with regular fonts, and provides configuration points so you
can use unicode or powerline symbols.
* it's fast to load, taking roughly 1ms. by comparison, powerline needs
@@ -27,7 +28,7 @@ another statusline?
==============================================================================
NAME *airline-name*
Why is it named airline?
Where did the name come from?
I wrote this on an airplane, and since it's light as air it turned out to be a
good name :-)
@@ -48,9 +49,9 @@ values):
let g:airline_right_sep='<'
<
* enable/disable fugitive integration
* enable/disable fugitive/lawrencium integration
>
let g:airline_enable_fugitive=1
let g:airline_enable_branch=1
<
* enable/disable syntastic integration
@@ -58,6 +59,19 @@ values):
let g:airline_enable_syntastic=1
<
* enable modified detection
>
let g:airline_detect_modified=1
<
* enable paste detection
>
let g:airline_detect_paste=1
<
* enable iminsert detection
>
let g:airline_detect_iminsert=1
* change the default theme
>
let g:airline_theme='dark'
@@ -113,7 +127,7 @@ separators, as well as the powerline font glyths.
let g:airline_linecolumn_prefix = '␊ '
let g:airline_linecolumn_prefix = '␤ '
let g:airline_linecolumn_prefix = '¶ '
let g:airline_fugitive_prefix = '⎇ '
let g:airline_branch_prefix = '⎇ '
let g:airline_paste_symbol = 'ρ'
let g:airline_paste_symbol = 'Þ'
let g:airline_paste_symbol = '∥'
@@ -121,11 +135,20 @@ separators, as well as the powerline font glyths.
" 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_fugitive_prefix = ' '
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 = ' '
" 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 = '⭡'
<
For more intricate customizations, you can replace the predefined sections
@@ -134,14 +157,14 @@ with the usual statusline syntax.
>
" here are the the default values
let g:airline_section_a (the mode/paste indicator)
let g:airline_section_b (the fugitive branch indicator)
let g:airline_section_b (the fugitive/lawrencium branch indicator)
let g:airline_section_c (bufferline or filename)
let g:airline_section_gutter (syntastic and readonly flag)
let g:airline_section_x (filetype)
let g:airline_section_y (fileencoding, fileformat)
let g:airline_section_z (percentage, line number, column number)
" here is an example of how you could replace the fugitive indicator with
" here is an example of how you could replace the branch indicator with
" the current working directory, followed by the filename.
let g:airline_section_b = '%{getcwd()}'
let g:airline_section_c = '%t'
@@ -150,7 +173,6 @@ with the usual statusline syntax.
If there is a particular plugin or filetype that is not supported, you can
extend it by adding a function reference to the global array. Here is an
example that you could add to your vimrc:
>
function! MyPlugin()
if &filetype == 'MyPluginFileType'
@@ -162,6 +184,29 @@ example that you could add to your vimrc:
call add(g:airline_window_override_funcrefs, function('MyPlugin'))
<
In a similar fashion, you can define a function to exclude a window from
having its statusline modified.
>
function! ExcludeFoo()
return &filetype == 'FooType'
endfunction
call add(g:airline_exclude_funcrefs, function('ExcludeFoo'))
<
==============================================================================
WRITING THEMES *airline-themes*
Themes are written "close to the metal" -- you will need to know some basic
VimL syntax to write a theme, but if you're written in any programming
language it will be easy to pick up. Have a look at the dark.vim theme
where it is fully documented.
==============================================================================
TROUBLESHOOTING *airline-troubleshooting*
Solutions to common problems can be found FAQ section in the Wiki:
<https://github.com/bling/vim-airline/wiki/FAQ>
==============================================================================
CONTRIBUTIONS *airline-contributions*

View File

@@ -8,14 +8,20 @@ function! s:check_defined(variable, default)
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
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_fugitive', 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_fugitive_prefix', exists('g:airline_powerline_fonts')?' ':'')
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_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')
@@ -24,15 +30,16 @@ call s:check_defined('g:airline_exclude_filenames', ['DebuggerWatch','DebuggerSt
call s:check_defined('g:airline_exclude_filetypes', [])
call s:check_defined('g:airline_exclude_preview', 0)
call s:check_defined('g:airline_window_override_funcrefs', [])
call s:check_defined('g:airline_exclude_funcrefs', [])
call s:check_defined('g:airline_mode_map', {
\ 'n' : 'NORMAL',
\ 'i' : 'INSERT',
\ 'R' : 'RPLACE',
\ 'R' : 'REPLACE',
\ 'v' : 'VISUAL',
\ 'V' : 'V-LINE',
\ 'c' : 'CMD ',
\ '' : 'V-BLCK',
\ '' : 'V-BLOCK',
\ })
let s:airline_initialized = 0
@@ -41,8 +48,8 @@ function! s:init()
call airline#extensions#load()
call airline#update_externals()
call airline#load_theme(g:airline_theme)
call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text} %{&paste ? g:airline_paste_symbol." " : ""}')
call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}')
call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text}')
call s:check_defined('g:airline_section_b', '%{g:airline_externals_branch}')
call s:check_defined('g:airline_section_c', g:airline_externals_bufferline)
call s:check_defined('g:airline_section_gutter', '')
call s:check_defined('g:airline_section_x', "%{strlen(&filetype)>0?&filetype:''}")
@@ -69,5 +76,6 @@ augroup airline
au!
autocmd ColorScheme * call airline#highlight(['normal'])
autocmd WinLeave * call airline#update_statusline(0)
autocmd WinEnter,BufWinEnter,FileType * call <sid>init() | call airline#update_statusline(1)
autocmd WinEnter,BufWinEnter,FileType,BufUnload * call <sid>init() | call airline#update_statusline(1)
autocmd ShellCmdPost * call airline#update_externals()
augroup END