Vim never ceases to amaze
I just noticed something very, very neat: the ==
command in Vim. It reindents a line, or a bunch of them if you supply a motion or a visual selection, the way it would have indented them if you had just typed them. There are other neat things more which I could mention here, but I’ll just say that it is very worthwhile to :help changing
and then step through a search on indent
. There is a whole heap of non-obvious things that can save you lots and lots of manual work. Go read.