vimscript:如果未指定寄存器,则映射x“ xx

问题描述 投票:1回答:1

我想知道在按x之前如何判断是否指定了寄存器。‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

我想知道在按x之前如何判断是否指定了寄存器。 ‌ ‍> [

正在使用的寄存器的名称通过v:register变量提供。例如,

" force plus register if none was supplied (like "unnamedplus" but for "x" only) nnoremap <expr>x v:register=='"' ? '"+x' : 'x'

vim neovim
1个回答
0
投票
正在使用的寄存器的名称通过v:register变量提供。例如,
© www.soinside.com 2019 - 2024. All rights reserved.