Tuesday, November 5, 2013

Re: Paste with movements


On Tue, Nov 5, 2013 at 2:26 AM, Егор <negrmen@mail.ru> wrote:
I have text like this
<a href="http://example.com/" class="test-class">Link</a>
Now I want change link text. Also in buffer I have text I need to set to link. I need to put cursor on "L" paste from buffer with "P" key and then delete text from "L" till "<". Is it possible to paste text with deleting word? It would be great to do like this "pt<" paste till "<". Or if i want change link class, use 'pi"' like 'ci"'

As an alternative to the good suggestions given you can also use the YankRing plugin (http://www.vim.org/scripts/script.php?script_id=1234).

In the use case given above, on the L, when you hit P and then dt<, the delete will cause "Link" to be added to the YankRing.  So now you will have both words in the YankRing.

You can move to a new location and hit p to paste "Link" and <CTRL-P> (or whatever key you choose to map it to) to cycle through the previous values of the YankRing.  So, CTRL-P(revious) give you the value you pasted before "Link", CTRL-N(ext) brings you back to Link.  It is a ring, so you can cycle through all previously captured items.

:YRShow will display the current entries.

HTH,
David

--
--
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: