Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm new to vim and I'm trying to map a key combo for running the Ack plugin found here:

I want to map cmd-shift-f to run the Ack command :Ack. I've added the following to ~/.vimrc

nmap <D-F> :Ack<space>

It doesn't work. What am I doing wrong?

I'm using vim 7.3 within iTerm 2 on MacOS X.

share|improve this question

The problem is that within <...> notation mappings, case is (mostly) insensitive, so you have to explicitly state you want to map with the shift key. Try this:

nmap <D-S-F> :Ack<space>
share|improve this answer
That still doesn't work. It's weird because nmap <C-F> :Ack<space> works for <ctrl><shift>-f. But it doesn't work with <cmd> – jordelver Feb 7 '12 at 22:44
Hmm, interesting. nmap <D-F> :Ack<space> does work in MacVim, but not in the terminal. Looks like cmd is not recognised in a terminal. – jordelver Feb 7 '12 at 22:57
And finally, according to this page:… You can only use <cmd> key mappings in a GUI Vim such as MacVim. I've decided to just go with <ctrl>-f for now. – jordelver Feb 7 '12 at 23:17

Or.. you could think about doing it this way:

nmap <D-F> :Ack <space>

You don't need to mention the shift & this still only triggers with a capital F (so although shift isn't mentioned in the binding, you still have to press it).

This works for me at least.

share|improve this answer
Worked for me! My use case: nnoremap <silent> <D-D> <C-w>s – aymericbeaumet Feb 23 at 11:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.