Ⅰ. 插件描述
Use RCS to keep a backup version whenever you save a fileⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin '/rcsvers-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle '/rcsvers-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug '/rcsvers-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/rcsvers.vim
Ⅳ. 文档说明
A Vim plugin for automatically saving backup versions in RCS whenever a file is saved. You can compare to any revision as well.
keywords: VCS, version control system, incremental saving, automatic versioning, automatic journalling or journaling, or autosave backups with versions.
The maintainer is Juan Frias (juandfrias at gmail.com)
What's RCS? It's the Revision Control System, a set of programs used for keeping many versions of a file. See http://www.gnu.org/software/rcs/rcs.html
The RCS programs are freely available at http://www.cs.purdue.edu/homes/trinkle/RCS/
Be careful if you really use RCS as your production file control, it will add versions like crazy. See the g:rvMode option to have more control over when a save is added to the revision file.
rcs-menu.vim by Jeff Lanzarotta is handy to have along with this (vimscript #41).
Inspired by savevers.vim by Ed Ralston (vimscript #89).
Mapped Keys:
<Leader>rci This will create an initial RCS file. Only
necessary when you have the script set to
save only when a previous RCS file exists.
<Leader>rlog To access the saved revisions log. This works as
a toggle to quit the revision windows too.
<enter> This will compare the current file to the
revision under the cursor (works only in
the revision log window)
<Leader>older does a diff with the previous version
<Leader>newer does a diff with the next version
You probably want to map these in your _vimrc to something easier to type,
like a function key. Do it like this:
"re-map rcsvers.vim keys
map <F9> rci
map <F8> rlog
map <F5> older
map <F6> newer
You may need to set the following shell(environment) variables, you'll get a warning if so:
user name:
LOGNAME=myusernametimezone:
TZ=EST5EDT
Look here if you have problems with Daylight Saving Time (DST) with RCS after 2007 on Microsoft Windows: http://support.microsoft.com/kb/932590
2013-10-16: Roger says: This seems to have broken between vim 7.3 and vim 7.4, on Windows, when saving versions of files where the file is in a folder with parentheses e.g. ()
Backing out to vim 7.3 fixed the problem.
If you can help figure it out, put something on the wiki page (link at the top of this page)