I've found it's common to set opfunc in this manner:
nnoremap <Leader>r :set opfunc=<SID>my_function<CR>g@
With Vim8 supporting lambda functions, is it possible to now set opfunc to a lambda function? The following cursory try did not work:
:set opfunc={-> "test" }
let Q=function("Bar'),set opfunc=Qthoughcall Q()works. – Mass Feb 18 '19 at 18:21let Q = {->execute('quit')} | let &opfunc=get(Q,'name'):) – Mass Feb 18 '19 at 20:45