Home >Operation and Maintenance >Linux Operation and Maintenance >What is the command to exit vim without saving?
The command to exit vim without saving is: ":q". There are other commands in vim, for example: if you do not save the file, the command to force exit is ":q!"; to save the file, the command to exit is ":wq"; to force save the file, the command to exit is ":wq!" .
The command to exit vim without saving is ":q"
Press the ESC key to jump to the command mode, and then Input:
:w - Save the file without exiting vim
:w file - Save the modifications to file without exiting vim
:w! - Force saving , do not exit vim
:wq -Save the file, exit vim
:wq! -Force to save the file, exit vim
:q -Do not save the file, exit vim
:q! -Do not save the file, force quit vim
:e! -Abandon all changes, start editing from the last time you saved the file
Recommended tutorial: "linuxtutorial》
The above is the detailed content of What is the command to exit vim without saving?. For more information, please follow other related articles on the PHP Chinese website!