Vim 记录历史 [英] Vim record history

查看:24
本文介绍了Vim 记录历史的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vim 存储我们使用 : 为当前执行应用的命令列表.但是当我关闭 vim 并再次启动它时,vim 命令历史记录丢失了.我在 .vimrc 文件中尝试了 set history = 1000 但这没有帮助.
Vim 在哪里维护本地命令历史?
保留命令历史的命令是什么?

Vim stores the list of commands that we applied using : for the current execution. But when I close vim and start it again, the vim command history is lost. I tried set history = 1000 in the .vimrc file but that did not help.
Where does Vim maintain the local command history?
What is the command to retain command history?

推荐答案

要检查 Vim 是否支持 'viminfo' 文件(存储历史记录),:echo has('viminfo').对应的设置不能为空::set viminfo?:set history?应该大于一.

To check whether Vim supports the 'viminfo' file (which stores the history), :echo has('viminfo'). The corresponding setting must not be empty: :set viminfo?, and :set history? should be greater than one.

如果在写入 viminfo 文件时出现问题(尽管 Vim 应该在这种情况下抱怨),您可以尝试通过 vim -i/tmp/viminfo

If there's a problem writing the viminfo file (though Vim should complain in that case), you could try passing a different location via vim -i /tmp/viminfo

这篇关于Vim 记录历史的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