introduce gutter section so the entire statusline can be overwritten

This commit is contained in:
Bailey Ling 2013-07-07 21:00:14 -04:00
parent 52607e204c
commit 0c969e7860
4 changed files with 13 additions and 10 deletions

View File

@ -47,7 +47,7 @@ this plugin follows the standard runtime path structure, and as such it can be i
* there is a pause when leaving insert mode
* you need to set `ttimeoutlen` to a low number; 50 is recommended
* you don't see any colors
* the value of `t_Co` is likely misconfigured. please see this [article][n].
* all of the themes use a 256 terminal color palette. it's likely that the value of `t_Co` is misconfigured. please see this [article][n] on how to configure your terminal. pull requests for 8 and 16 color terminals are welcome.
* you get the error `Unknown function: fugitive#head`
* you are probably using version 1.2, which is very old...download v2 from the [project page][d].
* airline doesn't appear until i create a new split
@ -57,7 +57,7 @@ this plugin follows the standard runtime path structure, and as such it can be i
# bugs
if you encounter a bug, please reproduce it with this [minivimrc][g] repository i created and file an issue.
if you encounter a bug, please reproduce it with this [minivimrc][g] repository i created and file an issue. please provide your operating system and vim version/patch level (can be found with `:version`). a reproducible gist would be hugely helpful.
# screenshots

View File

@ -103,8 +103,9 @@ function! airline#update_statusline(active)
let sl.=l:info_sep_color
let sl.=a:active ? g:airline_left_sep : g:airline_left_alt_sep
let sl.=a:active ? l:status_color.' '.s:get_section('c').' ' : ' '.bufname(winbufnr(winnr()))
let sl.='%#warningmsg#'.g:airline_externals_syntastic
let sl.=l:status_color."%<%=".l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color
let sl.=g:airline_section_gutter != ''
\ ? g:airline_section_gutter
\ : '%#warningmsg#'.g:airline_externals_syntastic.l:status_color."%<%=".l:file_flag_color."%{&ro ? g:airline_readonly_symbol : ''}".l:status_color
let sl.=' '.s:get_section('x').' '
let sl.=l:info_sep_color
let sl.=a:active ? g:airline_right_sep : g:airline_right_alt_sep

View File

@ -112,12 +112,13 @@ with the usual statusline syntax.
>
" here are the the default values
let g:airline_section_a (the mode indicator)
let g:airline_section_b (the fugitive branch indicator)
let g:airline_section_c (bufferline or filename)
let g:airline_section_x (filetype)
let g:airline_section_y (fileencoding, fileformat)
let g:airline_section_z (percentage, line number, column number)
let g:airline_section_a (the mode indicator)
let g:airline_section_b (the fugitive 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)
<
==============================================================================

View File

@ -41,6 +41,7 @@ function! s:init()
call s:check_defined('g:airline_section_a', '%{g:airline_current_mode_text}')
call s:check_defined('g:airline_section_b', '%{g:airline_externals_fugitive}')
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:''}")
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')