Update README.markdown

This commit is contained in:
Phil Runninger 2021-02-09 21:50:35 -05:00 committed by GitHub
parent 593c16add3
commit 1d46d6df3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
### How can I prevent other buffers replacing NERDTree in its window?
```vim
" If another buffer tries to replace NERDTree, put in the other window, and bring back NERDTree.
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
```