I am using vim to compile my code using the command :w | !make
.
If this output produces a lot of compiler errors (not uncommon lol), then I'd like to scroll to the top of the output, where the command was executed, so that I can handle the first error first.
My terminal has a 'scroll to last command' feature, but of course the last actual command that the terminal is aware of is >vim ...
, so this feature doesn't take me to the top of the last command executed from vim - it takes me to the the top of all the output from vim since i started the session.
Is there a way to scroll my terminal to the last external command? I'm imagining something like w | !make | <scroll-to-last-command>
.
:h :make
instead.!
, the scroll in question pertains to an external terminal and not to Vim, making this off-topic. Inside Vim using:terminal
, you could backwards-search for the prompt (interactive programs, like the shell) or usegg
(batch programs). I'm inclined to let this stand, though, since Matt hints at an answer around using built-in facilities which might "redeem" the question.