VI at the command line and backspace

  • Follow


SunOS action9 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V240

How to I enable vi as my default command line editor and keep the back space
from echoing ^H instead of moving the cursor back one Char.


Tks

Chris
vidalch_1@yahoo.com



begin 666 cvidal.vcf
M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..CMC=FED86P-"D9..F-V:61A
M; T*14U!24P[4%)%1CM)3E1%4DY%5#IC=FED86Q 871T+F-O;0T*4D56.C(P
;,#0P.#(S5#$W-3(R,UH-"D5.1#I60T%21 T*
`
end

0
Reply Chris 8/23/2004 5:52:23 PM

Hello,

> How to I enable vi as my default command line editor?

add to you shells startup file:

export EDITOR=vi

	or 

setenv EDITOR vi

> and keep the back space from echoing ^H instead of moving the cursor
> back one Char.

you don't. Use vim instead.

	Thomas
0
Reply Thomas 8/23/2004 6:15:22 PM


Thomas Glanzmann <sithglan@stud.uni-erlangen.de> wrote:
> Hello,

>> How to I enable vi as my default command line editor?

> add to you shells startup file:

> export EDITOR=vi

> 	or 

> setenv EDITOR vi

>> and keep the back space from echoing ^H instead of moving the cursor
>> back one Char.

> you don't. Use vim instead.

vi on Solaris accepts backspace (and DEL) for moving the cursor.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
0
Reply Thomas 8/23/2004 6:22:29 PM

Hello,

> vi on Solaris accepts backspace (and DEL) for moving the cursor.

that's true. But the vanilla vi isn't useable without the 'I have a
wide terminal' patch anyway. And I think he wants to delete unlimited
chars not the only the just inserted ones.

	Thomas
0
Reply Thomas 8/23/2004 6:28:25 PM

Thomas Glanzmann <sithglan@stud.uni-erlangen.de> wrote:
> Hello,

>> vi on Solaris accepts backspace (and DEL) for moving the cursor.

> that's true. But the vanilla vi isn't useable without the 'I have a
> wide terminal' patch anyway. And I think he wants to delete unlimited
> chars not the only the just inserted ones.

vanilla vi's ok up to 160 characters, and he did ask how to enable vi.

(There are better choices than Sun's vi of course, but I'd prefer to answer
his question than add new ones).

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
0
Reply Thomas 8/23/2004 6:41:30 PM

In article <cgda5l$7qj11@kcweb01.netnews.att.com>, Chris Vidal wrote:

> keep the back space from echoing ^H instead of moving the 
> cursor back one Char.

Doesn't everyone do this with "map" commands in their .exrc ?

-- 
Elvis Notargiacomo  master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
   If its message contained filing-cabinets in annex, for
   security reasons same sao automatically extinguished.
0
Reply elvis 8/23/2004 6:47:02 PM

Hello,

> vanilla vi's ok up to 160 characters, and he did ask how to enable vi.

F*ck. 9 chars to wide. :-0

	term-type   size         user interface           window
	---------- ------- ---------- ----------------- ----------
	xterm-debi 169x58    sithglan@/dev/pts/35         7(i00u)       rwx

> (There are better choices than Sun's vi of course, but I'd prefer to answer
> his question than add new ones).

Agreed.

	Thomas
0
Reply Thomas 8/23/2004 6:48:43 PM

Hello,

> Doesn't everyone do this with "map" commands in their .exrc ?

nope. it's the default as Thomas has already pointed out.

	Thomas
0
Reply Thomas 8/23/2004 6:49:36 PM

Chris Vidal wrote:
> SunOS action9 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V240
> 
> How to I enable vi as my default command line editor and keep the back space
> from echoing ^H instead of moving the cursor back one Char.
> 
> 
> Tks
> 
> Chris
> vidalch_1@yahoo.com
> 
> 
> 

$ stty erase \^h
$ vi myfile

0
Reply Roger 8/24/2004 4:40:09 AM

Chris Vidal wrote:

> SunOS action9 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V240
> 
> How to I enable vi as my default command line editor and keep the back space
> from echoing ^H instead of moving the cursor back one Char.

I suspect that all the previous responses have misunderstood the 
question. I think he wants to use vi *command-line editing mode* within 
his shell. And of course the answer to that depends on the shell, but 
for ksh and bash it's "set -o vi".

-- 
Thanks,
M.Biswas
0
Reply Mohun 8/24/2004 10:37:39 AM

Mohun Biswas wrote:
> Chris Vidal wrote:
> 
>> SunOS action9 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Fire-V240
>>
>> How to I enable vi as my default command line editor and keep the back 
>> space
>> from echoing ^H instead of moving the cursor back one Char.
> 
> 
> I suspect that all the previous responses have misunderstood the 
> question. I think he wants to use vi *command-line editing mode* within 
> his shell. And of course the answer to that depends on the shell, but 
> for ksh and bash it's "set -o vi".
> 

I agree, but if you read the OP's post, the phrase "...and keep the back 
space from echoing ^H instead of moving the cursor back one Char..." is 
a double-negative (if not also grammatically incorrect). How do you keep 
something from happening, instead of doing something else? Maybe the 
backspace key should print the word "banana" or something :-)

Definitely set -o vi and stty erase ^H is prob the OP's answer...

0
Reply Beardy 8/24/2004 12:05:31 PM

10 Replies
914 Views

(page loaded in 0.095 seconds)

Similiar Articles:













7/19/2012 6:30:34 PM


Reply: