Text replacing question

7 views
Skip to first unread message

Omar

unread,
Dec 12, 2009, 12:44:52 PM12/12/09
to vim_use
Hi!

In order to replace one block of text with another I usually follow
the next sequence of commands:

* yank/delete commend
* visual selection
* put

This seems a little long for me. Is there a way to decide which text
to replace without entering into visual mode?

Thanks,
Omar

Chris Jones

unread,
Dec 12, 2009, 6:15:10 PM12/12/09
to vim_use
Replace paragrah 3 by paragraph 1:

{d}� }}}� v}p�

| � cursor in paragraph 1 - delete paragraph 1
| � go to start of paragraph 3
| � select paragraph 3 and replace by paragraph 1

This takes less than a second.

You're not using a mouse by any chance?

:h motion.txt

CJ

Chris Jones

unread,
Dec 12, 2009, 7:42:51 PM12/12/09
to vim_use
On Sat, Dec 12, 2009 at 06:15:10PM EST, Chris Jones wrote:

[..]

> Replace paragrah 3 by paragraph 1:
>
> {d}ą }}}˛ v}pł
>
> | ą cursor in paragraph 1 - delete paragraph 1
> | ˛ go to start of paragraph 3
> | ł select paragraph 3 and replace by paragraph 1

Not sure why the above comes back garbled from googlegroups.com. I've
used superscripts [1,2,3] on a number of mailing lists and this is the
first time I see this happening.

In any case, here's the ASCII version:

{d} }}} v}p

(1) (2) (3)

| (1) cursor in paragraph 1 - delete paragraph 1
| (2) go to start of paragraph 3
| (3) select paragraph 3 and replace by paragraph 1

CJ

Chris Jones

unread,
Dec 15, 2009, 4:49:27 PM12/15/09
to vim_use, cbl...@256bit.org
On Sat, Dec 12, 2009 at 07:42:51PM EST, Chris Jones wrote:
> On Sat, Dec 12, 2009 at 06:15:10PM EST, Chris Jones wrote:
>
> [..]
>
> > Replace paragrah 3 by paragraph 1:
> >
> > {d}ą }}}˛ v}pł
> >
> > | ą cursor in paragraph 1 - delete paragraph 1
> > | ˛ go to start of paragraph 3
> > | ł select paragraph 3 and replace by paragraph 1
>
> Not sure why the above comes back garbled from googlegroups.com. I've
> used superscripts [1,2,3] on a number of mailing lists and this is the
> first time I see this happening.

Christian Brabandt in another thread just had a similar issue.

Apparently, we both use mutt .. wondering if anyone that uses a different
mailer got to see our superscripts ¹, ², ³ in my case, the way they're
supposed to be rendered?

Thanks,

CJ

vi...@selgrad.org

unread,
Dec 15, 2009, 7:19:23 PM12/15/09
to vim_use
Hej!

> > > | ą cursor in paragraph 1 - delete paragraph 1
> > > | ˛ go to start of paragraph 3
> > > | ł select paragraph 3 and replace by paragraph 1
Those were garbled in my Mutt.

> Apparently, we both use mutt .. wondering if anyone that uses a different
> mailer got to see our superscripts ¹, ², ³ in my case, the way they're
> supposed to be rendered?
Those are fine in my Mutt.

Just FYI :)

Cheers,
Kai.

sc

unread,
Dec 15, 2009, 8:17:55 PM12/15/09
to vim...@googlegroups.com
On Tuesday 15 December 2009 06:19:23 pm vi...@selgrad.org wrote:

>
> Those were garbled in my Mutt.
>
> > Apparently, we both use mutt .. wondering if anyone that
> > uses a different mailer got to see our superscripts ¹, ², ³
> > in my case, the way they're supposed to be rendered?
>
> Those are fine in my Mutt.

fine in my Kmail

sc

Chris Jones

unread,
Dec 15, 2009, 10:04:19 PM12/15/09
to vim...@googlegroups.com
They came back OK as well.

Hopefully, this only affects superscripts.

Thanks,

CJ

Spencer Collyer

unread,
Dec 16, 2009, 5:59:27 AM12/16/09
to vim...@googlegroups.com
Yours were fine in Claws, but Christian's were garbled.

--
<<< Eagles may soar, but weasels don't get sucked into jet engines >>>
10:59am up 110 days 17:58, 1 user, load average: 4.01, 20.08, 11.45
Registered Linux User #232457 | LFS ID 11703

John Little

unread,
Dec 16, 2009, 10:38:06 PM12/16/09
to vim_use
Hi

> | ą cursor in paragraph 1 - delete paragraph 1
> | ˛ go to start of paragraph 3
> | ł select paragraph 3 and replace by paragraph 1

Those were garbled in google groups in Firefox. ą = latin small a
with ogonek, ˛ = ogonek, ł = small l with stroke, all Polish letters.

> mailer got to see our superscripts ¹, ², ³  in my case, the way they're

Those are fine.

Cheers

Tony Mechelynck

unread,
Jan 30, 2010, 1:40:05 AM1/30/10
to vim...@googlegroups.com, John Little
On 17/12/09 04:38, John Little wrote:
> Hi
>> | ą cursor in paragraph 1 - delete paragraph 1
>> | ˛ go to start of paragraph 3
>> | ł select paragraph 3 and replace by paragraph 1
>
> Those were garbled in google groups in Firefox. ą = latin small a
> with ogonek, ˛ = ogonek, ł = small l with stroke, all Polish letters.

also (and the same way) when reading list mail as mail on Gmail's POP
server in SeaMonkey (version 2.0.3pre if it makes any difference)

