0

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>.

2
  • 1
    Do not make "!make". Make yourself to see :h :make instead. Commented Sep 2, 2022 at 10:35
  • Since you're using !, 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 use gg (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. Commented Sep 2, 2022 at 14:21

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.