How to exit from vim

In this article, you will learn how to exit from vim. It is the most googled question. Vim is a free and open-source, screen-based text…

The post How to exit from vim appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Deven

In this article, you will learn how to exit from vim. It is the most googled question.

Vim is a free and open-source, screen-based text editor program for Unix. It is an upgrade version of Bill Joy’s Vi. If you like free and open-source software, then this would be one of the first choices you would consider to start using Vim.

You can install Vim easily in any operating system but in Linux distribution with official software repositories as follow:

# apt-get install vim [On Debian/Ubuntu]
# yum install vim [On RHEL/CentOS]
# dnf install vim [Fedora 22+]

Vim is a neat and clean document. You can fill most of your answers to your question in its help system. Just using the :help command.

It’s also normally very fast and lightweight even when editing huge files of source code. It’s easy to run over ssh for remote operations on any server.

Get started with Vim. Simply type the commands in the terminal, then press i to switch to insert mode(insert text)

$ vim file.txt
OR
$ vi file.txt

There are various ways to exit vim editor. These are following :

  1. To exit Vi/Vim, use the **:q** command and hit **[Enter]**.
  2. To save a file and exit Vi/Vim simultaneously, use the **:wq** command and hit **[Enter]** or **:x** command.

Note: If you make changes to a file but try to quite Vi/Vim using **ESC** and **q** key, you’ll receive an error as shown in the screenshot below.

  1. To force this action, use **ESC** and:q!.

/media/insert-embed/dropbox

  1. Additionally, you can use shortcut methods. Press the **[Esc]** key and type **Shift + Z Z** to save and exit or type **Shift+ Z Q** to exit without saving the changes made to the file.

This is all about vim exit.

The post How to exit from vim appeared first on CodeSource.io.


This content originally appeared on CodeSource.io and was authored by Deven


Print Share Comment Cite Upload Translate Updates
APA

Deven | Sciencx (2021-10-14T16:52:29+00:00) How to exit from vim. Retrieved from https://www.scien.cx/2021/10/14/how-to-exit-from-vim/

MLA
" » How to exit from vim." Deven | Sciencx - Thursday October 14, 2021, https://www.scien.cx/2021/10/14/how-to-exit-from-vim/
HARVARD
Deven | Sciencx Thursday October 14, 2021 » How to exit from vim., viewed ,<https://www.scien.cx/2021/10/14/how-to-exit-from-vim/>
VANCOUVER
Deven | Sciencx - » How to exit from vim. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/14/how-to-exit-from-vim/
CHICAGO
" » How to exit from vim." Deven | Sciencx - Accessed . https://www.scien.cx/2021/10/14/how-to-exit-from-vim/
IEEE
" » How to exit from vim." Deven | Sciencx [Online]. Available: https://www.scien.cx/2021/10/14/how-to-exit-from-vim/. [Accessed: ]
rf:citation
» How to exit from vim | Deven | Sciencx | https://www.scien.cx/2021/10/14/how-to-exit-from-vim/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.