git 如何使vi重绘屏幕?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1117725/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 06:43:30  来源:igfitidea点击:

How to make vi redraw screen?

gitvim

提问by Sam Liao

When I use

当我使用

git commit --amend

It will enter into a vi window to let me input comments for commit, the problem is the vi windows will show some dirty characters from former shell background. So I wonder how can I let vi to reload or redraw the screen to make the screen normal.

它会进入一个 vi 窗口让我输入提交的注释,问题是 vi 窗口会显示一些来自前 shell 背景的脏字符。所以我想知道如何让vi重新加载或重绘屏幕以使屏幕正常。

So far, I try reset terminal and Ctrl+L, it works, but I wonder is there best answer for such situation?

到目前为止,我尝试重置终端和 Ctrl+L,它有效,但我想知道这种情况有最好的答案吗?

回答by HS.

To force a screen refresh

强制刷新屏幕

:redraw!

回答by Alex Martelli

I've been using ctrl+Lfor such purposes for 35 years now, what's wrong with it?

我已经将ctrl+L用于此类目的已有 35 年了,它有什么问题?

回答by Tim Sylvester

In Vi both of these are redraw:

在 Vi 中,这两个都被重绘:

  • ^R ( does not work with VT100 type terminals )
  • ^L ( does not work with Televideo terminals )
  • ^R(不适用于 VT100 型终端)
  • ^L(不适用于电视终端)

From http://www.cs.rit.edu/~cslab/vi.html#A1.4(dead link; see archive)

来自http://www.cs.rit.edu/~cslab/vi.html#A1.4(死链接;见存档

As noted in the comments Vim now uses ^R for redo and ^L alone for redraw.

正如评论中所指出的,Vim 现在使用 ^R 进行重做,单独使用 ^L 进行重绘。