5

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"

2 Answers 2

13

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

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

So in your vimrc you can put 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.

1
  • That worked great ! Nov 19, 2013 at 3:24
-1

Hope this helps,

au vimenter * map t k

put this in your vimrc file

6
  • doh! Tried it, and it didn't work. Thanks though.
    – btelles
    Apr 5, 2010 at 13:20
  • I've edited the line. This should work.
    – asdfg
    Apr 5, 2010 at 13:32
  • Oh bumcicles....still no dice.
    – btelles
    Apr 5, 2010 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, 2010 at 14:53
  • 6
    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, 2012 at 17:10

You must log in to answer this question.

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