1

I'm confused with these mappings:

map <c-c>
map <C-C>
map <c-C>
map <C-c>

Are they different ? Which is the correct way to write this mapping ?

Same question with:

map <s-Tab>
map <S-TAB>
map <s-tab>
nowox
  • 25,978
  • 39
  • 143
  • 293

2 Answers2

6

<C-c>, <c-c>, <c-C> and <C-C> are strictly equivalent but…

  1. Read :help key-notation.

  2. Always use the notation you see in the first column.

  3. ?

  4. Profit.

romainl
  • 186,200
  • 21
  • 280
  • 313
3

In general, the case doesn't matter. When you define

:map <c-c> foo

and then list via

:map <c-c>
<C-C>   foo

it shows the uppercase version. So, the modifiers (C for Ctrl, etc.) are case-insensitive. For the keys, you usually use the S modifier (as in <C-S-c>) for shifted keys; however, as a special case, for the <A-...> keys, the uppercase key is different from the lowercase one, i.e. <A-S-c> == <A-C>.

I recommend to adhere to the format used at :help key-notation.

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324