aboutsummaryrefslogtreecommitdiffstats
path: root/README.rst
blob: 0673d795d80dc4fc9460ba7182edb76e1d30b723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
vim-rst-tables
==============

.. image:: http://stillmaintained.com/nvie/vim-rst-tables.png

Installation
------------
1. Install the following packages from PyPI:

   - vim_bridge_:  This is required for the vim plugin scripts, to call
     directly into Python functions.

2. Clone the git repository::

       git clone git://github.com/nvie/vim-rst-tables.git
       cd vim-rst-tables

3. Copy the file ``ftplugin/rst_tables.vim`` to your ``~/.vim/ftplugin``
   directory

.. _vim_bridge: http://pypi.python.org/pypi/vim_bridge


Usage
-----

Creating a new table
~~~~~~~~~~~~~~~~~~~~

1. Open a reStructuredText file
2. 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.

2. Put your cursor somewhere in the table.
3. 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.

1. Change the number of "==" signs in the top row of your table to match
   the column widths you would prefer.
2. Put your cursor somewhere in the table.
3. Press ``,,f`` to re-flow the table.