home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Linux in a NutshellLinux in a NutshellSearch this book

11.4. Movement Commands

Some versions of vi do not recognize extended keyboard keys (e.g., arrow keys, Page Up, Page Down, Home, Insert, and Delete); some do. All, however, recognize the keys in this section. Many users of vi prefer to use these keys, as it helps them keep their fingers on the home row of the keyboard. A number preceding a command repeats the movement. Movement commands are also objects for change, delete, and yank operations.

11.4.5. Searches

Command

Action

/pattern

Search forward for pattern.

/

Repeat previous search forward.

/pattern/+n

Go to line n after pattern.

?pattern

Search backward for pattern.

?

Repeat previous search backward.

?pattern?-n

Go to line n before pattern.

n

Repeat previous search.

N

Repeat previous search in opposite direction.

%

Find match of current parenthesis, brace, or bracket.

*

Search forward for word under cursor. Matches only exact words. {vim}

#

Search backward for word under cursor. Matches only exact words. {vim}

g*

Search backward for word under cursor. Matches the characters of this word when embedded in a longer word. {vim}

g#

Search backward for word under cursor. Matches the characters of this word when embedded in a longer word. {vim}

fx

Move forward to x on current line.

Fx

Move backward to x on current line.

tx

Move forward to just before x in current line.

Tx

Move backward to just after x in current line.

,

Reverse search direction of last f, F, t, or T.

;

Repeat last character search (f, F, t, or T).

:noh

Suspend search highlighting until next search. {vim}.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.