Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open a file in new tab by default in NERDTree?

Tags:

vim

nerdtree

I want a file to be opened in a new tab when I enter or double click it. I know there is t shortcut but I always open a file in a new tab and enter is more confortable for me.

like image 868
alice Avatar asked Dec 30 '11 15:12

alice


People also ask

How do you switch between tabs in NERDTree?

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

How do I open a new tab in Vim?

Opening a tab Probably the easiest to remember is to run the :tabnew command while in normal mode. This will open a new tab with an empty buffer. If you want to edit a file in the new tab, you can run :tabnew filename and Vim will load the file in the new tab.


2 Answers

s will open the file currently under the cursor in a new vertically split window. Use t to open in a new tab.

like image 139
alex Avatar answered Sep 29 '22 10:09

alex


Try adding

let NERDTreeMapOpenInTab='\r' 

or

let NERDTreeMapOpenInTab='<ENTER>' 

to your .vimrc.

like image 29
Zsolt Botykai Avatar answered Sep 29 '22 12:09

Zsolt Botykai