user710818
user710818

Reputation: 24248

How temp. exit from Vi editor and return?

I have waste many time for googling, but didn't find solution. But I have seen this. Which key combination need use? Thanks.

Upvotes: 2

Views: 4026

Answers (4)

Patrick B.
Patrick B.

Reputation: 12383

If you mean a shell by "exit" you can try this command:

:shell

then you a shell and you can get back to Vi by leaving the shell with

exit

or by pressing CTRL-D.

Upvotes: 3

Noufal Ibrahim
Noufal Ibrahim

Reputation: 72795

You can suspend vim if it's in a terminal using Ctrl-Z and then say fg to get it back to the foreground. You can also run a shell using ! /bin/bash and then exit it to return to the editor.

Upvotes: 8

Arthur Reutenauer
Arthur Reutenauer

Reputation: 2630

What I generally use, when calling vi from a shell, is the :shell command to start a new shell, and then Control-D when I’m over (the shell then quits and goes back to the file(s) I was editing with vi).

Upvotes: 2

Richard Pennington
Richard Pennington

Reputation: 19965

Use control-Z. When you want to get back into vi, use fg from the shell prompt.

Upvotes: 5

Related Questions