2024-10-15 Productivity
Vim Motion Series 2: Intermediate Vim Motions - Word and Line Navigation
By O. Wolfson
Welcome to the second lesson in our Vim Motions series. In this lesson, we’ll introduce more powerful motions for navigating your text with efficiency.
If you haven’t yet set up Vim or Vim keybindings in your editor, please refer to the setup steps in Lesson 1.
Practice Text and Instructions
To get started, open your terminal and create a new file for this lesson:
Once inside Vim (or your Vim motions enabled text editor), press i
to enter Insert Mode, then paste the practice text below. When done, press Esc
to return to Normal Mode and start practicing the motions directly on the text.
Explanation of Key Motions
-
Line Navigation:
^
takes you to the first non-whitespace character in the line.g_
takes you to the last non-whitespace character in the line.gg
takes you to the first line of the file.G
takes you to a specific line (e.g.,25G
for line 25) or to the end of the file.
-
Sentence and Paragraph Navigation:
)
moves you to the next sentence.(
moves you to the previous sentence.}
moves you to the next paragraph.{
moves you to the previous paragraph.
-
Repetition and Operators:
- Prefix any motion with a number to repeat it.
- Combine motions with operators like
d
(delete),y
(yank), andc
(change).