So, lets say I have a chunk of code
int i = 0; // Do some junk here<cursor is here>
if(i == 0){
blahblahblahblah;
}
blahblahblah;
Is it possible to tell vim that when I hit enter, I want it do result in the following:
int i = 0; // Do some junk here
// <cursor is here>
if(i == 0){
blahblahblahblah;
}
blahblahblah;
I know it will do this for a comment who is on a line all on its own, but I can’t figure out this way.
I don’t know whether there is a plugin for this (but there may be one), but the following mapping should do the trick for adding a line by pressing enter (there are much more ways to add the line though):