![]() |
In this article, we will cover how to efficiently navigate in the vi editor along with the basic four navigation keys we will look into some additional navigation keys to navigate seamlessly within the vi editor. First, we look at what Linux and VI editors and why we use them, what are its features and how can we use them. LinuxLinux 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 Linux kernel, some of the popular Linux distributions are Ubuntu, Cent OS, Red Hat, Debian, and Kali Linux. VI EditorVi 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). There are two modes in Vi Editor:
Navigation in Vi EditorVi editor provides a lot to commands/keys to navigates seamlessly within the editor but you must have to be in the command mode to navigate, to enter in command mode if you are in insert mode press Esc. Basic 4 navigation keysThere are four basic navigation keys in vi editor to navigate in cardinal directions (up/down/left/right) which are as follow:
Examples: We have discussed about the basic four navigation keys to move the cursor in four cardinal directions we have attached screenshots for each navigation key to demonstrate its moves: 1. To move cursor one line up (k) 2. To move cursor one line down (j) 3. To move cursor one character left (h) 4. To move cursor one character right (l) Additional Navigation KeysApart from the basic navigation keys vi editor provides a lot commands/keys to navigate which are as follows:
Basic Vi Editor Guide1. Create/Edit a file using Vi editor
2. Insert Mode To make any changes in the file first you need to enter in the insert mode to modify the file. To get into insert mode press button ‘i’ to enter in insert mode. 3. Command Mode To run any command in the vi editor you have to first enter in the command mode if you are currently in the insert mode then press Esc and then ‘:’ colon followed by your command to run your command in the editor. ConclusionIn this article we have covered how to effectively navigate in the vi editor using basic four navigation keys and additional navigation keys along with an example, later we discuss a basic vi editor guide. If you want to deep dive into vi editor you can checkout this GFG article. |
Reffered: https://www.geeksforgeeks.org
Geeks Premier League |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |