I want to write a vim function that includes pasting from the clipboard (windows if it matters)
I think it should be something like
function MyPastingFunc()
"+p "paste from clipboard
"do more stuff
endfunction
Of course the "+p is just a comment in the .vim file. How can I make this work?
You are looking for the :normal command:
function MyPastingFunc()
"paste from clipboard
normal! "+p
"do more stuff
endfunction
The ! is used to prevent vim also running user mappings that might be part of "+p.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With