🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3445

vi (was Vi bashing)

#3445
From: Chris Torek
Date: Fri, 17 Mar 1989 02:13
41 lines
1923 bytes
In article <989@necis.UUCP> adamm@necis.UUCP (Adam Moskowitz) writes:
>Why bother with all the extra work? Mark the beginning of the block with
>"ma", go to the end of the block and type "d`a" and voila! Now go to where
>you want this block of text to be and type "p". No counting lines, only one
>mark, no extra processes. ...

You can mark either the beginning or the end of the block; vi is smart
enough to delete forwards or backwards as appropriate.  (It does not do
this in ex mode, nor in ex commands entered via the `:' command.)
But note that the sequences

	d`a

and

	d'a

give different results:

	'a

means `the line containing mark a', while

	`a

means `the character denoted by mark a'.  So d'a does a line-oriented
delete (takes lines from . to 'a inclusive), but d`a does a character-
oriented delete (takes characters from the one under the cursor to the
one at 'a, half-inclusive---the first character does get deleted, but
the last one does not).  Typically, I find that for large blocks (those
for which I use marks), I want a line-oriented delete.

The same line/character distinction applies to all movement-oriented
commands (d, c, y).  `_', as well as stuttering (dd, cc, yy), denotes
`line oriented, the current line': mnemonic, but hard to type, and it
remains only for backward compatibility.

All of this information can be found in the source code.  :-)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris
Technical Details
Message-ID: <16421@mimsy.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris
References: <4048@ttidca.TTI.COM> <989@necis.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!mimsy!chris
From: chris@mimsy.UUCP (Chris Torek)
Newsgroups: comp.editors
Subject: vi (was Vi bashing)
Message-ID: <16421@mimsy.UUCP>
Date: 17 Mar 89 02:13:59 GMT
References: <4048@ttidca.TTI.COM> <989@necis.UUCP>
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 41