[comp.unix.questions] why does vi insist on deleting to big chunks of my precious code???

greyham@hades.ausonics.oz.au (Greyham Stoney) (09/07/90)

I have an intermittent problem with 'vi' under 386/ix 2.0.2, where vi will
suddenly decide to delete every precious handcrafted character in my file
from the cursor right down to EOF. It then deliberately and maliciously
leaves me in insert mode so that doing an "undo" wont get it back.

It seems to happen when the system load is high so that I have several
characters of typeahead waiting for vi to catchup; I yank a line with 'yy',
move up a line with 'k', hit 'P' to insert the line above, perhaps 'x' a few
times to delete some unwanted characters in the newly inserted copy, and
blammo: when vi finally catches up to me, it's blown away everything below the
cursor!.

Has anyone else noticed this sort of thing?. Failing that, what key sequences
(other than ':command's, cos I'm definitely not going near the ':' key) would
cause everything below the cursor to be deleted?. Perhaps I'm hitting one of
these combinations somehow?.

So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.

						thanks, Greyham.
-- 
/*  Greyham Stoney:                            Australia: (02) 428 6476
 *  greyham@hades.ausonics.oz.au - Ausonics Pty Ltd, Lane Cove, Sydney, Oz.
 *		Neurone Server: Brain Cell not Responding.
 */

gt0178a@prism.gatech.EDU (BURNS,JIM) (09/07/90)

in article <1990Sep7.033215.22324@hades.ausonics.oz.au>, greyham@hades.ausonics.oz.au (Greyham Stoney) says:
> So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.

'dG' will do it every time.
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

cpcahil@virtech.uucp (Conor P. Cahill) (09/07/90)

In article <1990Sep7.033215.22324@hades.ausonics.oz.au> greyham@hades.ausonics.oz.au (Greyham Stoney) writes:
>I have an intermittent problem with 'vi' under 386/ix 2.0.2, where vi will
>suddenly decide to delete every precious handcrafted character in my file
>from the cursor right down to EOF. It then deliberately and maliciously
>leaves me in insert mode so that doing an "undo" wont get it back.

This isn't a problem with vi.  What is happening is that you are typing the
sequence for delete-to-end-of-file.

I would bet that you are using a wyse terminal (or something else emulating
a wyse).  The wyse key for delete-to-end-of-file is usually defined in 
terminfo as ESC-y.  If you are editing some data hit the esc key to end the
edit session and then type the y key to yank a line --- POOF --- there goes
the rest  of you file.

My solution is to modify the terminfo entry for whatever terminal type you
are using.  Remove the sequence for delete-to-end-of-file.



-- 
Conor P. Cahill            (703)430-9247        Virtual Technologies, Inc.,
uunet!virtech!cpcahil                           46030 Manekin Plaza, Suite 160
                                                Sterling, VA 22170 

pim@cti-software.nl (Pim Zandbergen) (09/07/90)

gt0178a@prism.gatech.EDU (BURNS,JIM) writes:

>in article <1990Sep7.033215.22324@hades.ausonics.oz.au>, greyham@hades.ausonics.oz.au (Greyham Stoney) says:
>> So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.

>'dG' will do it every time.

No, that will delete from current line to EOF,
ie it will also delete anything up to the cursor on the current line.
-- 
Pim Zandbergen                          domain : pim@cti-software.nl
CTI Software BV                         uucp   : uunet!mcsun!hp4nl!ctisbv!pim
Laan Copes van Cattenburch 70           phone  : +31 70 3542302
2585 GD The Hague, The Netherlands      fax    : +31 70 3512837

ken@dali.gatech.edu (Ken Seefried iii) (09/08/90)

In article <13421@hydra.gatech.EDU> gt0178a@prism.gatech.EDU (BURNS,JIM) writes:
>in article <1990Sep7.033215.22324@hades.ausonics.oz.au>, greyham@hades.ausonics.oz.au (Greyham Stoney) says:
>> So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.
>
>'dG' will do it every time.
>

No, it won't.

'dG' is the "delete line that cursor is on to EOF" command, not delete
from cursor to EOF.

--

	ken seefried iii		ken@dali.gatech.edu

	"Vee haf veyz off making you talk...release da veasles..."

gt0178a@prism.gatech.EDU (BURNS) (09/09/90)

in article <1990Sep7.131933.13321@cti-software.nl>, pim@cti-software.nl (Pim Zandbergen) says:
} gt0178a@prism.gatech.EDU (BURNS,JIM) writes:
}>in article <1990Sep7.033215.22324@hades.ausonics.oz.au>, greyham@hades.ausonics.oz.au (Greyham Stoney) says:
}>> So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.
}>'dG' will do it every time.
} No, that will delete from current line to EOF,

Mea Culpa. Try 'd$jdG'.
-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

gt0178a@prism.gatech.EDU (BURNS) (09/09/90)

in article <1990Sep7.131933.13321@cti-software.nl>, pim@cti-software.nl (Pim Zandbergen) says:
 | gt0178a@prism.gatech.EDU (BURNS,JIM) writes:
 ||in article <1990Sep7.033215.22324@hades.ausonics.oz.au>, greyham@hades.ausonics.oz.au (Greyham Stoney) says:
 ||| So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.
 ||'dG' will do it every time.
 | No, that will delete from current line to EOF,

Mea Culpa. Try 'd$jdG'.

-- 
BURNS,JIM
Georgia Institute of Technology, Box 30178, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt0178a
Internet: gt0178a@prism.gatech.edu

richard@pegasus.com (Richard Foulk) (09/12/90)

>I have an intermittent problem with 'vi' under 386/ix 2.0.2, where vi will
>suddenly decide to delete every precious handcrafted character in my file
>from the cursor right down to EOF. It then deliberately and maliciously
>leaves me in insert mode so that doing an "undo" wont get it back.

No sense giving up just 'cause undo doesn't work!  Try:

	<esc>"1P
or
	<esc>"2P

etc.


-- 
Richard Foulk		richard@pegasus.com

andy@mks.com (Andy Toy) (09/22/90)

In article <1990Sep7.033215.22324@hades.ausonics.oz.au> greyham@hades.ausonics.oz.au (Greyham Stoney) writes:
>So, what's YOUR favourite "delete from cursor to EOF" vi sequence?.

d]] will delete from the cursor to the end of the section (EOF if you
have no sections).  Or d} if you have no paragraphs.
-- 
Andy Toy, Mortice Kern Systems Inc.,       Internet: andy@mks.com
  35 King Street North, Waterloo,       UUCP: uunet!watmath!mks!andy
      Ontario, CANADA N2J 2W9      Phone: 519-884-2251  FAX: 519-884-8861