# vim-rst-tables **Repository Path**: kvinwang/vim-rst-tables ## Basic Information - **Project Name**: vim-rst-tables - **Description**: No description available - **Primary Language**: Python - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-05-09 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README vim-rst-tables ============== 这是一个reStructuredText的表格编辑的vim插件. 原作地址:https://github.com/nvie/vim-rst-tables 做了以下优化 * 增加中文支持 * 修复光标在第一行不能创建表格的BUG * 增加创建表格模式: * ,,c 创建不带表头的表格 * ,,C 创建带表头的表格 .. 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 https://git.oschina.net/loongw/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.