

Even if you’ve been using Vi and Vim Editors for several years and have not read this book, please do yourself a favor and read this book.

Based on my Vim editor experience, I’ve written Vim 101 Hacks eBook that contains 101 practical examples on various advanced Vim features that will make you fast and productive in the Vim editor.
#Vim shortcuts code#
Several years back, when I wrote lot of C code on Linux, I used to read all available Vim editor tips and tricks. So, naturally I’m a huge fan of Vi and Vim editors. In the following example, it will open the README file and jump to the last occurrence of the word “bug”. Vim +?patten filename: Go to the particular pattern’s line inside the file, first occurrence from last. In the following example, it will open the README file and jump to the first occurrence of the word “install”. Vim +/pattern filename: Go to the particular pattern’s line inside the file, first occurrence from first. Vim +N filename: Go to the Nth line of the file after opening it. % – Go to the matching braces, or parenthesis inside code.

`^ – Go to the position where you were in INSERT MODE while last closing the file.When you enter the insert mode, you’ll see INSERT at the bottom of the editor/terminal screen. You press the ‘i’ key to enter the insert mode. Always remember, i stands for insert mode. `” – Go to the position where you were in NORMAL MODE while last closing the file. Once you know the Vim modes, let’s see some basic Vim commands for various purposes.N% – Go to the Nth percentage line of the file.You may want to do some special navigation inside a file, which are: ctrl+u – Jump back (up) one half screen.ctrl+d – Jump forward (down) a half screen.
#Vim shortcuts full#
ctrl+b – Jump backwards one full screen.L – Go to the last line of current screen.M – Go to the middle line of current screen.H – Go to the first line of current screen.g_ – go to the last non blank character of the line.įollowing are the three navigation which can be done in relation to text shown in the screen.^ – go to the first non blank character of the line.0 – go to the starting of the current line.Within a line if you want to navigate to different position, you have 4 other options. In this article, let us review the following 8 Vi / Vim navigation options.įollowing are the four navigation that can be done line by line.īy using the repeat factor in VIM we can do this operation for N times. To be very productive, you should be aware of all possible navigation shortcuts in your editor. Navigation is a vital part of text editing.

This article is part of the ongoing Vi / Vim Tips and Tricks series. This article is written by SathiyaMoorthy.
