[vim/vim] i_CTRL-K <Esc> (#6329)

13 views
Skip to first unread message

Hans Ginzel

unread,
Jun 24, 2020, 9:18:40 AM6/24/20
to vim/vim, Subscribed

In the documentation there stands "When {char1} is a special key, the code for that key is inserted in <> form."
I have tried Ctrl-K<Escape>, got ?, epected <Esc>. After some timeout the question mark disappeared.
Is there a way how to insert <Esc> another way then typing it?

To Reproduce

  1. In insert mode type CTRL-K
  2. press Escape key
  3. wait

Expected behavior
<Esc> is inserted. Probably after some time because of escape sequences.

Environment (please complete the following information):

  • Vim version 7.4
  • OS: Ubuntu 16.04, Windows 10, WSL2
  • Terminal: wsl tty


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Christian Brabandt

unread,
Jun 24, 2020, 9:59:25 AM6/24/20
to vim/vim, Subscribed

I think you want ctrl v

> Am 24.06.2020 um 15:18 schrieb Hans Ginzel <notifi...@github.com>:
>
> 

K.Takata

unread,
Jun 24, 2020, 11:44:54 PM6/24/20
to vim/vim, Subscribed

I can confirm that when I type Ctrl-K then BackSpace, the string <BS> is literally inserted.
Same for <F1>, <Home>, <C-BS>, <C-CR>, <S-CR>, <S-Tab> etc.
However, some other special keys like <Esc>, <CR>, <Tab>, <C-A> don't work.
I'm not sure what's the difference of them.

Yegappan Lakshmanan

unread,
Jun 24, 2020, 11:50:41 PM6/24/20
to vim_dev, reply+ACY5DGDIU332J64QJW...@reply.github.com, vim/vim, Subscribed
Hi,

On Wed, Jun 24, 2020 at 8:44 PM K.Takata <vim-dev...@256bit.org> wrote:

I can confirm that when I type Ctrl-K then BackSpace, the string <BS> is literally inserted.
Same for <F1>, <Home>, <C-BS>, <C-CR>, <S-CR>, <S-Tab> etc.
However, some other special keys like <Esc>, <CR>, <Tab>, <C-A> don't work.
I'm not sure what's the difference of them.



I think we should add a test for checking all the special keys. This test was recently
added for the built-in terminal (Test_term_keycode_translation() in test_terminal.vim).
Similar to this, we can add a test for the non-terminal window also. 

- Yegappan
 

vim-dev ML

unread,
Jun 24, 2020, 11:50:57 PM6/24/20
to vim/vim, vim-dev ML, Your activity

Shane-XB-Qian

unread,
Jun 25, 2020, 4:48:52 AM6/25/20
to vim/vim, vim-dev ML, Comment

<Home>
<End>
<Insert>
<Del>
<PageUp>
<PageDown>
<BS>
<F10>
<F2>
<F12>
<F1>

but F11 ok at xterm -vs- not always ok at others.


You are receiving this because you commented.

Tony Mechelynck

unread,
Jun 25, 2020, 5:41:43 AM6/25/20
to vim/vim, vim-dev ML, Comment

IIUC there is a collision or ambiguity with the general meaning of <Esc> which is "I've changed my mind and want to abort what I was doing".

<Ctrl-V><Esc> will give you ^[ which is a real Escape character. AFAIK the easiest way (and possibly the only one) to get <Esc> in <> notation is to type it in ASCII: less-than, upper-E-for-Echo, lower-S-for-Sierra, lower-C-for-Charlie, greater-than.

Best regards,
Tony.


You are receiving this because you commented.

Reply all
Reply to author
Forward
0 new messages