Suggestion made by issue #1125

André Sbrocco Figueiredo
2020-05-15 18:00:13 -03:00
parent 5dd7ac273b
commit 503d195838

@@ -4,4 +4,7 @@
" If more than one window and previous buffer was NERDTree, go back to it. " If more than one window and previous buffer was NERDTree, go back to it.
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif
``` ```
(Careful if you are using vim-plug: if you set this config and run 'PlugInstall', for instance, while your cursor is on the NERDTree, it will crash!) If you are using vim-plug, you'll also need to add these lines to avoid crashes when calling vim-plug functions while the cursor is on the NERDTree:
```vim
let g:plug_window = 'noautocmd vertical topleft new'
```