I find it annoying to constantly press Ctrl-Z
and then fg
to go between these screens (where command terminal is the command line that you used to invoke vim
from). It also generates unwanted fg
lines on my console. I'm pretty sure this can be done as I remember doing it when I was in university, but I can't remember how.
Information on Terminals and its Relation to vim
vt100 terminal and others have a way to save the screen prior to changing it and then it could restore it when it wants to. vim
does this and can be seen if you go into vim
and then shell or Ctrl-Z
out. Most of the time it will show you what you had on the screen prior to entering vim
by saving the screen prior to painting the vim
screen. If your terminal doesn't support this functionality, it will just put the command line directly under the vim
screen, scrolling it up. This can be seen by exporting to the TERM variable a less functional terminal emulation or clearing it (though by clearing it, it may put vim
into line mode or may use the most basic of terminal codes depending on its implementation). To see more on saving/restoring a screen, see Terminal codes (ANSI/VT100) introduction, under the heading Save/restore screen.
HISTIGNORE
tofg:bg
be enough? (It would prevent these two commands from ending in your history, assuming bash.) Or is there something more that you find irritating?less
, use. I have no idea, though, how to flip between them by keyboard command. Since I normally work with the gnome desktop, I useevim
(because I'm avim
newbie but a GUI person since the late 80's), which, as another answer points out, works around the problem.:silent !sleep 999999
. This will show your saved screen until you type Control-C, and (because of the :silent command) it won't print anyPress ENTER to continue
messages on the saved screen. A^C
will be printed, though.