O'Reilly logo

Practical UNIX by Steve Moritsugu - DTR Business Systems

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required