Ignore NerdTree buffer when manipulating splits

When working with multiple splits, split control commands are very useful: <C-W> R/ror <C-w><S-h>, for example.

The problem is that when I have a NedTree buffer open as a split, a command like <C-W>Ror <C-w><S-h>also moves the NerdTree partition, which is clearly not the desired result.

I tried to reassign these commands to include :NERTreeToggle<CR>:NERDTreeToggle<CR>, but this does not work and in any case is quite awkward.

Is there a way to “block” the NerdTree partition on either the left or the right side and ignore it using separate manipulation commands?

+4
source share
1 answer

What if you just closed Nerdtree before moving your splits, thereby avoiding any of the following problems:

nnoremap <C-W> :NERDTreeClose<CR><C-W>

Once you're done manipulating split screens, run Nerdtree again. If you need to be a fantasy, combine closure, spinning splits, and rediscovering Nerdtree in one mapping, something like:

nnoremap <C-W>r :NERDTreeClose<CR><C-W>r<bar>:NERDTreeToggle<CR>
0
source

Source: https://habr.com/ru/post/1606377/


All Articles