machakann / vim-highlightedyank

Make the yanked region apparent!
844 stars 22 forks source link

Highlight after yank-code plugin call? #37

Closed danbruegge closed 6 years ago

danbruegge commented 6 years ago

Hi, is there a way to highlight the yanked lines after calling a yank plugin? For example https://github.com/AaronLasseigne/yank-code.

Maybe something like:

vmap <leader>y :YankCode && HightlightedyankHighlight <CR>
machakann commented 6 years ago

Hi, this is actually difficult because it is not always easy to recognize the area where the yank-code plugin yanked. However, only if limited to the key mapping you shown, it is possible after you update vim-highlightedyank (https://github.com/machakann/vim-highlightedyank/commit/26a2ecc1ac08462680074a721c265e42b1c545ba):

xmap <Leader>y :YankCode<CR>:call highlightedyank#highlight#add('HighlightedyankRegion', getpos("'<"), getpos("'>"), 'V', 1000)<CR>

As you can see, it's a bit hacky way and may not be what you want...

danbruegge commented 6 years ago

This is looking good and it works well. Thanks. :)