is ready to exit vim without any editing processing You can use this command. vim does not allow users to use " :q "command exits with the following warning message:
no write since last change (: quit! overrides)
Command |
Simple description |
: W |
Saves the edited file content, but does not exit the vim Editor. The purpose of this command is to write the data in the memory buffer into the file specified when Vim is started. |
: w! |
Force the file to be written, that is, to overwrite the original file. This command can be used to force writes if the original file's access permission does not allow writing to the file, for example, if the original file is a read-only file. However, this command usage applies only if the user is the owner of the file, and the superuser is not restricted. |
:wq |
after saving the contents of the file, exit vim Editor. The purpose of this command is to write the data in the memory buffer to the file specified when you start vim , and then exit . Span style= "Font-family:times New Roman;" >vim the editor. Another alternative is to use the zz command. |
:wq! |
forces the file contents to be saved and exits vim Editor. The purpose of this command is to force the data in the memory buffer to be written to the file specified at the start of vim , and then exit . Span style= "Font-family:times New Roman;" >vim the editor. |
zz |
use zz command, if the file has already been edited and processed, Writes the data in the memory buffer to the file specified when you start vim the editor. Otherwise, just exit zz command is preceded by a colon ":" and no need to press enter key. |
:q | TD Width= "465" >
: q! |
Forces the vim editor to quit and discard the results of the editing process. If you do not need to save the modified file content, you can enter ": q! command to forcibly exit the vim Editor. |
: w filename |
Writes the result of the edit process to the specified file and saves it |
: w! filename |
The result of editing is forced to be saved to the specified file, overwriting the existing file if the file already exists. |
: wq! filename |
Forces the edited result to be saved to the specified file, overwriting the existing file if the file already exists, and exiting the vim Editor. |
Vim File Operation command