The classic question on stackoverflow: how to quit the vim?
:q doesn’t work, try
edit: github’s forums don’t support markdown? And there’s no way by default to format code
- :w - write (save) the file, but don’t exit
- :wq - write (save) and quit
- :q - quit (fails if anything has changed)
- :q! - quit and throw away changes
An alternative is opening another terminal and rebooting, although this is a bit drastic
Don’t forget about ZZ to save and exit.
ZZ is equals to :wq and to :x
:! pkill -f vim
Hey, thanks for asking the question. I often forget how to quit the vim too because I only use it occasionally Unfortunately, this isn’t on-topic for any of our boards right now. Since it was all in good fun, I’m just going to lock the post.
Thanks for participating and welcome to the Forum!