Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the Dvorak keyboard layout with VIM, and the 't' key is the 'up' motion when editing a regular file.

The problem is that NERDTree remaps 't' to open files in a new tab. How can I undo that mapping and use 't' for the up motion in NERDTree?

Here are the relevant lines from my vimrc file and from the NERDTree plugin.

My .vimrc:

no t k

NERDTree plugin file:

exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenInTab ." :call <SID>openInNewTab(0)<cr>"

call s:initVariable("g:NERDTreeMapOpenInTab", "t")

let @h=@h."\" ". g:NERDTreeMapOpenInTab.": open in new tab\n"
share|improve this question

The documentation for NERDTree shows that you can change the mapping letter for most, if not all of the mappings. For example, ":help NERTree-t" shows this:

Default key: t
Map option: NERDTreeMapOpenInTab
Applies to: files and directories.

So you can put in your vimrc something like this to change it from "t" to "\t":

let NERDTreeMapOpenInTab='\t'

Then NERDTree will stop overriding your preferred functinality of the "t" key in normal mode.

share|improve this answer
That worked great ! – Yugal Jindle Nov 19 '13 at 3:24

Hope this helps,

au vimenter * map t k

put this in your vimrc file

share|improve this answer
doh! Tried it, and it didn't work. Thanks though. – btelles Apr 5 '10 at 13:20
I've edited the line. This should work. – asdfg Apr 5 '10 at 13:32
Oh bumcicles....still no dice. – btelles Apr 5 '10 at 13:42
This is working for me. There could be some other mapping. Better change that "t" in NERDTree to something you dont use.. – asdfg Apr 5 '10 at 14:53
Should avoid doing such a global remap to correct for an undesired mapping in a plugin. Most provide methods for handling this in a much better way. – pottsdl Apr 20 '12 at 17:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .