vim-rst-tables
Installation
Install the following packages from PyPI:
- vim_bridge: This is required for the vim plugin scripts, to call directly into Python functions.
Clone the git repository:
git clone git://github.com/nvie/vim-rst-tables.git cd vim-rst-tables
Copy the file ftplugin/rst_tables.vim to your ~/.vim/ftplugin directory
Usage
Creating a new table
Open a reStructuredText file
Create some kind of table outline:
This is paragraph text *before* the table. Column 1 Column 2 Foo Put two (or more) spaces as a field separator. Bar Even very very long lines like these are fine, as long as you do not put in line endings here. Qux This is the last line. This is paragraph text *after* the table.
Put your cursor somewhere in the table.
Press ,,c (to create the table). The output will look something like this:
This is paragraph text *before* the table. +==========+=========================================================+ | Column 1 | Column 2 | +==========+=========================================================+ | Foo | Put two (or more) spaces as a field separator. | +----------+---------------------------------------------------------+ | Bar | Even very very long lines like these are fine, as long | | | as you do not put in line endings here. | +----------+---------------------------------------------------------+ | Qux | This is the last line. | +----------+---------------------------------------------------------+ This is paragraph text *after* the table.
Re-flowing an existing table
Sometimes, you may have a column that contains enough data that your table is a little hard to work with. To fix that kind of problem, you can define the column width you would prefer, and re-flow your table.
- Change the number of "==" signs in the top row of your table to match the column widths you would prefer.
- Put your cursor somewhere in the table.
- Press ,,f to re-flow the table.