When you are using the VIM editor on Linux and you would like to exit, you just need to follow the tips below. First press the Esc key in order to access the Normal mode. Now to access the Command-line mode, you can just type in : .
You will then notice a colon (:) that pops up at the bottom of your current screen session. This will allow you to execute one of the following most used commands using the Enter key :
- :q (short for :quit) : used to quit
- :q! (short for :quit!) : used to quit without saving the content (vim quit without saving)
- :wq: used to write and quit (Vim save and quit)
- :wq! : used to write and then quit even if the file has only the read permission
- : x : used to write and then quit (looks similar to :wq, but writes in case of changes)
- :exit : (similar to :x) used to write and then exit
- :qa : (short for :quitall) used to quit all
You can also check the help documentation of Vim using the :help command to find out more about Vim editor commands.
Answer due to : dirvine
If you like the content, we would appreciate your support by buying us a coffee. Thank you so much for your visit and support.