Things that could be done to improve vi

barnettb at vdsvax.uucp barnettb at vdsvax.uucp
Sat Oct 18 06:59:33 AEST 1986


In article <89 at houligan.UUCP> dave at murphy.UUCP writes:
>I would like to see a couple of things in vi that would make it a little less
>frustrating to use in certain applications.  They are:

Try putting in .exrc
	:map! a A
	:map! b B
	:map! c C
	.
	.
	.
	:!map! z Z

Anytime you type (in insert mode) an `a', the editor with map it into `A'
What's that you say? You don't want this all the time?
just put it in a file calls `.f' - for fortran, and type

	:source .f
when you want fortran mode.
Of course, you can define a function key to :source this

Along with this, This is my .exrc file, which I customized for
a vt100 terminal.
It is set up for C and nroff -me macros (usually)

	set ai redraw sm wm=1
	set tabstop=4 
	set shiftwidth=4
	map! {} {^M}^[O^V	/great for auto indenting { } pairs.
	map! ^[OD ^[ha		/*  cursor down while inserting */
	map! ^[OA ^[ka		/* vt100 up arrow while inserting */
	map! ^[OB ^[ja		/* cursow left while inserting */
	map! ^[OC ^[la		/* cursor right */
	map ^[OP A		/* mapped pf1 to append to end of line */
	map! ^[OP ^[A 		/* insert mode of the above */
	map ^[OQ 0i		/* mapped pf2 to insert before line */
	map! ^[OQ ^[0i		/* insert mode of the above */
	map! `` \*(lq		/* troff left quote */
	map! '' \*(rq		/* troff right quote */

	I can use the cursor keys while inserting. This is handy
	because I can backup and insert without hitting escape.

	Also, I have defined pf1 to append at the end of the line.
	This is useful because it doesn't matter what mode you are in,
	it always puts you in insert mode.

	At one time, I mapped the entire numeric keypad to emulate EDT.

bruce barnett
chinet!steinmetz!vdsvax!barnettb



More information about the Comp.unix mailing list