Tabbi


Ⅰ. 插件描述

Aligns text as a table

Ⅱ. 基本信息

创建日期:  2010-10-16
使用用户:  2
Github星:  1
插件作者:  Daniel Schemala

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin '/tabbi'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle '/tabbi'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug '/tabbi'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Tabbi

Ⅳ. 文档说明

A simple vim plugin that aligns text separated with tabs or two or more whitespaces, so that each part starts in the same column as in the other lines. Similar as a table, but without lines.

Before:
part one        part two     part three
another part one              another part two    another part three

After:
part one                  part two                 part three
another part one    another part two   another part three

Usage: to align the whole buffer, type :Tabbi, for aligning parts type e.g. :10,20Tabbi or use visual mode.

With the function Tabb(<pattern> [<trim> [,<separator]]) it is possible to format the selected lines.
<pattern> is the pattern after which the lines should be formatted, §x or §x-y is replaced by the corresponding column. §- can be used to align the lines like the :Tabbi command.
<trim> is a boolean specifying if the parts are trimmed (default 0).
<sep> is a string or regular expression that specifies the string separating the line into columns. The default is tabs or two or more whitespaces.
See the plugin file for more details.

Before:
part one, part two  ,part three , part four, rest
one  , two , three

-> select the lines and type :call Tabb("§2: §1§- - §3-4", 1, ",")

Result:
part two: part one  - part three , part four
two: one                  - three

添加新评论