mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-22 14:49:06 +08:00
allow collapsing to be configurable. also fix win paths.
This commit is contained in:
parent
e1062c5f84
commit
dbd9121c05
|
@ -2,6 +2,7 @@
|
|||
" vim: et ts=2 sts=2 sw=2
|
||||
|
||||
let s:fmod = get(g:, 'airline#extensions#tabline#fnamemod', ':p:.')
|
||||
let s:fnamecollapse = get(g:, 'airline#extensions#tabline#fnamecollapse', 1)
|
||||
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
|
||||
|
@ -17,7 +18,11 @@ function! airline#extensions#tabline#formatters#default(bufnr, buffers)
|
|||
if empty(name)
|
||||
let _ .= '[No Name]'
|
||||
else
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\w\zs.\{-}\ze\/', '', 'g')
|
||||
if s:fnamecollapse
|
||||
let _ .= substitute(fnamemodify(name, s:fmod), '\v\w\zs.{-}\ze(\\|/)', '', 'g')
|
||||
else
|
||||
let _ .= fnamemodify(name, s:fmod)
|
||||
endif
|
||||
endif
|
||||
|
||||
if getbufvar(a:bufnr, '&modified') == 1
|
||||
|
|
|
@ -331,6 +331,9 @@ virtualenv <https://github.com/jmcantrell/vim-virtualenv>
|
|||
<
|
||||
* configure the formatting of filenames (see |filename-modifiers|). >
|
||||
let g:airline#extensions#tabline#fnamemod = ':p:.'
|
||||
<
|
||||
* configure collapsing parent directories in buffer name. >
|
||||
let g:airline#extensions#tabline#fnamecollapse = 1
|
||||
<
|
||||
* configure the minimum number of buffers needed to show the tabline. >
|
||||
let g:airline#extensions#tabline#buffer_min_count = 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user