Save file and exit command of vim

vim save file and exit command


collates VIM save and exit commands as follows:

1

3

4

5 6 ZZ8 vim9 9 0 vim1 editor 1 1 1 1 3

4 5 6 ZZ7 9 9 0 vim1 editor 0 Vim . Note that the ZZ command does not need to be preceded by a colon “:” or press the Enter key.

command

simple description

: w

save the edited content of the files, but don’t quit vim editor. The purpose of this command is to write the data from the memory buffer to the file specified when you start vim.

:w!

forced write files, or forced to cover the original file. You can use this command to force a write if the original file has access that does not allow writing to the file, for example, if the original file is read-only. However, this command usage applies only if the user is the owner of the file, not to the superuser.

: wq

to save the file content after exit vim editor. The purpose of this command is to write the data from the memory buffer to the file specified when you start vim, and then exit the vim editor. Another alternative is to use the ZZ command.

:wq!

exit after being forced to save the file content vim editor. The purpose of this command is to force the data from the memory buffer to the file specified when you start vim, and then exit the vim editor. ZZ1

: q

without doing any editing process and ready to quit vim , you can use this command.

No write since last change (:quit! overrides)

:q!

require a vim editor, give up the result of the editing process. If you really don’t need to save the contents of the modified file, type :q! “command, forced to exit vim editor.

: w filename

writes the editor after processing the results of the specified file save

: w! filename

0 compulsorily saves the edited result to the specified file, overwriting the existing file if the file already exists.

:wq! filename

0.


Read More: