How to scroll a console command output in MacVim/GVim?

486 Views Asked by At

When I print to output of a script in VIM I can't scroll up, so I can see only the last lines. For example if this is my script:

for i in range(1000):
    print str(i)+"TEST"

And I run this command:

:w !python -

How can I scroll to see the e.g. 500TEST lines. I've see this question but this doesn't work for mac OSX.

1

There are 1 best solutions below

2
On BEST ANSWER

I don't think MacVim/GVim's pseudo terminal is able of scrolling with the usual scrolling keys. Did you try piping your command into a pager? The following works, here:

:!python % | less -d

(edit)

less has a lot of vi-like commands. Use /foo to search forward, ?foo to search backward, 50G to jump to line 50, <C-f> to page down, $ less +G to jump directly to last line`…

$ man less is a surprisingly good read.