A part of the formatting also comes from introducing syntactic elements such as stars to group the code by content. In Vi this can be done in a simple way.
ESQ -> N -> a -> * -> ESQ -> RETURN
where N is the number of stars to be added, e.g. 40, or 78 to indicate the maximum width the code should take up.