From 0c969e7860bb621b7aea1c7c0bcfe24fe7e71b75 Mon Sep 17 00:00:00 2001 From: Bailey Ling Date: Sun, 7 Jul 2013 21:00:14 -0400 Subject: [PATCH] introduce gutter section so the entire statusline can be overwritten --- README.md | 4 ++-- autoload/airline.vim | 5 +++-- doc/airline.txt | 13 +++++++------ plugin/airline.vim | 1 + 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 777aa06..c717fbe 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/autoload/airline.vim b/autoload/airline.vim index 4344a6f..495bafb 100644 --- a/autoload/airline.vim +++ b/autoload/airline.vim @@ -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 diff --git a/doc/airline.txt b/doc/airline.txt index c281be5..8bb1846 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -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) < ============================================================================== diff --git a/plugin/airline.vim b/plugin/airline.vim index a1036ac..c2b8582 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -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')