autobahn


Ⅰ. 插件描述

Naming things is NP-hard

Ⅱ. 基本信息

创建日期:  2016-02-06
使用用户:  1
Github星:  6
插件作者:  LemonBoy

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# autobahn
Naming things is NP-hard, apparently.

What

This tiny tool computes the difference between two text files using the same
library that the git tool uses and outputs a short summary in a format that
vim can easily parse.

Why

By using the awesome libxdiff fork to do the diffing we're able to use other
algorithms than the Myers one used by diff, such as the patience one or the
histogram one. The last two algorithms provide slightly less optimized diffs at
the expense of greatly improved readability.

How

Just compile the program using the Makefile provided and place it in your
PATH, that's all you have to do. To get vim use the new harness you just need
to add something like this to your .vimrc

set diffexpr=AutoDiff()
function! AutoDiff()
    let opt = '-1'

    if &diffopt =~ "iwhite"
        let opt .= ' -b '
    endif

    let cmd = join(['!autobahn', opt, v:fname_in, v:fname_new, '>', v:fname_out])
    silent exe cmd | redraw!
endfunction

As you can see it's just a straight rip-off of the example that can be found in
diff.txt, feel free to add more command line switches to the opt and/or
change the default algorithm used. When run with no parameters the program will
output a small usage guide.

Notes

  • Not all the features and command line switches that diff has are supported.

添加新评论