Here is a simple example on how to create and populate a table with macro recording in VIM:
------------------------------------------- (a border of a table)
|                    |                    | (columns in a table)
(now you are all set for recording)
qa (start recording macro named 'a')
k (to bring the cursor to the horizontal line)
yy (to copy the line)
j (to go down one line)
p (to paste the horizontal line)
k (to go the the columns )
yy (to copy the columns )
j (to go down one line )
p (to paste the columns )
q (to stop recording)
5@a (will produce a nice table)
(you will need to paste one more horizontal line to finish the bottom border of the table)

Now, of course, you will need to populate the table.
Just do not forget to use: R so you are doing a REPLACE insert, instead of the regualar insert. This will preserve your column width.

Back


Watch the latest videos on YouTube.com