
~ | 753
vi
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
replace the lines with the output and error output. (This is called
filtering the text through the command.)
Examples
:!ls List files in the current directory
:11,20!sort -f Sort lines 11–20 of current file
=
[address] =
Print the line number of the line indicated by address. Default is
line number of the last line.
<>
[address] < [count]
[address] > [count]
Shift lines specified by address either left (<) or right (>). Only
leading spaces and tabs are added or removed when shifting lines.
count specifies the number of lines to shift, starting with address.
The shiftwidth option controls the number of columns that are
shifted. Repeating the < or > increases the shift amount. For
example, :>>> shifts three times as much as :>.
address
address
Print the lines specified in address.
Enter
Print the next line in the file. (For ex only; not from the : prompt in
vi.)
@
[address] @ [char]
Execute contents of register specified by char.Ifaddress is given,
move cursor to the specified address first. If char is @, repeat the
last @ command.
&
[address] & [options] [count]
Repeat the previous substitute (s) command. count specifies the
number of lines on which to substitute, starting with address.
options are the same as for the substitute command.
Examples
:s/Overdue/Paid/ Substitute once on current line ...