mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Add new FAQ and answer: How to prevent buffers replacing NERDTree. (#1215)
* Add new FAQ and answer: How to prevent buffers replacing NERDTree. * Update version number in change log.
This commit is contained in:
@@ -156,6 +156,14 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
|
||||
\ quit | endif
|
||||
```
|
||||
|
||||
### 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.
|
||||
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
|
||||
```
|
||||
|
||||
### Can I have the same NERDTree on every tab automatically?
|
||||
|
||||
```vim
|
||||
|
||||
Reference in New Issue
Block a user