I have the following macro
let @f='ivoid function (void param^[o {^M^M^[3kwi'
where ^[ represents ESC and ^M new line.
for some reason it does not execute anything after the 3k, I tried replacing the ^[ with a ^O which represents CTRL-O, but instead this made the macro paste some weird text at the end that seemed to come from the help page.
This macro is defined in ~/.vim/ftplugin/c.vim
:help startinsert– Naumann Oct 13 '17 at 00:35.vimrc(vim -U NONE)and see if it works. If it works the problem comes from a setting in your.vimrcand you can debug that using this question. Also to do what you want I would prefer using a snippet than a macro, I use UltiSnips but you can read this question to choose the snippet manager which fits your need. – statox Oct 13 '17 at 11:21