我刚刚在我的新计算机上安装了 Arch,我不知道我需要添加什么命令到 .vimrc 以便它在退出时恢复 shell 内容(在调用 vim 之前)。
也就是说,我希望我的 shell 看起来像这样:
# whoami
root
# who
root tty1 2011-12-11 16:42
# vim somefile.txt
#
但它看起来像这样:
1 hello
2 how is it going?
~
~
~
~
~
~
~
~
#
最佳答案
实际上,它不能这样做,除非您的终端支持备用屏幕。对于那些(xterm,gnome-terminal),我相信,vim
自动执行(相关选项是 restorescreen
)。
关于vim 在退出时恢复 shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8496602/