When yanking in vim, there is no visual indication of the yank that you just made. Aside from inspecting the registers, does anyone know of a setting or plugin that will make vim highlight the region of the editor that was just yanked?

Tried googling, but if it's out there, I'm using the wrong phrase to search.

3 Answers
3

You can probably use '[ and '] that mark the beginning and end of the last yanked text but what is your purpose, exactly? Do you want to verify if what you've actually yanked corresponds to what you wanted to yank? Please clarify your question.

What you can do, instead, is reverse the whole process:

use visual mode or visual-line mode to select visually what you want to yank

yank it

This way you know exactly what you are going to yank and you can re-select it with gv.

Apart from yanking word or a line, when you generally know what you yanked, most of the yanks are done via visual or block mode, and in those you know what is yanked because it is selected prior to yanking.

But that aside, like you said, you can view the registers, or you can install a plugin like YankRing (or some of its more simple coutnerparts). It gives you a wonderful feature to quickly (pff, unless you used some multiple clipboard manager, this is a bit harder to explain) switch between yanked texts. You press, p for paste, and from there you choose by let's say Ctrl-p what you want to yank in place. It's an amazingly practical and easy to get used to feature.

I get confused when yanking while using search operators and I'd like to use the surround modifiers ('a' and 'i') more frequently. In those cases, it can be a little confusing about what you've just yanked. YankRing sounds really cool. I'll give it a try.
–
DannoHungJun 19 '12 at 18:11