

In command mode, you can execute commands and manipulate text. You will be able to select multiple lines. To enter the visual mode just enter “ v“. The visual mode makes it easy to select and modify text in the VI editor. ( O – inserts a new line above the cursors current position in insert mode) Inserts a new from the cursor’s current position in insert mode. The cursor moves to the next character in insert mode ( A – moves to the end of the line in Insert mode) ( I –> Goes to the beginning for the line in insert mode) Again, the lower and uppercase characters have different functions here.

The next shortcut is required most of the time when you work with files. E goes to the end of the word before the whitespace. B goes to the beginning of the previous word before the whitespace. Goes to the beginning of the previous word. W goes to the beginning of the next word after the whitespace. Here the lower and uppercase characters have different functions. Next, we will learn the shortcuts to browse through words. Move one character right (8l -> 8 characters right) Move one character left (4h will move four characters left) If you add a number to the shortcut, the movement gets multiplied. In this mode, you can cursor to browse through the file using different shortcuts.įollowing are the shortcuts to move the cursor in different directions.

When you open any file in the VI editor, the default mode is Normal Mode. VI editor Modesīefore getting into shortcuts, you should understand the five modes of vim editor. VI editor hacks come in handy when you work with shell scripts as well. I have also written an article on learning shell scripting for DevOps. In this article, we will cover the necessary VI editor shortcuts that you could use in day-to-day Linux activities. Moreover, it is a very powerful text editor in the Linux ecosystem. Once you get the hang of it, you will start loving the VI editor. However, you can save time and increase productivity with a little bit of practice and the vi editor shortcuts in your day-to-day activities. However, unlike GUI editors, first-time VI editor users get intimidated due to various keystrokes for controlling the editing. If you are a DevOps engineer or someone who works on Linux systems, vi editor is often used for editing files. In this Linux tutorial, you will learn the VI editor shortcuts, some tips, and a few productivity hacks that can be used for DevOps engineers & Developers.
