I want to add some text before each return
For example we have :
void* foo (){
if (something){
return A;
}
do_something;
// That return word may be ignored, because it's comment
do_something;
returns(); //It may ignored to
return ;
}
I need :
void* foo (){
if (something){
END;
return A;
}
do_something;
// That return word may be ignored, becouse it's comment
do_something;
returns(); //It may ignored to
END;
return ;
}
I can't build regex for search request. It may looks like "
return"< some text here started with space symbol, or nothing >;<endline>
How I can make it in VIM?
/return^MOEND;^[<80>kd(search "return" and add "END;" before it), and run it 1000 times (withset nowrapscan). Main problem was that/returnsearch word "return" in coments. The main question was "What regex (for "return ;" "return var;" but not "// return") i need write after/to search what i whant? "