Moving Around in vi

Many cursor commands in vi enable you to move to different parts of the screen or the file you are editing. First, it’s necessary to go over how to count words, which is useful for moving, deleting, and replacing text.

Using Separated Words Versus Contained Words Versus Non-Words

Separated words (or space-delimited/delineated words) are any groups of characters separated by one or more spaces, tabs, or ends of lines. Contained words are any groups of letters or digits separated by punctuation, spaces, tabs, or ends of lines. The W command moves to the next space-separated word. The w command moves forward by contained words and non-words.

In the following example, if the cursor is at the start of the line, you can get to ...

Get Practical UNIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.