How to make vi redraw screen?

GitVim

Git Problem Overview


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.

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

Git Solutions


Solution 1 - Git

To force a screen refresh

:redraw!

Solution 2 - Git

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

Solution 3 - Git

In Vi both of these are redraw:

  • ^R ( does not work with VT100 type terminals )
  • ^L ( does not work with Televideo terminals )

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

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSam LiaoView Question on Stackoverflow
Solution 1 - GitHS.View Answer on Stackoverflow
Solution 2 - GitAlex MartelliView Answer on Stackoverflow
Solution 3 - GitTim SylvesterView Answer on Stackoverflow