[net.unix] Things that could be done to improve vi

dave@murphy.UUCP (09/30/86)

My two cents' worth on the editor wars: although I'm not to get into the
"my editor is better than your editor" thing (sounds like net.sport.baseball),
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:

1. An on-screen mode indicator, so that you know whether you're in a text
entry mode or a command mode.  (Also, an indicator that would show whether
or not you've made any changes to the current file would be nice.)

2. A software caps-lock function that would shift all alpha keys typed in
a text-entry mode to upper case.  What do I want this for?  We have a number
of Fortran (no flames) programs that were ported from another operating
system which are written in all upper case.  To maintain the style and
readability of these programs, we have a rule that all new code put into them
must be done in upper case (except comments).  Well, the temptation when
working on these is to just hit the caps-lock button and go to work; the
problem is that if you go back to command mode and forget to take off the
caps lock, your commands will be in upper case and will do something you
didn't expect.

3. A way to change the text-entry exit key to something other than <ESC>.
The reason is that if you're working on a VT100-type terminal, and you
accidentally go for an arrow key while you're in a text entry mode, the
<ESC> that is transmitted at the beginning of the key's sequence will
throw you back to command mode, and the remaining characters will do
something rude to your buffer.  If the text-entry termination key isn't
<ESC>, all that happens is that you get three garbage characters which
you can easily backspace over.

4. A "help" function that would present an on-screen quick-and-dirty cheat
sheet would be nice.  (Actually, this would be more of a reminder function
that you could use when you can't remember the key for a certain command,
not a substitute for the manual section.)

5. When the "noeb" (no error bells) option is set, THE DAMN THING SHOULD
*NOT* SEND BELLS -- EVER!

---
It's been said by many a wise philosopher that when you die and your soul
goes to its final resting place, it has to make a connection in Atlanta.

Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL
UUCP:  ...{sun,pur-ee,brl-bmd}!gould!dcornutt
 or ...!ucf-cs!novavax!houligan!dcornutt
ARPA: wait a minute, I've almost got it...

"The opinions expressed herein are not necessarily those of my employer,
not necessarily mine, and probably not necessary."

david@varian.UUCP (David Brown) (10/02/86)

> 1. An on-screen mode indicator, so that you know whether you're in a text
> entry mode or a command mode.  

PC/VI (a very nice version of vi for the IBM PC and compatibles from
Custom Software Systems) does this.

> 2. A software caps-lock function that would shift all alpha keys typed in
> a text-entry mode to upper case. 

You could input your text in lower case and then use tr to translate it
to upper case, either after you exit vi, or within vi with !}tr 'a-z' 'A-Z'
(for a paragraph),  !]]tr 'a-z' 'A-Z' (for the current line through the
end of the file),  ![[tr 'a-z' 'A-Z' (for the current line through the start
of the file).

> A way to tell if the file has been modified.

^G will tell you this.


-- 
	David Brown	 (415) 945-2199
	Varian Instruments 2700 Mitchell Dr.  Walnut Creek, Ca. 94598
	{ptsfa,lll-crg,zehntel,dual,amd,fortune,ista,rtech,csi}!varian!david

keith@enmasse.UUCP (Keith Crews) (10/02/86)

In article <89@houligan.UUCP> dave@murphy.UUCP writes:
>My two cents' worth on the editor wars: although I'm not to get into the
>"my editor is better than your editor" thing (sounds like net.sport.baseball),
>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:
>
>1. An on-screen mode indicator, so that you know whether you're in a text
>entry mode or a command mode.  (Also, an indicator that would show whether
>or not you've made any changes to the current file would be nice.)
>
I like this and the rest of Dave's suggestions.  I would also add the
capability to display the last n keys typed.  This would be useful for
recovering from the inevitable errors of accidently typing garbage that
trashes the file but in some undetermined way.  For novices, displaying
this on the bottom line would be helpful.  For more experienced users, the
ability to have it displayed would be sufficient.

levy@ttrdc.UUCP (Daniel R. Levy) (10/17/86)

In article <936@kbsvax.steinmetz.UUCP>, barnettb@vdsvax.uucp (Barnett Bruce G) writes:
>In article <89@houligan.UUCP> dave@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'

Also when you type a lowercase letter in ex command mode the editor will map
it too!  I just tried it out of curiosity.  Not much fun.  It takes a lot of
^V quoting to recover (:^Vu^Vn^Vm^Va^Vp! a<RETURN>  :^Vu^Vn^Vma^Vp! b etc...).

>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.
...
>
>bruce barnett
>chinet!steinmetz!vdsvax!barnettb
-- 
 -------------------------------    Disclaimer:  The views contained herein are
|       dan levy | yvel nad      |  my own and are not at all those of my em-
|         an engihacker @        |  ployer or the administrator of any computer
| at&t computer systems division |  upon which I may hack.
|        skokie, illinois        |
 --------------------------------   Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
	   go for it!  			allegra,ulysses,vax135}!ttrdc!levy

barnettb@vdsvax.uucp@ndmce.uucp (Barnett Bruce G) (10/17/86)

In article <89@houligan.UUCP> dave@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