4

From :h g<:

The g< command can be used to see the last page of previous command output. This is especially useful if you accidentally typed <Space> at the hit-enter prompt. You are then back at the hit-enter prompt and can then scroll further back. Note: If the output has been stopped with q at the more prompt, it will only be displayed up to this point. The previous command output is cleared when another command produces output. The g< output is not redirected.

To test the g< command, I've started Vim with no configuration:

$ vim -Nu NONE

Then, I've tried to execute a command producing a long output:

:args $VIMRUNTIME/**/*.vim
:args

These commands populate the global arglist with all the .vim files in $VIMRUNTIME, and display its contents in Vim's internal pager.

  • I've scrolled the output down to the bottom by keeping pressing <space>.
  • I've pressed Enter to leave the pager, and get back to the buffer.
  • I've pressed g< which re-displays the last page of the pager.

According to the last excerpt from the help you can scroll back after pressing g<.
And according to :h hit-enter, you can scroll back by pressing k, Up, u, b, or g, on the condition that 'compatible' is reset and 'more' is set:

-> Press 'k', <Up>, 'u', 'b' or 'g' to scroll back in the messages. This works the same way as at the |more-prompt|. Only works when 'compatible' is off and 'more' is on.

But on my machine (Linux, Vim 8.0.1747), pressing any of these keys doesn't scroll back, even though 'compatible' is reset and 'more' is set.

How to scroll back in the output of the last Ex command after pressing g<?

  • 2
    Same behavior for me on multiple systems. I'd guess it's either a bug or the last line of the help that you refer to ("scroll further back") shouldn't have been added and the first sentence is meant to be taken literally: "...can be used to see the last page of...output". The latter would make sense in light of the particular scenario mentioned by the help (accidentally hitting space after reaching the last page). – B Layer Apr 24 '18 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.