


:e! reads the original file back in so that you can start over. To do this, you can choose from the following two commands: Sometimes, when you create a mess (when you first start using vi this is easy to do!) you may wish to erase all edits made to the file and either start over or quit. :wq to quit and save edits (basically the same as ZZ). :q to quit if you haven't made any edits. Press : ( colon) to open the prompt bar in the bottom left corner of the window. Switch to command mode by pressing the Esc key. Vim was made available in 1991 and is a free, open source software. :w to save your file but not quit vi (this is good to do periodically in Vim Save and Quit Command To save a file and exit Vim, do the following: 1.
#QUIT VIM HOW TO#
Note that you can also use the following commands: This book does not cover anything except how to exit Vim. The command ZZ (notice that it is in uppercase) will allow you to quit vi and save the edits made to a file. The following sections describe methods you might use when closing a file, quitting vi, or both. This will quit the editor, and all changes you have made to the document will be lost.Ĭlosing and Saving Files When you edit a file in vi, you are actually editing a copy of the file rather than the original. Search my vimrc here to see my hotkeys for saving/closing. void-pointer at 2:01 Proper typing involves moving the hands/arms, not stretching the fingers. vimrc file you can have hotkeys to hit like Ctrl+s to save. 2 You should not be using Esc to exit insert mode, as the Esc key is far from the others on modern keyboards. The cursor should reappear at the lower left corner of the screen beside a colon prompt. The only two ways I close vim is done with either: :q :wq If you setup a. If you are currently in insert or append mode, press Esc. Cheat-sheet-for-VIM To quit the vi editor without saving any changes you've made:
