diff --git a/CHANGELOG.md b/CHANGELOG.md index 89cc137a..edf9e616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ This is the Changelog for the vim-airline project. - [vim-lsp](https://github.com/prabirshrestha/vim-lsp) support - [zoomwintab](https://github.com/troydm/zoomwintab.vim) support - [Vaffle](https://github.com/cocopon/vaffle.vim) support + - [vim-dirvish](https://github.com/justinmk/vim-dirvish) support - Improvements - git branch can also be displayed using [gina.vim](https://github.com/lambdalisue/gina.vim) - coc extensions can also show additional status messages diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 60716b34..594c8352 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -445,7 +445,7 @@ function! airline#extensions#load() endfor endif - if exists(':Dirvish') + if exists(':Dirvish') && get(g:, 'airline#extensions#dirvish#enabled', 1) call airline#extensions#dirvish#init(s:ext) call add(s:loaded_ext, 'dirvish') endif diff --git a/autoload/airline/extensions/dirvish.vim b/autoload/airline/extensions/dirvish.vim index 5ccab971..4e03fed4 100644 --- a/autoload/airline/extensions/dirvish.vim +++ b/autoload/airline/extensions/dirvish.vim @@ -4,7 +4,7 @@ scriptencoding utf-8 -if !exists(':Dirvish') +if !get(g:, 'loaded_dirvish', 0) finish endif @@ -22,10 +22,7 @@ function! airline#extensions#dirvish#apply(...) abort \ ? '%{airline#extensions#branch#get_head()}' \ : '' - let w:airline_section_c = - \ '%{join(split((execute("lcd"))))}' - \ . s:spc - \ . get(w:, 'airline_section_c', g:airline_section_c) + let w:airline_section_c = '%{b:dirvish._dir}' let w:airline_section_x = '' let w:airline_section_y = '' diff --git a/doc/airline.txt b/doc/airline.txt index ab600821..c63be9b9 100644 --- a/doc/airline.txt +++ b/doc/airline.txt @@ -700,6 +700,13 @@ Denite * enable/disable denite integration > let g:airline#extensions#denite#enabled = 1 +------------------------------------- *airline-dirvish* +vim-dirvish + +* enable/disable vim-dirvish integration > + let g:airline#extensions#dirvish#enabled = 1 +< default: 1 + ------------------------------------- *airline-eclim* eclim