sponsor Vim development Vim logo Vim Book Ad

rst tables : rst tables makes editing reStructuredText tables easy. [CJK, Unicode]

 script karma  Rating 13/6, Downloaded by 2478  Comments, bugs, improvements  Vim wiki

created by
Li Chao
 
script type
ftplugin
 
description
reStructuredText tables with improvement of cjk character alignment.
Tables will keep same indent as the first line.
It uses current buffer encoding, and should support any encoding like utf-8 and gbk ...
Usage: (normal mode)
\\c : create table, or fit column to text.
\\f : format table, fit text to column.

This (rst tables) plugin is based on vimscript #3450
It's edited to improve cjk character alignment, also vim_bridge is not needed any more.
Unfortunately, the author abandoned that plugin, so I uploaded this.
The modification was inspired by vimscript #4272.The original script is vimscript #3041.

reStructuredText 表格,支持中文字符对齐,表格按第一行统一缩进。
使用当前文件编码,理论上支持gbk,utf-8等多种字符编码。
用法:(普通模式)
\\c : 创建表格,或是调整列宽适应文本。
\\f : 重新布局,调整文本换行适应列宽。

本插件基于 vimscript #3450 修改,优化中文对齐,移除vim_bridge依赖。因为原作者已经停止维护,所以在此重新上传。
中文字符宽度计算和去掉vim_bridge的依赖的实现,主要参考 vimscript #4272。最原始的插件是 vimscript #3041
 
install details
Place plugin file in .vim/plugin folder.
Your vim must have python interpreter support.

把文件放到你的 .vim/plugin 目录。
vim 需要python支持。
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
rst_tables.vim 0.3.3 2013-04-23 7.0 Li Chao fix bound error in some case;
ignore '\\f' while no table is created yet, and no error message now.
修正某些情况表格边界计算错误;
直接忽略没有表格时的'\\f',避免显示出错信息。
rst_tables.vim 0.3.2 2013-02-27 7.0 Li Chao support table indent, same as first line.
rst_tables.vim 0.3.1 2012-11-29 7.0 Li Chao fix \\f error with texts outside right edge, and create columns.
rst_tables.vim 0.3 2012-11-28 7.0 Li Chao use current buffer encoding instead of utf-8;
restore ReformatTable behavior, to allow manual layout text in a cell.
ip used for rating: 44.220.184.63

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github