mirror of
https://github.com/vim-airline/vim-airline.git
synced 2024-11-23 02:16:12 +08:00
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
8
autoload/airline/formatter/short_path.vim
Normal file
8
autoload/airline/formatter/short_path.vim
Normal file
|
@ -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',
|
||||
\ '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('linenr', {
|
||||
\ 'raw': '%{g:airline_symbols.linenr}%l',
|
||||
|
|
Loading…
Reference in New Issue
Block a user