I would like to define a vim macro that breaks for user input at certain times, is this possible?
EDIT: Turns out I ment recordings (q), not macros
It is possible to use the input command in a recording, but it's more trouble than it's worth.
I first mapped insert input escape to a key
:map <F2> a<C-R>=input('input: ')<CR>
then I made this recording in the q register
name:
and pasted it into a new tab
iname: ^[
And after the final escape I pressed <C-V><F2>
making the line:
iname ^[^[OQ
That I yanked back to the q buffer then used the macro, letting me use the input function. It works, but terribly.
Yes. See the function input({prompt}, [, {text} [, {completion}] ])
. There is even
inputdialog({prompt} [, {text} [, {cancelreturn}]])
, for a dialog popup.
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