如何重置 VI 的默认值?
我目前正在远程主机上使用 VI,由于某种原因,许多命令映射不正确。例如,当按小写 x 时,它不是删除光标下的字符,而是实际上删除光标前两个空格的字符,因此如果输入以下文本 BOTY我将光标放在 T 上,而不是删除 T,O 将被删除,生成单词 BTY。另外,在插入文本时,VI 不会在光标下插入字符,而是会在光标前输入两个空格的字符,因此如果我有以下文本 HT 并且我想插入 ML< /em> VI 将写入 HMLT,而不是 HTML。
有谁知道是什么原因导致此问题以及如何修复它或如何将 VI 中的所有设置重置为默认值,因为这可能不是唯一错误映射的项目?
谢谢
I am currently using VI on a remote host and for some reason a number of the commands are mapped incorrectly. For example when pressing lower case x, instead of it deleting the character under the cursor it actually deletes the character two spaces before the cursor, so if the following text is entered BOTY and I have the cursor over the T instead of removing T the O will be removed making the word BTY. Also when inserting text, instead of VI inserting the character under the cursor it will enter the the character two spaces before the cursor so if I have the following text HT and I want to insert ML instead of writing HTML VI will write HMLT.
Does anyone know what would be causing this and how I can fix it or how to reset all settings in VI to default because this is probably not the only items mapped incorrectly?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只想将所有内容重置为默认值,非常简单,只需 :set all&
If you just want to reset all things to default, it's very simple, just :set all&
在您的家中,查看名为 .exrc(对于 vim 为 .vimrc)的文件。其中包含vi配置,如果清除它(之前做好备份),vi将恢复默认配置。
In your home, look at a file called .exrc (.vimrc for vim). It contains vi configuration, if you clear it (make a backup before), vi will return to default configuration.
看起来您正在使用经典的“VI”而不是“VIM(VI IMproved)”。如果您是机器上的 root 尝试安装 VIM。每次安装全新操作系统后,我都会在 Ubuntu 上遇到这种情况。
This looks like you are using the classic "VI" instead of "VIM (VI IMproved)". If you are root on the machine try installing VIM. I experience this behaviour on Ubuntu every time after a fresh os install.