Tutorial by Examples

Jumping to characters f{char} - move to the next occurrence of {char} to the right of the cursor on the same line F{char} - move to the next occurrence of {char} to the left of the cursor on the same line t{char} - move to the left of the next occurrence of {char} to the right of the cursor on th...
Remarks Every motion can be used after an operator command, so the command operates on the text comprised by the movement's reach. Just like operator commands, motions can include a count, so you can move by 2words, for example. Arrows In Vim, normal arrow/cursor keys (←↓↑→) work as expected...
Vim supports the use of regular expressions when searching through a file. The character to indicate that you wish to perform a search is /. The simplest search you can perform is the following /if This will search the entire file for all instances of if. However, our search if is actually a r...
When editing text, a common task is to navigate to a particular word on the screen. In these examples we explore how we can navigate to the word updated. For the sake of consistency across the examples, we aim to land on the first letter of the word. Mid-screen jump M$B This approach is quick...
Marks are like bookmarks; they help you find places you've already been. TLDR Set them in normal mode with m{a-zA-Z}, and jump to them in normal or visual mode with '{a-zA-Z} (single quote) or `{a-zA-Z} (backtick). Lowercase letters are for marks within a buffer, and capital letters and digits are...
To jump to a specific line with colon number. To jump to the first line of a file use :1 To jump to line 23 :23

Page 1 of 1