
744
|
Chapter 9: The vi, ex, and vim Editors
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Examples
:g/Unix/p Print all lines containing "Unix"
:g/Name:/s/tom/Tom/ Change "tom" to "Tom" on all lines
containing "Name:"
hide
hid
Close current window unless it is the last window, but do not
remove the buffer from memory. This is a safe command to use on
an unsaved buffer. {vim}
insert
[address] i[!]
text
.
Insert text at line before the specified address, or at present address
if none is specified. Add a ! to switch the autoindent setting during
input of text. Terminate input of new text by entering a line
consisting of just a period.
join
[address] j[!] [count]
Place the text in the specified range on one line, with whitespace
adjusted to provide two space characters after a period (.), no space
characters before a ), and one space character otherwise. Add a ! to
prevent whitespace adjustment.
Example
:1,5j! Join first five lines, preserving whitespace
jumps
ju
Print jump list used with Ctrl-I and Ctrl-O commands. The jump
list is a record of most movement commands that skip over
multiple lines. It records the position of the cursor before each
jump. {vim}
k
[address] k char
Same as mark; see mark, later in this list.
left
[address] le [count]
Left-align lines specified by address, or current line if no address is
specified. Indent lines by count spaces. ...