I have assigned the macro !clear && gcc % && ./a.out
to the key 'r'.
So when I press '@r', I expect vim to:
- Clear the shell
- compile the current C file
- run the output
The problem is that it does all three but does not wait at the output screen where it shows "Press ENTER or type command to continue" and comes back to command mode.
@r
so that is a macro and not a map. You have to end the recording of the macro before you press enter at the "hit enter" prompt otherwise that will be part of the macro. (pressq
beforeenter
).@r!clear && seq 200<CR>q
(I useseq
because I don't have your c program and<CR>
is the return key here). The I can later type@r
and it executesseq
again and stops at the hit enter prompt. Did youset more
?set more
command. Will try and confirm. Thanks!