To Quit vim or vi or nvim :

  • Type :q

This will quit vim (If there is no file change).

  • Type :q!

To quit without saving.

  • Type :wq

To save and quit.

                          I just saved your terminal session 🤜🤛