0

I am a vim user.

I like to use CLI vim rather than GUI MacVim.

I usually use vim in iTerm2 terminal which has already a lot of shortcuts using Command Key.

I want to map my custom shortcuts but it's impossible because of those already mapped keys.


For example,

I want to map NERDTreeCommenterToggle command to 'Command-/'.

So I wrote in my .vimrc like below.

map <D-/> <Plug>NERDCommenterToggle

But it doesn't work because "D-/" key is already mapped to 'Find Cursor' in iTerm2.

Does anybody know how to fix these problems? Thanks in advance.

breadmj
  • 185
  • 11

1 Answers1

2

No.

It's impossible to map the command key in CLI Vim because the only Vim that supports it is MacVim in its GUI form. Whether iTerm uses up all the Cmd+… shortcuts or not is irrelevant.

You must find other keys, preferably some that work everywhere (CLI, GUI, Mac, Win, Linux).

:h mapleader is a good start.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • Thanks @romainl I will use leader key instead. But can you explain why **ONLY** GUI supports the command key? Or where can I find such information? I can't understand.. – breadmj Apr 04 '13 at 08:38
  • 1
    I'm not part of the Vim dev team so I can't really answer but I have some ideas: 1. The cmd key is available only on Macs. 2. The cmd key may be invisible to command line programs or the library used by Vim to capture input… – romainl Apr 04 '13 at 08:45