Vim shell commands

What is the best approach to using shell commands from vim? I know about the possibility !shell_command . But this does not know all the commands, for example. export OSTYPE; make install export OSTYPE; make install So I have to run it outside of vim. Is there a better approach?

+5
source share
2 answers

You can start a shell from Vim with the command :sh . When the shell exits (after the exit or Ctrl + D exit ) you return to Vim. The name of the shell command comes from the shell option.

For a Vim terminal (on Unix-like systems), you can also use Ctrl + Z to pause Vim and return to the shell from which it was launched. To resume the Vim process, use the fg command.

+6
source

I know this is a bit late, but my preferred approach pauses the vim process (Ctrl + z). You will be returned to the / bash shell command line.

Then execute any command (s) that you like.

Go back to vim by typing fg

+27
source

All Articles