1

I use mac , and I want to configurate .vimrc , for example: :map <C-a> p means ctrl-a -> p

now , I want to do this using command key on mac keyboard, how can I do this? I tried :map <D-a> p , but I failed . whick word represent command key?

gsky
  • 193
  • 1
  • 10
  • I just want to know , how can I achieve ` :map :Ack -i ` after I used command+c copied a word ? I did this `map :Ack -i `, but it will show `:Ack -i ` after I used F5 key. – gsky Feb 15 '15 at 22:55

1 Answers1

1

The mapping should work. Unless macvim has already mapped that key to a menu. You first need to unmap it from the menu by adding something like the following into your .gvimrc NOT .vimrc.

macmenu Edit.Select\ All key=<nop>

to unmap <D-A> from Select All.

After that nnoremap <D-a> p will map <D-a> to p.

FDinoff
  • 30,689
  • 5
  • 75
  • 96
  • @gsky create a `.gvimrc`. What do you mean that you don't have macvim? – FDinoff Feb 15 '15 at 22:40
  • @gsky I'm confused. The only way to use the command key is to use macvim. Terminal vim does not know how to interpret the command key. If you aren't using macvim why is the question tagged macvim? – FDinoff Feb 15 '15 at 22:46
  • sorry,maybe I had a problem description. I just want to know , how can I achieve `map :Ack -i ` after I used command+c copied a word ? I did this `map :Ack -i `, but it will show `:Ack -i ` after I used F5 key. – gsky Feb 15 '15 at 22:59