如何在 vim 中映射 Pause/Break-Key

如何在 vim 中映射 Pause/Break-Key

在我的 vim 环境中搜索未使用的键时,我找到了该Pause/Break键。是否可以在 vim 中映射此键?

操作系统 (Ubuntu/Mate) 似乎无法捕获密钥。测试xev显​​示密钥的代码如下:

KeyPress event, serial 28, synthetic NO, window 0x5e00001,
root 0xca, subw 0x803726, time 140830591, (148,44), root:(2939,505),
state 0x0, keycode 127 (keysym 0xff13, Pause), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

但是用 测试:noremap <Char-127> :help Char<CR>不起作用。如果无法映射键,有没有办法找出哪些键可以在 vim 中映射?

答案1

Ctrl+输入 后V按下键。Pausenoremap

在我的系统上,该Pause键映射到八进制代码 035(十进制 29),因此:noremap <Char-035> k映射Pause到该k键。

请参阅下面的 Vim 帮助:

There are three ways to map a special key:
1. The Vi-compatible method: Map the key code.  Often this is a sequence that
   starts with <Esc>.  To enter a mapping like this you type ":map " and then
   you have to type CTRL-V before hitting the function key.  Note that when
   the key code for the key is in the termcap (the t_ options), it will
   automatically be translated into the internal code and become the second
   way of mapping (unless the 'k' flag is included in 'cpoptions').

相关内容