Changing modes in the Vim editor
There are Six modes in Vim editor.
- Editing/Insert Mode: To make any changes in a file in Vim editor user has to first enter editing/insert mode, Press ‘i’ or ‘a’ to enter editing/insert mode.
- Command Mode: To run any command in Vim editor user has to enter command mode, if you are in editing/insert mode Press Esc then ‘:’ followed by the command. For example: set the number
Basic Vim Commands
In this article, we will cover some basic commands in the Vim editor. First, we look at what Linux and VIM editors are and why we use them, followed by basic commands in Vim editor starting from creating/editing a file, different modes, quitting the editor, saving the changes to the file, navigation in the editor, deleting lines, displaying and hiding line numbers, search and replace, and syntax highlighting along with the syntax of commands and screenshots.
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.
VIM 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).
Basic VIM Commands
- 1. Create/Edit a file
- 2. Changing modes in the Vim editor
- 3. Quit the Vim editor
- 4. Save the changes
- 5. Navigation in Vim editor
- 6. Delete a line
- 7. Search and Replace
- 8. Display Line Numbers
- 9. Hide Line numbers
- 10. Syntax Highlighting
Contact Us