> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Save and Exit Vim
- URL: https://linuxhandbook.com/vim-save-exit/
- Published: 2024-05-03T11:38:00.000Z
- Updated: 2025-08-22T17:28:11.000Z
- Description: Learn how to save your changes in Vim. Also learn how to discard the changes and quit Vim.
- Author: Abhishek Prakash
- Tags: Vim Tips, #docs-col, #group-getting-started

Before you see anything else, you should know how to exit Vim, either with saving your changes or discarding them. 

**To save or exit Vim, you must enter the command mode first by pressing Esc key.** 

And then you can use the following options:

- :w – Save the changes but don’t exit
- :wq – Save and quit
- :q – Just Quit (if you have unsaved changes, you’ll see this warning: E37: No write since last change (add ! to override))
- :q! – Force quit (it will discard any unsaved changes)

That's it. Now that you know how to quit the Vim editor, you can see some editing tips.