15

I've mapped <C-,> as well as some other special keys (<C-Enter>, <C-S-Space>, ...) in my vimrc like,

:set  <F13>=^[[44;5u
:map  <F13> <C-,>
:map! <F13> <C-,>

and configured iTerm to send ^[[44;5u when <C-,> is typed.

(Note that ^[ is the ascii Escape character.)

It works great, but Vim flashes <80>ü^D, in the showcmd area whenever I use <C-,>. Here's a screenshot (see the bottom-right corner):

enter image description here

It doesn't inhibit the mapping or seem to cause any problems, I'm just curious what it indicates. None of my other special mappings (<C-Enter> and the like) do this.

Do you know?

4
  • In gvim, whenever you enter a command, it will be shown at the bottom right corner until the operation is completed. Say if you type 1800dd, until you type the last d, 1800d is shown. It might be like that feature.
    – SibiCoder
    Commented Jun 13, 2016 at 11:08
  • 7
    It looks like <80>ü^D, is simply the way ^[[44;5u is internally represented in Vim, but I can't really track down why from the source code. Commented Nov 17, 2016 at 6:21
  • 3
    @Carpetsmoker that is correct. Commented Nov 17, 2016 at 8:44
  • In insert mode, try this: Hit <C-V> and then <C-,> this will insert the sequence of keys Vim tracked from Shell. Note <C-K> is same as <C-V>.
    – Mamrezo
    Commented Oct 22, 2020 at 18:36

1 Answer 1

1

<80>ü^D, is how Vim displays its four-byte internal representation of <C-,>:

First byte: <80>

This is how Vim displays the byte 0x80. This value is K_SPECIAL. It is the first byte of a "special" keycode, and it is always followed by two bytes.

Second byte: ü

This is how Vim displays the byte 0xFC (the Unicode character U+00FC is LATIN SMALL LETTER U WITH DIAERESIS).

0xFC (or 252 in decimal) is KS_MODIFIER, and it means that the third byte will be a bitmask specifying which modifier was pressed.

Third byte: ^D

This is how Vim displays CTRL-D, the byte 0x04. In this context, 0x04 is MOD_MASK_CTRL.

Bytes 1–3: <80>ü^D

So, putting these together, we see that <80>ü^D means <C-

Fourth byte: ,

This one is simpler to figure out. It means ,.

In combination

So the four bytes <80>ü^D, means <C-,>, which is what you entered (via the mapping), and Vim helpfully displays this in the 'showcmd' area, as you requested!

Your Answer

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

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