I like the smart-indent feature of Vim, it allows me to create well-indented code blocks.
I regularly copy/paste code in to buffers, but that code is often poorly formatted.
What would be ideal is to "re-process" the code through the smart-indent system.
Is such a thing possible?
For example, how would you 'fix' the following code (an extract from a larger block - I don't want to fix each line manually...) :
else
{
m[c] = 5;
Finished = true;
std::cout<<"(ID,R,E)"<<"-->"<<"("<<g[c]<<","<<r[c]<<","<<E1 <<")"<< std::endl;
std::cout << "\n"<<"finish-->" << r[c] << "\t" <<"E1-->"<< E1 <<"\n" ;
}
}