1

I have previously used the Putty terminal in Windows. It does not have mouse scrolling activated within a vim screen, but DOES allow me to scroll "above" the vim window to see previous shell commands/output.

Now I am using gnome terminal. It's behavior is the opposite. It allows mouse scrolling within the vim window, but does not allow me to scroll "above" to see previous shell output. Is there any way to allow me to scroll "up" to see shell output while I have vim open?

shireham
  • 13
  • 2

4 Answers4

1

While not "exactly" like what you describe you can type

:!

that will suspend your vim session and let you scroll back up through your prior output. You can also use :! to execute commands as follows...

:!ls

will run ls in your current directory.

MrBooks
  • 60
  • 8
  • This works nicely. I mapped the command to F2 in my vimrc so all it takes is an extra keystroke to see the shell output. Thanks! – shireham Sep 17 '14 at 20:59
1

You can use <ctrl-z> to suspend vim and return to the shell, where you can scroll up and down all you like.

fg will resume vim, i.e. bring it to the (f)ore(g)round

Brett Y
  • 7,171
  • 1
  • 28
  • 42
0

You can use the :shell command to run the terminal from vim. Then you can scroll up and do all the stuff you want. Use <C-d> to return to vim.

Zach
  • 4,652
  • 18
  • 22
0

you can use the :sh command to switch to the terminal, and type exit on terminal to switch back to vim. you can always see all your shell output on the terminal.

gzh
  • 3,507
  • 2
  • 19
  • 23