Use VIM

From CS113

You will hate VIM for the first four weeks. Then you'll realize you can't live without it.

VIM is unlike any editor you have ever experienced before. VIM operates in different modes -- normal mode, insert/edit mode, visual mode etc. The normal mode is for commands (like open, save, etc.). Editing a document is done in only the editing mode. The visual mode is for selections (not terribly important for this course).


VIM starts in normal mode. If you start vim from the command line (by running vim) you'll see an empty page, and a line at the bottom. Anything and everything your type in this mode is interpreted as a VIM command. You cannot start typing your document in this mode.

First you must enter edit mode. There are many ways to do this, one of them is the command i. (Simply press i when VIM starts up). You'll see -- INSERT -- at the bottom of the screen. That is the indication that you are now in edit mode. You may now start writing your file. Note: The i (or any other) command you press to enter editing mode will not show up in the contents of the file.

To save a document, you have to return to normal mode. Pressing <ESC> anywhere will get you back into normal mode (you can press <ESC> or the escape key while editing). Once in normal mode, type the command :w filename and press enter (colon followed by w, space and a filename). This will write the file to disk. You can then resume editing by re-entering edit mode using the i command, and re-save the file with <ESC>:w (you don't need to re-enter the filename if you've already given it once).

To delete a line, in VIM in normal mode position the cursor on that line and press dd

To exit vim, return to normal mode and give the command :q. To save a file and exit in a single command, use :wq

To open an existing file, from normal mode, use :e filename

See VIM tutorial for more commands

Print out the VIM Quick-Reference Card for quick help

Personal tools
Navigation