init.vim: use %F in section_c if autochdir is set.

The difference as per documentation of :statusline

    f S   Path to the file in the buffer, as typed or relative to current
	  directory.
    F S   Full path to the file in the buffer.
This commit is contained in:
Yousong Zhou 2015-05-27 10:11:01 +08:00
parent 14d14cf951
commit 18a19532ea

View File

@ -79,6 +79,7 @@ function! airline#init#bootstrap()
\ 'accent': 'red', \ 'accent': 'red',
\ }) \ })
call airline#parts#define_raw('file', '%f%m') call airline#parts#define_raw('file', '%f%m')
call airline#parts#define_raw('path', '%F%m')
call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#') call airline#parts#define_raw('linenr', '%{g:airline_symbols.linenr}%#__accent_bold#%4l%#__restore__#')
call airline#parts#define_function('ffenc', 'airline#parts#ffenc') call airline#parts#define_function('ffenc', 'airline#parts#ffenc')
call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap']) call airline#parts#define_empty(['hunks', 'branch', 'tagbar', 'syntastic', 'eclim', 'whitespace','windowswap'])
@ -96,7 +97,11 @@ function! airline#init#sections()
let g:airline_section_b = airline#section#create(['hunks', 'branch']) let g:airline_section_b = airline#section#create(['hunks', 'branch'])
endif endif
if !exists('g:airline_section_c') if !exists('g:airline_section_c')
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly']) if &autochdir == 1
let g:airline_section_c = airline#section#create(['%<', 'path', spc, 'readonly'])
else
let g:airline_section_c = airline#section#create(['%<', 'file', spc, 'readonly'])
endif
endif endif
if !exists('g:airline_section_gutter') if !exists('g:airline_section_gutter')
let g:airline_section_gutter = airline#section#create(['%=']) let g:airline_section_gutter = airline#section#create(['%='])