🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3970

Re: A delete questions in vim

#3970
From: Sven Guckes
Date: Sun, 16 Feb 1997 00:00
21 lines
1439 bytes
ibelooze@runet.edu (Ilya):
> In vim [the command] dfA will delete to and including "A" character on a
> line in the command mode. How do I do the same thing globally - to every
> line in the file?

The command deletes to the next 'A' - so it depends on the current position.
As this is not defined I assume that position in column 0 is wanted.

	:%s/^.*A//

Well, this will delete to the last  'A' in every line.
This one should delete to the first 'A' of every line:

	:%s/^.*A[^A]*$//

> Is there a simpler solution in emacs or with sed?

	sed -e "s/^.*A//" file > outfile

Sven
Technical Details
Message-ID: <slrn5gej4g.18l.guckes@banach.math.fu-berlin.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <5e6c42$ou7@newslink.runet.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f8c9b,99ce9c1deb2ced06
X-Google-Attributes: gidf8c9b,public
X-Google-Thread: 107393,99ce9c1deb2ced06
X-Google-Attributes: gid107393,public
X-Google-Thread: 102b9a,99ce9c1deb2ced06
X-Google-Attributes: gid102b9a,public
X-Google-Thread: 103b8b,99ce9c1deb2ced06
X-Google-Attributes: gid103b8b,public
From: guckes@banach.math.fu-berlin.de (Sven Guckes)
Subject: Re: A delete questions in vim
Date: 1997/02/16
Message-ID: <slrn5gej4g.18l.guckes@banach.math.fu-berlin.de>
X-Deja-AN: 219197232
References: <5e6c42$ou7@newslink.runet.edu>
X-Newsreader-Info: http://www.math.fu-berlin.de/~guckes/slrn/
Organization: Freie Universitaet Berlin
X-Access: 16 17 19
Reply-To: guckes@math.fu-berlin.de
Newsgroups: comp.editors,comp.emacs,gnu.emacs.help,comp.unix.questions