(Modified 2006 Jun 09)

The vi editor
with vim-specific leanings


Outline


Overview

vi has two modes: insert mode and command mode. Insert mode is where you type, and command mode is where you do everything else, like cut, paste, save, etc. You enter insert mode by several ways (e.g., i), and you enter command mode using ESC. I'm not sure why command-mode operations must preclude inserting, but that's the way it is.

vim has some features on top of vi, which makes it more usable. Such features include mouse controls, like highlighting and scrolling using a wheel mouse. By default, mouse control is off. There's a :set command to turn it on, but I turn it on by default by having this line in my ~/.vimrc:

set mouse=a

In fact, this is the only line I have in my ~/.vimrc file. I should change the colors for syntax-highlighting someday, because the default colors are atrocious (yellow on white??).

Also, there's a graphical version called gvim that has some pull-down menu support. You still have to manually alternate between insert and control mode, but the pulldown menus let you get away without remembering all of the control characters.

I collected the list of commands below from the follow three pages:


Navigation -- done from command mode

Inserting text

Search/replace -- done from command mode

Cutting/pasting -- done from command mode
This is a pretty fundamental set of operations, but the reason I'm listing these after searching and replacing is that it can draw on some of the syntax used in searching. The general from using the d command is that it's followed by a location.

File input/output -- done from command mode

Appearance/split windows -- done from command mode

Macros -- done from command mode


This page is Lynx-enhanced