
752
|
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.
wq
wq[!]
Write and quit the file in one movement. The file is always written.
The ! flag forces the editor to write over any current contents of
file.
wqall
wqa[!]
Write all changed buffers and quit the editor. Add ! to force writing
of any buffers marked readonly. xall is another alias for this
command. {vim}
X
X
Prompt for an encryption key. This command can be preferable to
:set key, as typing the key is not echoed to the console. To remove
an encryption key, just reset the key option to an empty value.
{vim}
xit
x
Write the file if it was changed since the last write, then quit.
yank
[address] y [char] [count]
Place lines specified by address in named register char. Register
names are the lowercase letters a–z. Uppercase names append text
to the corresponding register. If no char is given, place lines in
general register. count specifies the number of lines to yank,
starting with address.
Example
:101,200 ya a Copy lines 100–200 to register "a"
z
[address] z [type] [count]
Print a window of text with the line specified by address at the top.
count specifies the number of lines to be displayed.
Type
+ Place specified line at the top of the window (default).
- Place specified line at the bottom of the window.
. Place specified line in the center of the window. ...