Professional Documents
Culture Documents
8 Essential Vim Editor Navigation Fundamentals
8 Essential Vim Editor Navigation Fundamentals
Fundamentals
This article is part of the ongoing Vi / Vim Tips and Tricks series.
Navigation is a vital part of text editing. To be very productive, you should
be aware of all possible navigation shortcuts in your editor. In this article,
let us review the following 8 Vi / Vim navigation options.
1.
Line navigation
2.
Screen navigation
3.
Word navigation
4.
Special navigation
5.
Paragraph navigation
6.
Search navigation
7.
Code navigation
8.
k navigate upwards
j navigate downwards
By using the repeat factor in VIM we can do this operation for N times. For
example, when you want to
go down by 10 lines, then type 10j.
Within a line if you want to navigate to different position, you have 4 other
options.
/i Search for a pattern which will you take you to the next
occurrence of it.
?i Search for a pattern which will you take you to the previous
occurrence of it.
Vim +/pattern filename: Go to the particular patterns line inside the file,
first occurrence from first. In the following example, it will open the
README file and jump to the first occurrence of the word install.
vim +/install README
Vim +?patten filename: Go to the particular patterns line inside the file,
first occurrence from last. In the following example, it will open the
README file and jump to the last occurrence of the word bug.
vim +?bug README