Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you make vi "advance" the screen when opened?

I often work in vi, suspend vi, run something on the cli, and then fg back into vi to work on the results. For instance, fixing errors that showed up when I ran the cli command.

However, when I fg vi, vi "wipes" the current terminal buffer and I can't see the "last screenful" of terminal output in the scrollback buffer.

Is there some setting in vi (or screen, I use screen) which would help me here?

I have searched google for a long time with no answers. I also realize that there are other workflows that solve this problem, but they aren't perfect (run from inside vi means no shell completion, etc).

like image 325
apinstein Avatar asked Dec 14 '22 05:12

apinstein


1 Answers

If you're using screen, then surely it would make sense to do your editing in one window, and your compiles in the other, and then just use the ^A[n] sequences to flip between your terminal output and code screens?

like image 143
Alnitak Avatar answered Jan 15 '23 21:01

Alnitak