I'd like to be able to paste text into a buffer and have emacs give a visual confirmation by flashing the region (highlighting and unhighlighting) the text that was pasted in the buffer. Is there an example of how to do this?
There are three ways that I know of:
volatile-highlights
: an external package which gives you visual feedback for many operations, including yanking.pulse
: a built-in library you can leverage to achieve what you want. You can adviceyank
to usepulse-momentary-highlight-region
, for instance.goggles
: another external package. This one usespulse
to do the highlighting. From its README:
This library is the holy counterpart of
evil-goggles
. Another comparable library isvolatile-highlights
, which does not use pulse. By settinggoggle-pulse
tonil
, thegoggles-mode
behaves similarly to thevolatile-highlights-mode
.