O'Reilly logo

The Linux Command Line by William E. Shotts Jr.

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 the Cursor Around

While it is in command mode, vi offers a large number of movement commands, some of which it shares with less. Table 12-1 lists a subset.

Table 12-1. Cursor Movement Keys

Key

Moves the cursor

L or right arrow

Right one character

H or left arrow

Left one character

J or down arrow

Down one line

K or up arrow

Up one line

Key

Moves the cursor

0 (zero)

To the beginning of the current line

shift-6 (^)

To the first non-whitespace character on the current line

shift-4 ($)

To the end of the current line

W

To the beginning of the next word or punctuation character

shift-W (W)

To the beginning of the next word, ignoring punctuation characters

B

To the beginning of the previous word or punctuation character

shift-B (B)

To the beginning of the previous word, ...

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