Ⅰ. 插件描述
Easily create and reformat your RST (reStructuredText) tables as you change cell content.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nvie/vim-rst-tables'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nvie/vim-rst-tables'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nvie/vim-rst-tables'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nvie/vim-rst-tables
Ⅳ. 文档说明
vim-rst-tables
.. image:: http://stillmaintained.com/nvie/vim-rst-tables.png
.. contents:: Contents
:local:
Installation
Install the following packages from PyPI:
- vim_bridge_: This is required for the vim plugin scripts, to call
directly into Python functions.
- vim_bridge_: This is required for the vim plugin scripts, to call
Clone the git repository::
git clone git://github.com/nvie/vim-rst-tables.git cd vim-rst-tablesCopy the file
ftplugin/rst_tables.vimto your~/.vim/ftplugin- If your vim is not already configured to source scripts
- this directory, make sure to add the appropriate command to your
.vimrc::
source "~/.vim/ftplugin/rst_tables.vim"
.. _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. To create the table, press :kbd:`,,c` (or :kbd:`\\c` if vim's
:kbd:`<Leader>` is set to the default value). 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 tableSometimes, 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 :kbd:
,,fto re-flow the table (or :kbd:\\fif vim's
:kbd:<Leader>is set to the default value; see also the:map
command).