mardi 24 mars 2015

How to toggle between buffer and console in vim?


I find it annoying to constantly press Ctrl-Z and then fg to go between these screens. It also generates unwanted fg lines on my console. I'm pretty sure this can be done, but I can't remember how.


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.


I could have sworn that there was a vi command to allow just looking at the console screen without actually doing anything else and then jumping back to the document. I'd say that it is a pretty basic function.



Aucun commentaire:

Enregistrer un commentaire