Perhaps the easiest way to automate arbitrary tasks like these is with records. With recording, you can record any commands that you used first when you correct documentation, and then repeat them very easily.
For example, assuming that the specified documentation is at the beginning of the file:
First use set textwidth=79 so that Vim knows the maximum number of characters per line. Then:
- Press
qq to start recording - Press
gg to go to the beginning of the file - Press
gq} to reformat the documentation block. - Click
:Tabularize - to use your plugin - Press
:bnext to go to the next buffer - Press
q to stop recording.
Now, if you click 1000@q , the entry will be repeated for all buffers opened in vim. You can also just press @q whenever you want to execute it for the current file. Take a look at :help gq and :help q for more information.
source share