通过PuTTY在Vi(Vim)中使用numpad

时间:2011-09-01 18:45:42

标签: vim putty

通过PuTTY使用Vim时,数字键盘无法正常工作。而不是我得到的数字

y
x
w
v
u
t
s
r
q

5 个答案:

答案 0 :(得分:178)

答案在 Numpad in PuTTY while using vi [Cialug]

  

在配置中,转到终端 - >功能并选中“禁用”   应用程序键盘模式“。保存设置并享受数字键盘   这有效!

答案 1 :(得分:16)

我一直使用这组映射将转义序列解释为$TERM=xterm

时的数字
imap <Esc>Oq 1
imap <Esc>Or 2
imap <Esc>Os 3
imap <Esc>Ot 4
imap <Esc>Ou 5
imap <Esc>Ov 6
imap <Esc>Ow 7
imap <Esc>Ox 8
imap <Esc>Oy 9
imap <Esc>Op 0
imap <Esc>On .
imap <Esc>OR *
imap <Esc>OQ /
imap <Esc>Ol +
imap <Esc>OS -

我认为this was my original source.

答案 2 :(得分:13)

对于Mac,答案是HaPsantran在此same页面上的评论,nfechner的答案与this answer中的德语截图相似。< / p>

对于Mac,请转到终端应用程序。选择偏好设置配置文件高级,然后取消选择允许VT100应用程序键盘模式

enter image description here

答案 3 :(得分:4)

如果通过终端使用SSH,您可以转到

Edit -> Num Lock (third from bottom)

它的左侧需要有一个复选标记。

答案 4 :(得分:1)

之前的答案by kirbymichael-berkowskiand pykler非常棒。

我在macOS的终端上的Vim中遇到过这个问题。检查终端首选项配置文件键盘显示“Clear(Keypad)”已映射到“Num Lock”。按清除为我解决了问题。