更新时间:2022-12-24 10:49:19
使用以下内容创建一个〜/ .vimrc
文件nocompatible模式(实际上只有文件的存在就足够了。)
Create a ~/.vimrc
file with the following contents to put vim in nocompatible mode (actually the mere presence of the file is sufficient.)
set nocompatible
你看到的行为是 vi
的行为。这些不是错误。
The behavior you are seeing is how vi
used to behave. These are not bugs.
查看:h nocompatible
在vim兼容模式下尝试尽可能地模拟vi。
In vim compatible mode tries to emulate vi as closely as possible.
- insert -
不是vi的一部分,因此不会在兼容模式下显示。 ^ [
转义。 ^ [OA
在我的电脑上,它可能是类似的你的。 vim将此视为一个转义(返回正常模式),O(在当前行上面添加一行)和A,它是您在屏幕上看到的A.这只是意味着vim在兼容模式下不能正确解释转义字符。很可能是因为vi没有解释它们(也不是为了使用它们)。--insert--
is not part of vi so it not shown in compatible mode.^[
be escape. ^[OA
is up on my computer its probably something similar on yours. vim sees this as an escape (goes back to normal mode), and O (add a line above the current) and A which is the A you see entered onto your screen. This just means that vim in compatible mode does not interpret the escape characters properly. Most likely because vi did not interpret them (nor was it designed to use them).
set nocompatible
修复问题1和3。
我认为 set backspace = indent ,eol,start
应修复问题2。