| Command | Action | Looking for a semicolon |
|---|---|---|
| fchar | search forward, cursor lands on char | f; |
| tchar | search forward, cursor lands on character before char | t; |
| Fchar | search backward, cursor lands on char | F; |
| tchar | search forward, cursor lands on character after char | T; |
/string to search for/
//
/, then use the up/down arrow keys (followed by Enter when you reach
the desired pattern).
?'s instead of /'s.
:), use a line range for the area you wish to replace (1,$ does the whole file).
:start,ends/string to look for/replacement string/optional flags
g: keep looking on a line even after the string have been replaced (w/o it, only the first occurrence on a line is replaced)
c: confirm — for each occurrence, interactively prompt the user whether the replacement should be performed
<< indents; << exdents (one tab stop in each case)
3>> indents 3 tab positions
. repeats the last normal mode change, so you can quickly change a block of lines by indenting (>>, say)
the first line, then moving down a line and pressing ., and repeating.
> is the indent command and << is the exdent command. To indent a range, you would
go into command mode (:), specify the range and follow it with a >
:1,$>