Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created May 6, 2015 20:44
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save scrooloose/0495cade24f1f2ebb602 to your computer and use it in GitHub Desktop.
Save scrooloose/0495cade24f1f2ebb602 to your computer and use it in GitHub Desktop.
call NERDTreeAddKeyMap({'key': 't', 'callback': 'NERDTreeMyOpenInTab', 'scope': 'FileNode', 'override': 1 })
function NERDTreeMyOpenInTab(node)
call a:node.open({'reuse': "all", 'where': 't'})
endfunction
@vrkansagara
Copy link

vrkansagara commented Feb 19, 2021

hi, I tried your instruction which is given as bellow

Grab the latest version and stick this in ~/.vim/nerdtree_plugin/override_tab_mapping.vim

This is something is not working in my case. do you have any other way to do so. Thanks.

Above solution is not working with one of this

let NERDTreeMapOpenInTab='\r'
OR
let NERDTreeMapOpenInTab=''

@vrkansagara
Copy link

vrkansagara commented Apr 27, 2021

The above given solution is working just need to change the order of line.

function NERDTreeMyOpenInTab(node)
    call a:node.open({'reuse': "all", 'where': 't'})
endfunction
autocmd VimEnter * :call NERDTreeAddKeyMap({'key': 't', 'callback': 'NERDTreeMyOpenInTab', 'scope': 'FileNode', 'override': 1 })

hope this peace of code also work with enter to open same file. is this possible ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment