1

I'm working with vim + some plugins to code c++.

Sometimes, because of some bug or some executing sequence issue, the command zone will show me two or three lines as below: enter image description here

As you can see, I got two lines in the command zone:

"test.cpp" 62L...
:redraw

How could I clear them so that I can make it into one line as normal? I've tried to execute :redraw but it's not working.

  • @klaus Yes, I did. – Yves Apr 21 at 2:38
  • 2
    Try :redraw! with a bang – D. Ben Knoble Apr 21 at 3:50
  • @D.BenKnoble it works! Maybe make it as an answer? – Yves Apr 21 at 6:16
  • @klaus No, it doesn't help. – Yves Apr 21 at 6:16
  • Yves, I'll leave B Layer the credit for this one. – D. Ben Knoble Apr 22 at 22:29
1

Try Ctrl+L. This clears the screen then redraws it. That's also what :redraw!, mentioned in the comments, does but this is a lot more convenient.

The one caveat is that there can be a difference in timing between the two. Per help (i.e. the first couple entries in :h various-commands), ctrl-l may delay the redraw so Vim can process typeahead input while :redraw! redraws right away. I've not encountered this difference myself and your scenario doesn't seem applicable...but it should be noted. Perhaps you'll be the one that has to resort to :redraw!.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.