Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to “hide” Vim’s interface to see the underlying shell?

Tags:

vim

Something as light as buffer switching. So I can quickly jump there and back to check, for example, the output of the last !-invoked command.

I know there is the :sh command, but then you have to exit it to get back to Vim, so it is a bit heavy for the purpose.

I am also aware of http://vim.wikia.com/wiki/Display_output_of_shell_commands_in_new_window but I am not a huge fan of splits.

like image 544
artemave Avatar asked Aug 03 '11 14:08

artemave


People also ask

How do I find the terminal in Vim?

The terminal can be opened in various ways the most preferred way is by typing in :term from Vim. This will create a horizontal split from the current editor and split it into half. You can change the size of the split using the mouse according to your preference.

Can Vim be used as a terminal?

Mostly you'll use the terminal like any other terminal and just type in shell commands and so on. There's a few optional extras that will help you interact with the rest of Vim. Use ctrl-w N to switch to "terminal-normal mode", which will let you navigate around.

How do I switch between Vim and terminal?

As :help :terminal says, you can always exit to normal mode using <Ctrl-\><Ctrl-N> ( :help CTRL-\_CTRL-N ). Use i to return to terminal interaction. Save this answer.


2 Answers

Try Ctrl-Z, also accessible from the built in command :suspend. Does that do what you want?

like image 130
jw013 Avatar answered Oct 14 '22 18:10

jw013


If you do not mind not having scrolling, use

:!

(That is, run the ! Ex command without arguments.)

Otherwise, if you are running the terminal version of Vim, use :suspend or Ctrl+Z (the latter keyboard shortcut works in Normal and Visual modes).

like image 6
ib. Avatar answered Oct 14 '22 18:10

ib.