Ⅰ. 插件描述
Naming things is NP-hardⅡ. 基本信息
|
Ⅲ. 安装方法
使用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 thatvim 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 yourPATH, 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!
endfunctionAs you can see it's just a straight rip-off of the example that can be found indiff.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
diffhas are supported.