1

I want to mimic the behavior of Textmate drawer for the MacVim. In textmate, the drawer can toggle with Cmd+Option+Ctrl+d

I want the same with Macvim with NerdTree plugin. So, I tried the following:

nnoremap <D-C-M-d> :NERDTreeToggle<cr>

But it did not work!

ain
  • 22,394
  • 3
  • 54
  • 74
millisami
  • 9,931
  • 15
  • 70
  • 112

3 Answers3

2

As kejadlen wrote, it won't work because of a MacVim bug/limitation.

The cool thing is that it prevents you from doing something wrong: Vim is not TextMate, it's a lot smarter and more powerful and forcing it into being a simple TextMate alternative is going to hide its real power.

Instead of mimicking TM's shortcuts you should use mapleader:

nnoremap <leader>d :NERDTreeToggle<cr>

mapleader is \ by default, you can use another key if you want, i use ,:

let mapleader=","

mapleader is great because it allows you to define your own shortcuts using the whole alphabet without dodging your system's default and without forcing you to do crazy chords with your left hand.

:help mapleader
romainl
  • 186,200
  • 21
  • 280
  • 313
1

Dupe of stackoverflow.com/questions/4982246/vim-multiple-meta-keys. Short answer - apparently a bug in MacVim? (code.google.com/p/macvim/issues/detail?id=317)

Community
  • 1
  • 1
kejadlen
  • 1,519
  • 1
  • 10
  • 10
0

I can't say for sure because I don't use MacVim but have you tried:

:set macmeta

As far as I know you have to set this option to use the apple key.

lucapette
  • 20,564
  • 6
  • 65
  • 59