1

Consider I have a NERDTree window and more then 2 file view windows are opened in vim. In this case a common way to switch to NERDTree (navigating with several Ctrl+w g/h/j/k) is not very handy as it is not universal for all the open windows.

Is there a way to switch to NERDTree (or any other, may be) window directly?

2

3 Answers 3

6
<C-w>t 

should do what you want.

Sign up to request clarification or add additional context in comments.

2 Comments

This one switches me to another window - top left (TagList panel, as I use Trinity plugin). May be there is a way to switch to a window by name?
Thanks for keeping an important information to yourself.
2

You can make a mapping to do this:

nnoremap <silent> <Leader>t :NERDTreeFocus<CR>

Comments

0

Depending on your window layout, if NERDTree is near the top-left corner, it may have a fixed window number (:echo winnr() will tell you). You can then use [N]<C-w><C-w> to go to window number [N].

If your layout is more dynamic, it might make sense to include the window number in your 'statusline':

:set statusline+=\ %{winnr()} 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.