Merge pull request #2187 from kazukazuinaina/add_section_c_short_path
[add] short_path formatter in section_c
This commit is contained in:
commit
a836e09e91
|
@ -0,0 +1,8 @@
|
||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
function! airline#formatter#short_path#format(val) abort
|
||||||
|
if get(g:, 'airline_stl_path_style', 'default') ==# 'short'
|
||||||
|
return '%{pathshorten(expand("'.a:val.'"))}%'
|
||||||
|
endif
|
||||||
|
return a:val
|
||||||
|
endfunction
|
|
@ -146,7 +146,7 @@ function! airline#init#bootstrap()
|
||||||
\ 'function': 'airline#parts#readonly',
|
\ 'function': 'airline#parts#readonly',
|
||||||
\ 'accent': 'red',
|
\ 'accent': 'red',
|
||||||
\ })
|
\ })
|
||||||
call airline#parts#define_raw('file', '%f%m')
|
call airline#parts#define_raw('file', airline#formatter#short_path#format('%f%m'))
|
||||||
call airline#parts#define_raw('path', '%F%m')
|
call airline#parts#define_raw('path', '%F%m')
|
||||||
call airline#parts#define('linenr', {
|
call airline#parts#define('linenr', {
|
||||||
\ 'raw': '%{g:airline_symbols.linenr}%l',
|
\ 'raw': '%{g:airline_symbols.linenr}%l',
|
||||||
|
|
Loading…
Reference in New Issue