transposition of characters

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

transposition of characters

Ronan McGlue
ronan
   ^
if cursor is here, whats the key to end up with:

roann
   ^

I keep forgetting this useful command!!!!!
If i get it again im gonna write it down :)

Ronan
Reply | Threaded
Open this post in threaded view
|

Re: transposition of characters

Gareth Oakes-2
Try <ESC>xp.

-G

Ronan wrote:

> ronan
>   ^
> if cursor is here, whats the key to end up with:
>
> roann
>   ^
>
> I keep forgetting this useful command!!!!!
> If i get it again im gonna write it down :)
>
> Ronan

Reply | Threaded
Open this post in threaded view
|

Re: transposition of characters

A.J.Mechelynck
In reply to this post by Ronan McGlue
----- Original Message -----
From: "Ronan" <[hidden email]>
To: <[hidden email]>
Sent: Friday, September 09, 2005 1:26 PM
Subject: transposition of characters


> ronan
>   ^
> if cursor is here, whats the key to end up with:
>
> roann
>   ^
>
> I keep forgetting this useful command!!!!!
> If i get it again im gonna write it down :)
>
> Ronan

transpose two letters with xp
transpose two lines with ddp
transpose two words (starting in the blank space before the first one) with
deep
see ":help characterwise-register" which is the same as ":help
linewise-register".


HTH,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: transposition of characters

John (Eljay) Love-Jensen
In reply to this post by Ronan McGlue
Hi Ronan,

Scenario #1
Transpose two characters, with the cursor on the first character.

BUFFER:
abdce
  ^

PRESS:
xp

RESULT:
abcde
   ^

Scenario #2
Transpose two characters, with the cursor on the second character.

BUFFER:
abdce
   ^

PRESS:
Xp

RESULT:
abcde
   ^

HTH,
--Eljay


Reply | Threaded
Open this post in threaded view
|

Re: transposition of characters

Charles E Campbell Jr
In reply to this post by A.J.Mechelynck
Tony Mechelynck wrote:

> ----- Original Message ----- From: "Ronan" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, September 09, 2005 1:26 PM
> Subject: transposition of characters
>
>
>> ronan
>>   ^
>> if cursor is here, whats the key to end up with:
>>
>> roann
>>   ^
>>
>> I keep forgetting this useful command!!!!!
>> If i get it again im gonna write it down :)
>>
>> Ronan
>
>
> transpose two letters with xp
> transpose two lines with ddp
> transpose two words (starting in the blank space before the first one)
> with deep
> see ":help characterwise-register" which is the same as ":help
> linewise-register".
>

Hello!

Also see http://vim.sourceforge.net/tips/tip.php?tip_id=329, "A map for
swapping words".
The tip also now includes how-tos for swapping characters, paragraphs,
and for visual-region
selected swaps.

Regards,
Chip Campbell