Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two basic questions with NERDTree — switching windows and finding files

I am using vim with NERDTree to develop, but not good at it. I have two questions with NERDTree:

  1. How to move cursor between nav window and edit window without mouse?
  2. How to go to one special file node (named xxx) in nav window directly by keyboard?
like image 868
why Avatar asked Dec 15 '10 01:12

why


People also ask

How do you switch windows in NERDTree?

(1) Thus, if your edit window is to the right of the NERDTree window, you would use: ctrl + W l to go to right window and ctrl + W h to go to left window. or ctrl + w twice to toggle between the two.

How do you switch between tabs in NERDTree and file?

Ctrl + ← arrow will switch to tab that is on the left of current tab. Ctrl + → arrow will switch to tab that is on the right of current tab.

How do I move files in NERDTree?

Press m on the node you want to then select (m)ove the current node . Moving is the same as renaming. Great answer saved my life!


1 Answers

The NERDTree plugin creates a Vim buffer, and displays it in a Vim window. So you can use any of your normal Vim commands.

(1) Thus, if your edit window is to the right of the NERDTree window, you would use: ctrl + Wl to go to right window and ctrl + Wh to go to left window. or ctrl + w twice to toggle between the two.

(2) To go to a special file, simply search for it while in the NERDTree window:

 /xxx 

Hit ENTER to end the search at the line, and then ENTER again to open the file in the previous window and go to it.

like image 73
Jeet Avatar answered Sep 18 '22 06:09

Jeet