Like saving and getting out on VIM?

Asked

Viewed 8,997 times

9

I have a problem (I think it’s a problem) in the text editor of vim.

When I create a file readme.md and then I take command vim readme.md, open the editor and then the problem begins.

When I type something in I don’t know which command to save and exit, to go back to Git bash.

  • vim is very boring to use, you must use "i" to edit, and press the ESC keys : w q ENTER to save and exit https://woliveiras.com.br/posts/Comecando-com-editor-texto-VIM/

  • Po , thank you very much, it worked. I tried to save the sublme as a text editor but I couldn’t, you would know which command or how to do so that the sublime becomes the editor ? Thank you .

  • Related: How to make Ctrl-S save to Vim? - (is not dup, only related)

3 answers

10


To get out of the way you need to use :q in command mode. To save is :w. So to get out and save is :wq.

If you do not know if you are in command mode or insertion mode, you can go "straight" to the command mode using the combination Esc + Esc.

That is to say

Esc + Esc
: + w + q + Enter

  • So I used/wrote this command and hit enter , but it "jumps" line and continues in the editor .

  • @Matheusmacedo I added a paragraph

  • Thank you, it worked.

1

To easily quit git after entering insertion mode esc afterward i and typed your commit message, just press esc again after ZZ capital.

0

:wq    --> Salvar e sair.
:x     --> Salvar e Sair.
:wqa   --> Salva e sai de todos os arquivos que estiverem abertos.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.