1

Today I'm trying to do some nnoremap in vim.

Some keys have special meanings in this map, such as C for Control

I read these official two docs, and didn't find the representation map. http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-Tutorial(Part_1) http://vimdoc.sourceforge.net/htmldoc/map.html#map-which-keys

I tried find all these representations, but I can't, maybe it's something like common sense?

But it's always these hidden common sense which hindered lots of beginners.

So far I find only some of the special keys can be the initial keys.

For example: I can do <C-J> but not <SPACE-J> as {lhs}.

And it seems only special keys can be used in sequence greater than 2.

Like I can do <C-A-J> but not <C-K-J>

What are all the representations of these special keys, and what hidden rules are unknown for me to use sequences greater than 2? Is it able to use a special key + 2 normal key?

ps: So far I only know:

`C` for `Control`
`A` for `Alt`
`S` for `Shift`

But it seems there are B, M, D, etc. What are they?

Zen
  • 4,381
  • 5
  • 29
  • 56
  • 1
    possible duplicate of [vim key mapping reference](http://stackoverflow.com/questions/3803027/vim-key-mapping-reference) – glts Oct 11 '14 at 08:38

1 Answers1

5

Yes of course, there is such a resource, see :help key-notation.

Vim has slightly different capabilities in this regard depending on the platform and environment as well as a notoriously archaic key-handling mechanism so you are relatively limited.

For portability purpose, it is recommended to stick with universally usable mappings as much as possible. Mappings to avoid are (from the top of my head):

  • anything that involves the Alt key
  • anything that involves the Cmd key (works only in the GUI incarnation of MacVim)
  • anything that involves a modifier and an uppercase character
romainl
  • 186,200
  • 21
  • 280
  • 313