On Fri, 27 May 2011 15:32:06 +0200, Tony Mechelynck 
<[email protected]> wrote:

>
>1. For non-printable keys outside the ASCII or Unicode "universe", how 
>they are represented is at the mercy of the keyboard driver and terminal.
>
>2. For historical reasons, on many terminals, the backspace key does not 
>send a backspace code, nor does the delete key send a delete code. See, 
>among others, :help :fixdel

And indeed this is the case on my machine. But I know that on my terminal
'Backspace' sends ascii code 127 (I know it because 'showkey' tells me that), 
which is <Del> special key. Why then vim mistakenly recognizes it as <BS> key, 
which is ascii code 8?

>3. Ctrl-K (in Insert mode) is overloaded: when followed by _two_ ASCII 
>or Unicode keys, which may be control characters but the latter facility 
>is rarely used, it ushers in a digraph (q.v.); when followed by one 
>non-Unicode "special key", it inseers that key's <> notation. Ctrl-K 
>Ctrl-H is still waiting for the second half of the digraph (we're in the 
>former case); only then will it look up in its table to see that there 
>is no defined digraph for that key pair. You could see this by looking 
>at the bottom right of the screen with 'showcmd' true

This is incorrect. Quoting from the documentation:

----------------------------------------------------
If a digraph with {char1}{char2} does not exist, Vim searches for a digraph
{char2}{char1}.  This helps when you don't remember which character comes
first.

Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim
enters the code for that special key.  This is not a digraph.
----------------------------------------------------

It means that when vim recognizes {char1} as a special key, it knows that
it is not a digraph and does not wait for {char2} (at least this is what 
supposed to happen). It means that if after <ctrl-k> <ctrl-h> vim still
waits for {char2}, then <ctrl-h> was not recognized as a special key, which
is the problem I am talking about.

>5. All this means that the sentence "insert the key name by pressing 
>CTRL-K and then the key you want the name for" is misleading for 
>printing or control keys, including some of those listed under ":help 
>keycodes".

According to what I have written above, the sentence is correct for control
keys. I agree that it is misleading for printable charaters.

P.S.: I checked and found that there is no digraph '<2' or '2<'. 
Therefore, '<ctrl-k><2' should print '<lt>2', since after you type 2 vim
should understand that neither '<2' not '2<' is a digraph, and print name
of special character and the additional redundant char '2'. 
Instead, it just prints 2.

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui