This is the file that vi (or vim or elvis or whatever vi-clone you're using) reads in to customize your editting environment.

Two Everything 2-specific vi-macros I have are:

map ^x :w^M:!ispell %^M
map ^c ebi[^]ea]^[

The first calls up the spell checker and the second puts square brackets around the current word.

The safest keys to use for vi command mode macros are:

K, V, g, q, v, ^a, ^c, ^i, ^k, ^o, ^q, ^s, ^v, ^w, ^x, ^z

because they aren't normally used. Note how clever it is that most of the free control keys are all clustered on the left side of the keyboard.

Note that if you want to map a key to the escape character, you need to press ^v (control-v) first.

In eric+'s writeup (and most other vi oriented material)escape is written ^[. Just typing 'shift-6 [' won't work. The proper method is to press ^v, followed by the key labelled Esc.

Also, for mapping ^x, you can't use 'shift-6 x' either. Press 'control-x' or 'control-v control-x' instead.

As a result, ^v is a used key. ^z and ^c are used too (for suspending and interuppting vi on UNIX systems).

Of course, you could have figured this out by reading the documentation, but if you wanted to copy-paste the above, and are now baffled by the fact that it doesn't work - you know now.

I'm talking about nvi (a much used vi clone) here, by the way. There may be other implementations which act differently.

Log in or register to write something here or to contact authors.