Skip to content

Commit

Permalink
Close Vim when NERDTree is the last window
Browse files Browse the repository at this point in the history
  • Loading branch information
itaisteinherz committed Jan 12, 2022
1 parent 8c5b9e2 commit 13f3891
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dot_vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif
" Open the existing NERDTree on each new tab
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | 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

0 comments on commit 13f3891

Please sign in to comment.