VIM(运行时)如何将文件内容显示到终端,然后(关闭时)可以取回显示的内容?我已经制作了几个应用程序,我希望在其中实现此功能……例如在制作带有终端图形的程序时,通常在单个“对象”移动时整个屏幕都必须更新。
最佳答案
存储旧缓冲区的是您的终端,而不是 Vim。
如果您使用 XTerm 仿真,Vim 会在启动时切换到“备用”终端屏幕。退出时,Vim 切换回正常屏幕。
启动时的 Terminfo 字符串:
\E7 saves the cursor's position
\E[?47h switches to the alternate screen
退出时的 Terminfo 字符串:
\E[2J clears the screen (assumed to be the alternate screen)
\E[?47l switches back to the normal screen
\E8 restores the cursor's position.
关于vim - vim怎么显示到终端然后取回?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4514473/