Vim will repeat the g@
command. Unfortunately, there's no way around this, and as you also cannot access the internal command history, it's impossible to restore the previously issued command. (You could hack something together for custom mappings that rely on repeat.vim, but it won't work for built-in commands.)
The only workaround I can think of is to change the mapping to use the normal y
command, and trigger whatever is part of your "custom yank" afterwards, e.g. via :autocmd
on CursorMoved,CursorHold
.