----- Mail original -----
> De: "Егор" <negrmen@mail.ru>
> À: "vim_use" <vim_use@googlegroups.com>
> Envoyé: Mardi 5 Novembre 2013 08:26:16
> Objet: Paste with movements
>
> 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"'
Consider defining you own operator ":help map-operator".
The best I could come up with is:
function! s:delete (type)
" I don't know why the motion must be forced to be inclusive with 'v'.
exe "normal! `[dv`]"
endfunction
nnoremap <A-p> Pl:set opfunc=<SID>delete<CR>g@
which defines <Alt-p>{motion} to paste text (before the current poistion, like "P") and delete according to {motion}.
It's not very elegant (pasting is done before the motion is completed, which is confusing), plus it takes two undo's instead of one, but it may be the first step in the right direction.
Best,
Paul
--
--
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.
Tuesday, November 5, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment