0

I'd like to have an operator-pending mapping for paste that works in a way similar to how d or c work.

Something so that I can do pi" which would mean "paste inside quotes".

Is there already a plugin for this or would I have to make one? If there isn't I'll make it, but I was curious in case I could save myself some work. :)

Of course I would make it using Kana's vim-operator-user if I do make it myself.

Thanks for your help. :)

3
  • Similar to this question but looking for a different answer. :) Commented Oct 4, 2014 at 19:14
  • What was wrong with the answer to that question? Commented Oct 4, 2014 at 19:42
  • possible duplicate of Pasting inside delimiters without using visual selection Commented Oct 4, 2014 at 19:42

1 Answer 1

3

I need this so often, I wrote a plugin to simplify and allow maximum speed: ReplaceWithRegister.

This plugin offers a two-in-one gr command that replaces text covered by a {motion} / text object, entire line(s) or the current selection with the contents of a register; the old text is deleted into the black-hole register, i.e. it's gone. It transparently handles many corner cases and allows for a quick repeat via the standard . command. Should you not like it, its page has links to alternatives.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.