|
A Beginnner's Guide to Using VimStartingStarting is simple:% vim filename If the filename does not exist, vim creates it in your current directory. EditingLike most editors, vim has a command mode and an editing mode. The command mode is invoked by pressing Esc . When you first start editing a document, you are in command mode. The editing mode (called insert) is a little trickier. To type something you need to be in insert mode first. To enter insert mode, type i. Note that any time you are in command mode, you must use i to get back to insert mode. This link will get you to a list of important vim hot keys.
Saving and ExitingTo save, press Esc to enter command mode and then type :w . To exit after saving, use :q in the command mode.
To save and exit in one step, type :wq while in command mode. You can also use ZZ or :x for the same purpose. To exit without saving, type :q! while in command mode. If you get stuck and need to exit at any time, press Esc several times (the machine will beep at you) and then type :q!. |
Copyright (c) HMC Computer Science Department.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the no Invariant Sections, with no
Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU Free Documentation License.''