Sometimes, if you write "while" or "if" incorrectly and erase it, It's annoying because I have to indent them one by one. There's an automatic indentation in the visual studio Isn't there a function like that in vim?
fun()
{
for(...)
{
for(...)
{
if(...)
{
}
}
}
}
How do I write this code automatically?
c vim code-formatting
gg=G
Try it.
It means that you should proceed with the indentation of the file from beginning to end, and if you open each separately
gg
starts from the top of the file
=
indent,
G
means to run to the end of the file.
© 2025 OneMinuteCode. All rights reserved.