I have the following mapping in my .vimrc.
:nmap <F5> :<CU>make %:r && ./%:r<CR>
I press F5 in VIM and it compiles, exits VIM and runs my code. When the program terminates, it asks me to "press ENTER or enter a command to continue." Then it displays me on a blank screen with the text (1 of 5): and with the same "press Enter or enter a command to continue." I press Enter and it finally brings me back to VIM. This behavior is consistent across the board. Is there a way to remove either or both of these cases? Perhaps if after completing the program press ENTER twice? If so, how?
EDIT: So, I realized that adding two more <CR> doesn't quite solve the problem. As soon as the program terminates, it IMMEDIATELY returns to VIM, and I do not have time to view the output. Can I do a ME wait match to press the first input, and automatically press the second ENTER after?
source share