I want to know how to judge whether a register is specified or not before press x.
I want to know how to judge whether a register is specified or not before press x.
The name of the register in use is supplied through v:register variable. For instance,
" force plus register if none was supplied (like "unnamedplus" but for "x" only)
nnoremap <expr>x v:register=='"' ? '"+x' : 'x'