Moving by Words
Words are the building blocks of every program. They conveniently create natural targets for navigation. Take this line of code for example:
1
2
3
4
5
6
7
8
9
const test = document.getElementById("test");
Think of the 9 words in this line of code as stepping stones in a platformer game — each one is a target you can jump to.
w
Example
e
Example
b
Example
What defines a word?
In Vim, a word consists of a sequence of letters, digits and underscores separated with white space:
1
2
3
4
test one test1234 snake_case_is_cool
Words are also formed when switching between the characters defined above and special symbols - Vim treats each group as a separate word:
1
2
3
4
5
6
7
8
9
10
alphanumeric#$%#@! Alice-->Bob test@gmail.com
Source: Vim Help Page