[net.unix] Non-equivalence of targets in vi

ken@turtlevax.UUCP (Ken Turkowski) (01/19/86)

All of the operators in vi can be used with nearly any target with count
modifiers:

   Operators		Targets
     c d y	w W e E b B ( ) { } % ^ $ 0 H M L h j k l
		f<char> F<char> t<char> T<char> <col>| '<mark>

For example, "c2t," will change the text from the cursor position
until the character before the second comma.

I say "nearly", because I can't seem to figure out how to do it with the
section targets [[ and ]].  Suppose I want to delete the next two sections
so that I could put them in a different place.  You'd think that

	d2]]

would be the natural way to express this action, but vi just beeps me.
I've also tried

	2d]]	and	d]2]

to no avail.  Any suggestions?
-- 
Ken Turkowski @ CIMLINC, Menlo Park, CA
UUCP: {amd,decwrl,hplabs,seismo,spar}!turtlevax!ken
ARPA: turtlevax!ken@DECWRL.DEC.COM

carl@bdaemon.UUCP (carl) (01/21/86)

> All of the operators in vi can be used with nearly any target with count
> modifiers:
> 
>    Operators		Targets
>      c d y	w W e E b B ( ) { } % ^ $ 0 H M L h j k l
> 		f<char> F<char> t<char> T<char> <col>| '<mark>

It would help if you would tell us what version of 'vi' you are using.
The sequence ':ve<CR>' should tell you.  With 3.7 and higher I have not had
your problem.

carl@bdaemon.UUCP (carl) (01/21/86)

> All of the operators in vi can be used with nearly any target with count
> modifiers:
> 
> 	...
> 
> For example, "c2t," will change the text from the cursor position
> until the character before the second comma.
> 
> I say "nearly", because I can't seem to figure out how to do it with the
> section targets [[ and ]].  Suppose I want to delete the next two sections
> so that I could put them in a different place.  You'd think that
> 
> 	d2]]
> 
> would be the natural way to express this action, but vi just beeps me.
> I've also tried
> 
> 	2d]]	and	d]2]
> 
> to no avail.  Any suggestions?
> -- 
> Ken Turkowski @ CIMLINC, Menlo Park, CA

My apologies to all for my incorrect reply stating that this problem did
not exist in versions 3.7 and higher.  Not only does it exist, but the
command:

	d]]

cannot be repeated with dot (.).  The clue may be in a footnote in "An
Introduction to Display Editing with Vi", which reads:

	"The [[ and ]] operations require the operation character to be
	doubled because they can move the cursor far from where it
	currently is.  While it is easy to get back with the command ``,
	these commands would still be frustrating if they were easy to hit
	accidentally."

What we may have here is another example of a Berkeley UNIX program which
tries to do things *for* the user but ends up doing it *to* the user.

Again, I apologize for my earlier posting.

Carl