Disable airline in nerdtree

This commit is contained in:
ItsDrike 2021-08-31 03:22:21 +02:00
parent 36fe6799d7
commit 57ee2783eb
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD

View file

@ -11,3 +11,14 @@ if empty($DISPLAY) " Use ASCII-only if we're in TTY
let g:airline_symbols_ascii = 1
endif
" Disable airline in nerdtree buffer
augroup filetype_nerdtree
au!
au FileType nerdtree call s:disable_airline_on_nerdtree()
au WinEnter,BufWinEnter,TabEnter * call s:disable_airline_on_nerdtree()
augroup END
fu s:disable_airline_on_nerdtree() abort
let nerdtree_winnr = index(map(range(1, winnr('$')), {_,v -> getbufvar(winbufnr(v), '&ft')}), 'nerdtree') + 1
call timer_start(0, {-> nerdtree_winnr && setwinvar(nerdtree_winnr, '&stl', '%#Normal#')})
endfu