How vim sees wordsSome words have only letters.
Some words include punctuation.
To move forward by words in vim, use w or W.
w moves across combinations of letters.
W moves across combinations of letters and punctuation.
b moves backwards across combinations of letters.
B moves backwards across combinations of letters and punctuation.
Moving by wordsOpen vim. Type i to go in insert mode.
Type: I shouldn't help but love her.
Type jj or <Esc> to go to normal mode.
Move backwards with b or B.
Move forwards with w or W.
Go back and forth a bunch of times. Use all of w, W, b, and B.
Notice w and b take three presses to go through "shouldn't."
Didn't we mean to say "couldn't" instead of "shouldn't?"
Move your cursor to the s at the start of shouldn't.
Type dw. You erased the part of the word you wanted to change!
Type i go to into insert mode. Type couldn. Type jj or <Esc> for normal mode.
Are there ways to be more precise than this? Could we have changed "sh" to "c?"
Yes! We're getting to that. Next week some time. I promise.
Explanationw, W, b, and B allow us to move through documents very quickly.
Imagine a page full of text. You can navigate faster with w, W, b, and B faster than with the arrow keys. Remember, ) and ( move by sentences, and j and k move by lines. We're way ahead of word processors already with just these few commands, and we haven't even got to the cool stuff. Vim is all about fast.
If you dig into the documentation of your word processor, you'll find you can move with keystrokes. But the capabilities are limited compared to vim. Also, the keystrokes are tough. This is the same issue with emacs. You can't work fast if everything you type is Ctrl- or Alt- something or other.
Vim wins on speed of text manipulation, every time.