diff options
| author | Aaron LI <aly@aaronly.me> | 2023-06-13 09:47:38 +0800 |
|---|---|---|
| committer | Aaron LI <aly@aaronly.me> | 2023-06-13 10:02:50 +0800 |
| commit | 4a78be295c8475348642c7cedfdea024c5bcce26 (patch) | |
| tree | 22d50ab82ad179a6485ad22a85329c94f677d143 /_vim | |
| parent | 3264fa9c6c0dc567c337981a83073e5c63178322 (diff) | |
| download | dotfiles-4a78be295c8475348642c7cedfdea024c5bcce26.tar.bz2 | |
vim: Improve NERDTree config (close tag if the last one)
Diffstat (limited to '_vim')
| -rw-r--r-- | _vim/vimrc | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -345,6 +345,8 @@ nnoremap <leader>n :NERDTreeToggle<cr> " Start NERDTree when Vim is started without file arguments. autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif +" Close the tab if NERDTree is the only window remaining in it. +autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif " Mappings for Tagbar nnoremap <leader>t :TagbarToggle<cr> |
