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?

1
  • I just want to know , how can I achieve ` :map <F4> :Ack -i <D-v> ` after I used command+c copied a word ? I did this map <F5> :Ack -i <D-v>, but it will show :Ack -i <D-v> after I used F5 key. Commented Feb 15, 2015 at 22:55

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

@gsky create a .gvimrc. What do you mean that you don't have macvim?
@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?
sorry,maybe I had a problem description. I just want to know , how can I achieve map <F4> :Ack -i <D-v> after I used command+c copied a word ? I did this map <F5> :Ack -i <D-v>, but it will show :Ack -i <D-v> after I used F5 key.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.