In vimscript, I cannot find the way of saving the return value of the execute function into a variable.
I would like to do the following:
let s = execute(":!echo dani")
echo s
This should return: dani
Vim doesn't accept this. In my setup (using vim-airline and other UI plugins) the screen blanks all content and upon a key press it goes back to normal.
Is it possible in vimscript to save into a variable the return of either a function call, or conversely the return of the execute function?
Thanks SO
let s = execute(":! echo dani") | echo sdoes returndanifor me. maybe you should post your real function call