>
>> mailer got to see our superscripts ¹, ², ³ in my case, the way they're
>
> Those are fine.

ditto.

>
> Cheers
>

ą U+0105 LATIN SMALL LETTER A WITH OGONEK
˛ U+02DB SPACING OGONEK
ł U+0142 LATIN SMALL LETTER L WITH STROKE

In ISO-8859-2 ("Central European"), these are respectively encoded as

0xB1, which is plus-minus in Latin1
0xB2, which is superscript-2 in Latin1
0xB3, which is superscript-3 in Latin1

These Latin1 (aka ISO-8859-1) characters are the same in Windows-1252
and also in Latin9 aka ISO-8859-15. All three are "Western" encodings.
None of these bytes is valid in MacRoman AFAIK.

Superscript-1 is 0xB9 in Latin1 (or U+00B9 in Unicode); 0xB9 means š in
ISO-8859-2 (LATIN SMALL LETTER S WITH CARON, which in Unicode would be
U+0161).

I suppose that the OP mistyped ± for ¹, and that for some reason his
mailer or browser converted Latin1 (thinking that it was Latin2) to
UTF-8 (which is declared as the post's encoding in its Content-Type header).


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far
away.

Christian Brabandt

unread,
Jan 30, 2010, 3:53:53 AM1/30/10
to vim...@googlegroups.com
Hi Tony!

On Sa, 30 Jan 2010, Tony Mechelynck wrote:

> I suppose that the OP mistyped � for �, and that for some reason his
> mailer or browser converted Latin1 (thinking that it was Latin2) to
> UTF-8 (which is declared as the post's encoding in its Content-Type
> header).

As this happened to me too, I can assure you, I did not mistype it. They
are saved alright in my outbox. Google groups must have scrambled it,
possibly when adding it's list footer.

regards,
Christian

Tony Mechelynck

unread,
Jan 30, 2010, 6:26:52 AM1/30/10
to vim...@googlegroups.com
On 30/01/10 09:53, Christian Brabandt wrote:
> Hi Tony!
>
> On Sa, 30 Jan 2010, Tony Mechelynck wrote:
>
>> I suppose that the OP mistyped ą for š, and that for some reason his

>> mailer or browser converted Latin1 (thinking that it was Latin2) to
>> UTF-8 (which is declared as the post's encoding in its Content-Type
>> header).
>
> As this happened to me too, I can assure you, I did not mistype it. They
> are saved alright in my outbox. Google groups must have scrambled it,
> possibly when adding it's list footer.
>
> regards,
> Christian
>

It got garbled again. I had typed in UTF-8: ...mistyped [plus-minus] for
[superscript-one]... and after the round-trip to you it comes back as:
...mistyped [a-ogonek] for [s-caron]...

Confusion between Latin1 and Latin2 could have explained it, but my mail
was sent to the list in UTF-8, and yours came back to me in UTF-8 (as
shown by their respective Content-Type headers)... I wonder how your
mutt is set up, or your Vim if you use that to edit mail.

AFAIK there's nothing in this footer which would explain "convert from
UTF-8 to Latin1 then convert the same text from Latin2 to UTF-8".

Best regards,
Tony.
--
A Plan for the Improvement of English Spelling
by Mark Twain

For example, in Year 1 that useless letter "c" would be dropped
to be replased either by "k" or "s", and likewise "x" would no longer
be part of the alphabet. The only kase in which "c" would be retained
would be the "ch" formation, which will be dealt with later. Year 2
might reform "w" spelling, so that "which" and "one" would take the
same konsonant, wile Year 3 might well abolish "y" replasing it with
"i" and Iear 4 might fiks the "g/j" anomali wonse and for all.
Jenerally, then, the improvement would kontinue iear bai iear
with Iear 5 doing awai with useless double konsonants, and Iears 6-12
or so modifaiing vowlz and the rimeining voist and unvoist konsonants.
Bai Iear 15 or sou, it wud fainali bi posibl tu meik ius ov thi
ridandant letez "c", "y" and "x" -- bai now jast a memori in the maindz
ov ould doderez -- tu riplais "ch", "sh", and "th" rispektivli.
Fainali, xen, aafte sam 20 iers ov orxogrefkl riform, wi wud
hev a lojikl, kohirnt speling in ius xrewawt xe Ingliy-spiking werld.

Christian Brabandt

unread,
Jan 30, 2010, 8:18:54 AM1/30/10
to vim...@googlegroups.com
Hi Tony!

On Sa, 30 Jan 2010, Tony Mechelynck wrote:

> It got garbled again. I had typed in UTF-8: ...mistyped [plus-minus] for
> [superscript-one]... and after the round-trip to you it comes back as:
> ...mistyped [a-ogonek] for [s-caron]...
>
> Confusion between Latin1 and Latin2 could have explained it, but my mail
> was sent to the list in UTF-8, and yours came back to me in UTF-8 (as
> shown by their respective Content-Type headers)... I wonder how your
> mutt is set up, or your Vim if you use that to edit mail.

Both are setup to use utf-8 when necessary. The mail was sent with
latin1 since all characters could be displayed using this encoding and
that is how the mail is shown in my sent mailbox.

Besides, this configuration works on many lists flawlessly and has been
tested to support utf-8 and latin1/9 encoding without problems on many
different occasions.

> AFAIK there's nothing in this footer which would explain "convert from
> UTF-8 to Latin1 then convert the same text from Latin2 to UTF-8".

Don't ask me, ask the guys at google. They mangle the mails and break
it.

regards,
Christian

Reply all
Reply to author
Forward
0 new messages