This behavior is normal. The Vi editor was originally written on an ADM-3A terminal, which had the Escape key positioned where the Tab key occurs on most cmodern keyboards. You can save your current folds; when you finish editing a file, before exiting vim, enter the command :mkview.When you next open the file, if you enter :loadview, it will restore your folds.If you want this to happen automatically, add this code to your vimrc When the insertion is over you can press the ESC button to come back to the command mode of VI. Vim (Vi IMproved) is feature rich successor of the Vi text editor with multiple enhancement and user friendly. The insertion mode allows to edit and insert text from the file. Then type the letter O to simply save the file and move on. Commands to save changes in vim. Type : (colon) to start command prompt at bottom-left of the editor. To save the changes and exit the vim, press the Esc key then type :wq command. The file will be saved but remains opened in Vi/Vim for more editing or reading. This tip discusses how to exit from insert mode without needing to press Esc. Vim is a very powerful text editor, but it takes some getting used to. Where w means write to the file and q is quit. Once you have the essentials down, like how to save changes to files, you'll find it much more convenient than other default editors. I know the basic command ESC + SHIFT ZZ and another ESC + :wq ENTER but i don't want to quit vim editor.I want to save the file and the file should remain open in vim. Saving the file However, the best way to learn Vim is not only using it for Git commits, but as a regular editor for your everyday work. To exit the vim without saving the changes, press the Esc key then type :q! This tutorial will help you to understand, how to save file on Vi/Vim and exit from editor. Note that pressing L seems to do pretty much the same thing. If you’re in vi or vim and need to get out—with or without saving your changes—here’s how:. If you're not going to switch to Vim, it's nonsense to keep its commands in mind. Just edit your ~/.vimrc file and add the following: The procedure is as follows to save a file in Vim and quit the editor: Start vim by typing vim filename; To insert text press i; Now start editing text. Add new text or delete unwanted text. CTRL-\ CTRL-N does the same. The Quick Answer. How to Save Changes in Vim Now the contents of the terminal window is under control of Vim, the job output is suspended. In that case, go and set up your favourite editor to use with Git. In this part, you will learn, how to save changes in Vim without quiting the editor. Learn, how to save your changes and exit the vim editor. ; Second, type :q! In this guide, we learned how to exit a file in vim with and without saving changes to the file. and press Enter. since the file is still opened as read-only. Let’s go through the first step to learn Vim to save and close file. It's also based on you current path, so if you open Vim from different directories you will have different sessions, which is quite useful when working on different projects. Press Esc key and type :w to save a file in vim. First, press the Esc key a few times. How to Save Changes in Vim. This tutorial will help you to understand, how to save file on Vi/Vim and exit from editor. To Exit and save your file in VI just from command mode type :wq and for only quite the or exit the VI just type :q or :quite and press Enter Key/return key. command. Exit without saving. Each time you exit Vim it will save the current session under ~/.vim/sessions and load it back again once Vim is opened. This will ensure vi is out of Insert mode and in Command mode. (If you do want to save your changes, type :wq instead. This tells vi to quit without saving any changes. Saving and exit. One can press Esc and type :wq to save changes to a file and exit from vim We can now exit normally by typing ESC :q! Any help will be appreciated. Vim's default is not to remember which code you had folded vs. unfolded from one session to the next. Press ESC to switch to command mode. According to vim documentation, there are two ways: CTRL-W N (note it's uppercase N) CTRL-\ CTRL-n; Use CTRL-W N (or 'termwinkey' N) to switch to Terminal-Normal mode.