gpt4 book ai didi

vim - 在 Vim 中修复退格键

转载 作者:行者123 更新时间:2023-12-04 02:41:41 25 4
gpt4 key购买 nike

我在 Vim 中的退格键有问题,它正在插入 ^?而不是删除字符。我发现了 Vim documentation 的神奇之处这有望解决这个问题。

        If the backspace key terminal code is wrong you can
use this:
:if &term == "termname"
: set t_kb=^V<BS>
: fixdel
:endif
Where "^V" is CTRL-V and "<BS>" is the backspace key
(don't type four characters!). Replace "termname"
with your terminal name.

我正尝试按照网站的建议将这段代码添加到我的 .vimrc 中,但我怎么知道我的“终端名称”是什么?

最佳答案

当您在 Vimscript 中看到 &something 时,something 代表 Vim 的一个选项(用 :set); &something 是指something 的当前值或设置。您可以使用 echo(或 echom)获取给定选项的当前设置。所以在这种情况下,您可以通过启动 Vim 并运行

来获取终端名称 — 在该代码中称为 &term
:echom &term

然后您可以用结果替换代码中的 termname

(您也可以为此使用 :set,事实证明,通过将 ? 附加到选项;运行

:set term?

将打印出 term 的当前设置,例如term=xterm-color.)

关于vim - 在 Vim 中修复退格键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19781127/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com