diff --git a/autoload/airline/extensions/tabline/formatters.vim b/autoload/airline/extensions/tabline/formatters.vim index 841f257..9a0fa8f 100644 --- a/autoload/airline/extensions/tabline/formatters.vim +++ b/autoload/airline/extensions/tabline/formatters.vim @@ -1,6 +1,7 @@ " MIT License. Copyright (c) 2013 Bailey Ling. " vim: et ts=2 sts=2 sw=2 +let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:.') 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 @@ -13,11 +14,10 @@ function! airline#extensions#tabline#formatters#default(bufnr, buffers) endif let name = bufname(a:bufnr) - let fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:.') if empty(name) let _ .= '[No Name]' else - let _ .= substitute(fnamemodify(name, fmod), '\w\zs.\{-}\ze\/', '', 'g') + let _ .= substitute(fnamemodify(name, s:fmod), '\w\zs.\{-}\ze\/', '', 'g') endif if getbufvar(a:bufnr, '&modified') == 1 diff --git a/doc/airline.txt b/doc/airline.txt index ab81deb..9636a0f 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -324,12 +324,17 @@ virtualenv * configure whether buffer numbers should be shown. > let g:airline#extensions#tabline#buffer_nr_show = 0 < -Note: this is only valid when the formatter is 'default'. +Note: this is only used by the 'default' formatter. * configure how buffer numbers should be formatted with |printf|. > let g:airline#extensions#tabline#buffer_nr_format = '%s: ' < -Note: this is only valid when the formatter is 'default'. +Note: this is only used by the 'default' formatter. + +* configure the formatting of filenames (see |filename-modifiers|). > + let g:airline#extensions#tabline#fnamemod = ':p:.' +< +Note: this is only used by the 'default' formatter. * configure the minimum number of buffers needed to show the tabline. > let g:airline#extensions#tabline#buffer_min_count = 0