Don't prevent switching when NERDTree is the only window

Phil Runninger
2019-06-19 09:19:48 -04:00
parent 0937875906
commit 32bb58b54b

@@ -1,6 +1,6 @@
## How can I make sure vim does not open files and other buffers on NerdTree window?
```vim
" If previous buffer was NERDTree, go back to it.
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" | b# | endif
" If more than one window and previous buffer was NERDTree, go back to it.
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif
```