I have some boilerplate code in one of my vimscript functions:
" Save register 'a' so we don't clobber it let savereg = @a " Yank the current WORD into register 'a' and save it to 'input' normal "ayiW let input = @a " Restore register 'a' so we don't clobber it let @a = l:savereg " " ... Do work on 'l:input' "
Is there a better way to do what I want? That is, to operate on a
WORD (or any text object, really) without clobbering a register?