In my C code I am dealing with many variables of type
RxMsgType0
RxMsgType1
RxMsgType2
RxMsgType3
...
My Question: Is there a way in VIM by which I can create 4 more variables which follow the same format?
Expected output: [Type Some Command]
RxMsgType4
RxMsgType5
RxMsgType6
RxMsgType7
In the future I would like to pass the
name (RxMsgType assumed here )
number( we assumed 4 here)
as an argument to get the variable names formed.
That is my final aim.
iand so put in your vimrc :let @i='yyp^A'where^Ais the actualCTRL-Acharacter that you can insert with<c-v><c-a>. Than you can do[count]@i. Note that this increases the first number on the line. If you have a more complex line, add a line-motion betweenyypand^Ato place your cursor in the right spot. Also consider looking:help nrformats– perelo Jul 23 '19 at 20:51let @i = "yyp\<C-A>", using double quotes allow using\<...>to refer to keystrokes by name, so no need to insert a special character in vimrc for that. Using a mapping is also possible (though I actually quite like the idea of the dedicated register!) – filbranden Jul 23 '19 at 23:18RxMsgType4toRxMsgType[4]:-P – ChatterOne Jul 24 '19 at 09:10