18

I would like to assign operation to a command key in Vim. Aren't any methods?

0

1 Answer 1

27

Supposing you are on a Mac, you can't map the command key in vim when it runs in a terminal emulator, only in the MacVim GUI.

If you are using the MacVim GUI, your mappings should use <D-…> as in nnoremap <D-l> <C-w>l. But it's not a very good idea for many reasons among them those listed in this other answer of mine.

Use <leader>, as in nnoremap <leader>l <C-w>l, instead.

See :help leader and :help key-notation.

2
  • Thank you! It succeeded by <D-...>
    – ANNotunzdY
    Mar 2, 2012 at 10:52
  • 2
    Happy to help, but please consider using something else.
    – romainl
    Mar 2, 2012 at 13:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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