Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
1  
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
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.