vim-quickui icon indicating copy to clipboard operation
vim-quickui copied to clipboard

vmap menu 不正常

Open hellowxwworld opened this issue 5 years ago • 2 comments

Noremap 同个 menu, 快捷键按了一个之后就返回,操作正常, 但是 vmap 同个 menu, 按了一个快捷键之后会重新跳出 menu, 跳出的次数跟 menu size 同样多次

hellowxwworld avatar May 12 '20 13:05 hellowxwworld

Please use

xnoremap <Space> :<C-u>call quickui#menu#open()<CR>

to replace

xnoremap <Space> :call quickui#menu#open()<CR>

because for the latter, it will execuate :'<,'>call quickui#menu#open(), it means if you select multi lines, it will execuate the code in each line.

Freed-Wu avatar Sep 15 '20 05:09 Freed-Wu

help :func-range
:fu[nction][!] {name}([arguments]) [range] [abort] [dict] [closure]
			定义 {name} 命名的新函数。函数体在之后的行给出,直到匹
			配的 |:endfunction| 为止。
...
					*:func-range* *a:firstline* *a:lastline*
			如果给出 [range] 参数,则该函数自己能理解并处理行范
			围。该范围通过 "a:firstline" 和 "a:lastline" 定义。如
			果没有 [range],":{range}call" 会在该范围的每一行分别
			执行该函数,每次光标都定位在处理行的行首。见
			|function-range-example|。

会在该范围的每一行分别执行该函数

Freed-Wu avatar Sep 24 '20 08:09 Freed-Wu