
global | 743
vi
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
edit
e[!] [+num] [filename]
Begin editing on filename.Ifnofilename is given, start over with a
copy of the current file. Add a ! to edit the new file even if the
current file has not been saved since the last change. With the
+num argument, begin editing on line num.Ornum may be a
pattern, of the form /pattern.
Examples
:e file Edit file in current editing buffer
:e +/^Index # Edit alternate file at pattern match
:e! Start over again on current file
file
f [filename]
Change the filename for the current buffer to filename. The next
time the buffer is written, it will be written to file filename. When
the name is changed, the buffer’s “not edited” flag is set, to indi-
cate you are not editing an existing file. If the new filename is the
same as a file that already exists on the disk, you will need to use
:w! to overwrite the existing file. When specifying a filename, the
% character can be used to indicate the current filename. A # can
be used to indicate the alternate filename. If no filename is speci-
fied, print the current name and status of the buffer.
Example
:f %.new
fold
address fo
Fold the lines specified by address. A fold collapses several lines on
the screen into one line, which later can be unfolded. It doesn’t
affect the text of the file. {vim}
foldclose
[address] foldc[!] ...