vim-historic


Ⅰ. 插件描述

This is a simple vim plugin that stores each save vim make to a git repo.

Ⅱ. 基本信息

创建日期:  2011-04-22
使用用户:  1
Github星:  6
插件作者:  Paul Serby

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# Historic - Vim save history using git

This is a simple vim plugin that stores each save vim makes to a git repo. I wrote this because I miss the excellent local history built into Eclipse. Originally I tried vimlocalhistory but we (www.clock.co.uk) are a PHP/JavaScript house and don't have Ruby on all our environments. So I have created a plugin that has as few dependencies as possible.

Requires

  • git
  • bash

Usage

Create a backup of the last save for the current file. If the file hasn't changed then no backup will be made

  :HistoricBackup

Show available revisions for file

  :HistoricList

(Incomplete) Compare the current buffer with a historic version. If you omit revision the latest revision will be used

  :HistoricCompare <Revision>

(Incomplete) Replace the current buffer with a historic version. If you omit revision the latest revision will be used

  :HistoricReplace <Revision>

By default Historic will bind to the save (BufWritePost) of every filetype and run :HistoricBackup. If you would like to disable this function and action the backup manually do the following in you .vimrc.

  let g:historicBackupOnSave = 0

By default Historic will create the backup repo in ~/.vim.backup you can change by defining the location in your .vimrc as below

let g:historicBackupRepoLocation = "~/mycustomlocation"

Credits

Paul Serby

Licence

Licenced under the New BSD License

添加新评论