[comp.editors] How to put vi into 132 column mode?

lazer@mnetor.UUCP (Lazer Danzinger) (04/26/88)

	Although I am aware that by setting the "term" type appropriately,
	one can place a vt100 into 132 column mode, I would like to
	solicit (preferably csh) scripts which place a vt100 into 132 column
	mode; then invoke vi with "term" set to vt00-w; and upon existing
	from the script, return everything back to normal.

	Thanks.

-- 
-----------------------------------------------------------------------------
Lazer Danzinger		|
lazer@mnetor.UUCP	| "Not learning, but doing is the essential thing."
(416)475-8980 		|				Avot 1:17
-------------------------------------------------------------------------------
Computer X--A Motorola New Enterprises Company
----------------------------------------------------------------------------

kolding@ji.Berkeley.EDU (Eric Koldinger) (04/28/88)

In article <4524@mnetor.UUCP> lazer@mnetor.UUCP (Lazer Danzinger) writes:
>	Although I am aware that by setting the "term" type appropriately,
>	one can place a vt100 into 132 column mode, I would like to
>	solicit (preferably csh) scripts which place a vt100 into 132 column
>	mode; then invoke vi with "term" set to vt00-w; and upon existing
>	from the script, return everything back to normal.

    How's 'bout:
    alias wvi 'stty cols 132; vi \!\*; stty cols 80'

    That should do the trick, right?

		_   /|				Eric
		\`o_O'				kolding@ji.berkeley.edu
  		  ( )     "Gag Ack Barf"	{....}!ucbvax!ji!kolding
   	    	   U

henkbo@philce.UUCP (Henk Boetzkes) (05/02/88)

>From: lazer@mnetor.UUCP (Lazer Danzinger)
>Message-ID: <4524@mnetor.UUCP>
>Date: 26 Apr 88 16:20:34 GMT
>Organization: Computer X (CANADA) Ltd., Toronto, Ontario, Canada
>
>	Although I am aware that by setting the "term" type appropriately,
>	one can place a vt100 into 132 column mode, I would like to
>	solicit (preferably csh) scripts which place a vt100 into 132 column
>	mode; then invoke vi with "term" set to vt00-w; and upon existing
>	from the script, return everything back to normal.
>
>	Thanks.

No no, not an csh script but an alias !!!

alias wi     'setenv TERM vt100-w ; echo "^[[?3h" ; vi \!\!:* ; setenv TERM vt100 ; echo "^[[?3l" '

	  ^                               ^
	  |_______________________________|___= Control [

And this one is free !
First an "grep foo files" and then edit "files" which has "foo" in it.

alias grepvi 'vi `grep -l \!\!:1 \!\!:2`'

-- 
=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Henk.A.P.A. Boetzkes # E.D.P. N.P.B. Consumer Electronics # PO. BOX 218      #
# 5600 MD Eindhoven, The Netherlands # Building SK4, Room 416                  #
# +31 40 735983 # !uunet! -> mcvax!philmds!philce!henkbo                       #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#

poole@ut-emx.UUCP (Steve Poole) (05/07/88)

Lazer Danzinger asked about putting vi into 132 column mode.
 
Eric Koldinger suggested setting up the following alias:

alias wvi 'stty cols 132; vi \!\*; stty cols 80'

Henk Boetzkes suggested setting up the following alias:

alias wi 'setenv TERM vt100-w ; echo "^[[?3h" ; vi \!\!:* ; setenv TERM vt100 ; echo "^[[?3l" '
                                       ^                                               ^
                                       |_______________________________________________|
                                           |
                                           |
                                           Control [


Neither of these worked for me.  But I was able to figure out
something that did work.  I set the following alias.

alias viw 'stty cols 132; echo "^[[?3h"; vi \!* ; echo "^[[?3l";stty cols 80'

I had trouble getting the Control [ into a file.  Vi wouldn't
let me just type it in, and typing a \ before typing the
Control [ didn't work.  I finally got it into a file by giving
the command

echo "^[[?3h" > temp1

where ^[ is Control [

That got in into the file temp1.  Then I could use it to
create the alias command, which I put in my .cshrc file in my
login directory.
-- 
Steve Poole  
ARPA: poole@emx.utexas.edu
UUCP: {ames,angband,exodus,harvard,im4u,mordor}!ut-sally!ut-emx!poole

limes@sun.uucp (Greg Limes) (05/07/88)

In article <2151@ut-emx.UUCP> poole@ut-emx.UUCP (Steve Poole) writes:
>I had trouble getting the Control [ into a file.  Vi wouldn't
>let me just type it in, and typing a \ before typing the
>Control [ didn't work.

Type a "control-V" before the escape (yes, Control-[ is escape); then
it should accept the character. (For you EMACS people, use Control-Q.)
-- 
   Greg Limes [limes@sun.com]			Illigitimi Non Carborundum

henkbo@philce.UUCP (Henk Boetzkes) (05/10/88)

>I had trouble getting the Control [ into a file.  Vi wouldn't
>let me just type it in, and typing a \ before typing the
>Control [ didn't work.  I finally got it into a file by giving
>the command
>
>Steve Poole  
>
Use the next time Control-V Control-[ to insert an "CONTROL [" character.
And my solution works only in the csh (not the ksh-alias), and if you have an
vt100-w in your /etc/termcap. If you have either one than you have to check
which entry is an 132col and rename the alias for your system.

-- 
Don't shoot me, I am only the piano player.                                     =#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
# Henk.A.P.A. Boetzkes # E.D.P. N.P.B. Consumer Electronics # PO. BOX 218      ## 5600 MD Eindhoven, The Netherlands # Building SK4, Room 416                  #
# +31 40 735983 # !uunet! -> mcvax!philmds!philce!henkbo                       #=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#
PLEASE answer me just ONE QUESTION, What the heck am I doing here !