File tree Expand file tree Collapse file tree
pack/dist/opt/hlyank/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- *usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 18
1+ *usr_05.txt* For Vim version 9.1. Last change: 2025 Mar 22
22
33 VIM USER MANUAL - by Bram Moolenaar
44
@@ -470,8 +470,8 @@ Load the plugin with this command: >
470470 packadd hlyank
471471<
472472This package briefly highlights the affected region of the last | yank |
473- command. See | 52.6 | for a simplified implementation using the | getregionpos() |
474- function.
473+ command. See | 52.6 | for a simplified implementation using the
474+ | getregionpos() | function.
475475
476476The plugin understands the following configuration variables (the settings
477477show the default values).
@@ -481,7 +481,9 @@ To specify a different highlighting group, use: >
481481<
482482To use a different highlighting duration, use: >
483483 :let g:hlyank_duration = 300
484- <
484+ The unit is milliseconds, and the upper limit is 3000 ms. If you set a value
485+ higher than this, the highlighting duration will be 3000 ms.
486+
485487To highlight in visual mode, use: >
486488 :let g:hlyank_invisual = v:true
487489
Original file line number Diff line number Diff line change 11vim9script
22
33# Highlight Yank plugin
4- # Last Change: 2025 Mar 17
4+ # Last Change: 2025 Mar 22
55
66def HighlightedYank ()
77
88 var hlgroup = get (g: , " hlyank_hlgroup" , " IncSearch" )
9- var duration = get (g: , " hlyank_duration" , 300 )
9+ var duration = min ([ get (g: , " hlyank_duration" , 300 ), 3000 ] )
1010 var in_visual = get (g: , " hlyank_invisual" , true)
1111
1212 if v: event .operator == ? ' y'
1313 if ! in_visual && visualmode () != null_string
1414 visualmode (1 )
1515 return
1616 endif
17- # if clipboard has autoselect (default on linux) exiting from Visual with ESC
18- # generates bogus event and this highlights previous yank
17+ # if clipboard has autoselect (default on linux) exiting from Visual with
18+ # ESC generates bogus event and this highlights previous yank
1919 if &clipboard = ~ ' autoselect' && v: event .regname == " *" && v: event .visual
2020 return
2121 endif
@@ -36,3 +36,4 @@ augroup hlyank
3636 autocmd !
3737 autocmd TextYankPost * HighlightedYank ()
3838augroup END
39+ # vim:sts = 2 :sw = 2 :et :
You can’t perform that action at this time.
0 commit comments