From 0b708804713d93abd0c64b957f92c4e70f1416bf Mon Sep 17 00:00:00 2001 From: pydave Date: Thu, 19 Sep 2013 08:04:37 -0700 Subject: [PATCH] Add option to hide previous/next modes in ctrlp New option airline#extensions#ctrlp#show_adjacent_modes allows users to toggle showing the previous and next modes. The default is the same behavior as before: show the modes. Add documentation for new option. These modes are useful if you switch forward and back through ctrlp's functionality, but they are visual noise if you don't. --- autoload/airline/extensions/ctrlp.vim | 7 ++++++- doc/airline.txt | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/airline/extensions/ctrlp.vim b/autoload/airline/extensions/ctrlp.vim index a39c70b..851b0b7 100644 --- a/autoload/airline/extensions/ctrlp.vim +++ b/autoload/airline/extensions/ctrlp.vim @@ -43,7 +43,12 @@ function! airline#extensions#ctrlp#ctrlp_airline(...) 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 + if get(g:, 'airline#extensions#ctrlp#show_adjacent_modes', 1) + let modes = prv.item.nxt + else + let modes = item + endif + return regex.modes.marked.focus.byfname.dir endfunction " Argument: len diff --git a/doc/airline.txt b/doc/airline.txt index ae6c2a9..1183365 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -276,6 +276,11 @@ ctrlp 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