Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convince nerdtree to open file in current window

Tags:

vim

nerdtree

I want to use o to open a file that may already be open in some other tab within my VI session. It always jumps to the tab where the file is open. Is there some way to stop this and just duplicate the file in the current tab/split?

like image 424
Sean Smith Avatar asked Oct 21 '14 15:10

Sean Smith


2 Answers

Add this to your .vimrc

let g:NERDTreeMapActivateNode = ''
let g:NERDTreeMapOpenInTab = 'o'

Note that hitting Enter now calls the function that pressing o originally called by default. Also, it will open the file in a new tab even when no file is being viewed.

I would recommend just using t or s.

like image 94
Jason Denney Avatar answered Nov 15 '22 00:11

Jason Denney


Add this to your .vimrc

let g:NERDTreeMapActivateNode = 'go'
let g:NERDTreeMapPreview = 'o'
like image 24
Llopeth Avatar answered Nov 15 '22 00:11

Llopeth