A Minimal Set of Commands for Vim (Vi)
I prefer nano myself, but lots of experienced Linux users prefer vim (or vi). Sometimes vi is the only editor available, for example on a Pogoplug before you’ve installed Optware and added nano. Here’s an absolute minimum set of commands you’ll need to get going under these circumstances. Start with:
Here’s a small subset of vim commands you can use to make changes to the file you opened.
You can move around the file using the arrow keys on your keyboard.
delete deletes the character under the cursor.
R replaces characters with your typing beginning with the one under the cursor
r replaces the character under the cursor with the character you type
i inserts characters before your cursor location
o opens a new line below the one your cursor is on and enters insert mode
esc exits insert or overwrite mode.
Then you can use the following commands:
Saves changes to a file. If you don’t specify a file name, Vim saves as the file name you were editing. For saving the file under a different name, specify the file name.
Quits Vim. If you have unsaved changes, Vim refuses to exit.
Exits Vim without saving changes.
Writes the file and exits.