How to exit vi/vim?

in programming •  7 years ago  (edited)

You have to press ESC at first - Vim enters command mode. And then type:

:q! to quit without saving (think: quit)
:wq to write and quit (write and quit)

followed by ENTER key.

This was the most searched question on stack overflow.
Source: https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!