Ⅰ. 插件描述
Folds changesets, files, and hunks in Mercurial diff outputⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/diff-fold-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/diff-fold-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/diff-fold-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/diff-fold.vim
Ⅳ. 文档说明
Pipe various Mercurial diff output to vim and see changesets, files, and
hunks folded nicely together. In addition to providing folding of diff
text, diff_fold also provides a navigation pane which you can use to more
easily navigate large diffs.
Some examples:
hg in --patch | vim -
hg diff | vim -
hg diff -r 12 -r 13 | vim -
hg export -r 12: | vim -
hg log --patch srcsomefile.cpp | vim -
Navigation pane usage:
The keybinding <Leader>nav will bring up the navigation pane. You can
use the 'Enter' or 'v' keys to either go to, or view whole changsets
or files in the Diff View
If you don't like the default mapping, you can map a new one as
follows:
map {newmap} <Plug>DiffFoldNav
Right now, this pretty much just works with Mercurial diff output. Because Hg can use Git style patches, it does work with some Git output but it is not 100% reliable or useful.
Eventually, I hope to make this work with more version control systems and just about anything that can produce unified diff output.
This plugin has also been made into a pathogen bundle and can be installed with an 'hg clone https://bitbucket.org/thetoast/diff-fold' in your pathogen bundle folder.
In the future, the pathogen bundle may be more up-to-date, but any major updates will be made available here.