What is Vi Editor

Vi Editor is a widely used text editor in Unix/Linux systems and is known for its efficiency and flexibility. Vi editor was developed in 1976 by Bill Joy and later in 1991, an improved version of Vi editor was released which is known as VI Improved (VIM).

Modes in Vi Editor

There are two modes in Vi Editor:

  1. Insert Mode: In this mode, you can directly input and edit text. When in Insert Mode, you can type characters, and add, modify, or delete text content as needed. You can initiate Insert Mode by pressing keys such as ‘i‘ (to insert before the cursor) or ‘a‘ (to insert after the cursor). There are also variations like ‘I‘ (to insert at the beginning of the line) or ‘A‘ (to insert at the end of the line). To exit Insert Mode and return to Command Mode, simply press the ‘Esc‘ key.
  2. Command Mode: In Command Mode, you navigate and manipulate text without directly typing characters. This mode is designed for controlling the editor’s behavior and performing various editing tasks efficiently. You can move the cursor, delete text, copy and paste, search for text, and execute a wide range of other editing operations using keyboard commands. To transition from Insert Mode to Command Mode, press the ‘Esc‘ key. The clear distinction between these two modes in Vi is a foundational feature that enables users to edit text swiftly and effectively while minimizing the need for complex keyboard shortcuts.

How to Save a File in Vi / Vim Editor & Quit

In this article, we will cover how to save a file in vi editor. First, we look at Linux and Vi editors why we use them, and what their are features then we deep dive into the topic of saving a file and quitting the editor along with the other options, we understand the different commands with an example.

Similar Reads

What is Linux?

Linux was developed by Linus Torvalds in 1991 as a hobby project. It is an open-source (source code that can be used by anyone freely) kernel that is most popular and widely used in the industry as well as in personal systems. There are various operating systems based on the Linux kernel, some of the popular Linux distributions are Ubuntu, CentOS, Red Hat, Debian, and Kali Linux....

What is Vi Editor

Vi Editor is a widely used text editor in Unix/Linux systems and is known for its efficiency and flexibility. Vi editor was developed in 1976 by Bill Joy and later in 1991, an improved version of Vi editor was released which is known as VI Improved (VIM)....

How to Save a file in Vi/Vim Editor & Quit?

To execute any command you must have to be in command mode to enter command mode if you are in insert mode press Esc....

Conclusion

In this article we covered different ways to save a file, to quit the editor, and commands that do both save and quit along with shortcut keys. Apart from that a basic vi editor guide is also appended so that new users get familiar with the editor....

Contact Us