Friday, February 1, 2013

Re: Fastest way to swap selections

Le 01/02/2013 15:40, Juanmi a écrit :
> Sorry I thought I was clear. What I mean is to change in the example the mac address in printer host change with laptop host mac address. Change one for another. Something like selecting visually 1 mac, then I go to the next mac and when I select it push a keybinding and the macs addresses interchange their places.

The simpler way I know is:

1) select first text
2) delete with d
3) select second text
4) paste first text with p (this deletes the second text)
5) go back to the first position
6) paste with p

In step 3), if you jump to the second text with "<line>G", you can go
back to the first position in step 5) with a simple ``.

Otherwise, you can still use named register to make sure you make no
mistake.

Best,
Paul

>
> El viernes, 1 de febrero de 2013 14:19:41 UTC+1, Ben Fritz escribió:
>> On Friday, February 1, 2013 5:14:56 AM UTC-6, Juanmi wrote:
>>> Hello all,
>>> I would like to know what are the better/fastest way to swap portions of text. In this case ip address. Imagine I have a dhcp config and want to change a mac address by another:
>>> host printer {
>>> option host-name "epl5900.red-local.net";
>>> hardware ethernet 00:24:2B:65:54:84;
>>> fixed-address 172.16.1.59;
>>> }
>>> host computer {
>>> option host-name "fancylaptop.red-local.net";
>>> hardware ethernet 00:24:2B:65:54:85;
>>> fixed-address 172.16.1.19;
>>> }
>>> What can I do to swap both macs on example?
>>>
>>> Thanks.
>> What do you mean by "swap"?
>>
>> If I were entering a new MAC address by manual edit, I'd just place the cursor on the address, press R, and type it in.
>>
>> If I already have the new MAC address in some other application, I'd copy it, place the cursor on the beginning, press ct; (change text until just before the ';' character) and then CTRL+R followed by + to paste it in.
>>
>> As you can see the action I'd take depends on the situation.
>>
>> So please explain your situation more fully.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment