I normally navigate my filesystem with a file manager, so that I don't issue vim file directly, but rather configure the file manager to spawn a terminal emulator with Vim,

xterm -maximized -e vim file

The problem is that many times the terminal does not display the file correctly. Each individual line is displayed properly, but some are out of order, some are missing and they are updated as the cursor moves. [A GIF showing the behavior].

None of CtrlL, :redraw or :redraw! solve the problem. The issue is not specific to XTerm, I also reproduced it in Terminator and Xfce Terminal. Also I use no plugins whatsoever. So I have written this question to share what solved it.


resize is the command which solves the problem. That is not Vim's, but X11's resize.

So I just added this to ~/.vimrc

silent !resize

to get the command automatically issued on Vim start.

If you do not want to see the command's output after quitting Vim,

silent !resize > /dev/null

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.