lastchange.vim


Ⅰ. 插件描述

automatically set time-stamp on modification

Ⅱ. 基本信息

创建日期:  2002-03-30
使用用户:  2
Github星:  1
插件作者:  Srinath Avadhanula

Ⅲ. 安装方法

使用Vundle管理器安装

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

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

使用NeoBundle管理器安装

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

使用VimPlug管理器安装

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

使用Pathogen管理器安装

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

Ⅳ. 文档说明

this (very) lightweight script automatically updates the time-stamp on a file when you :write it out.
the time-stamp is of the form:
     Last Change: Sat Mar 30 04:00 PM 2002 PST

The script is similar to the example given in :help autocmd, the difference being that the time-stamp already
there is checked. If it is identical to the one being added, then nothing is done. Since the time-stamp
is truncated to the last hour, this ensures that the undo buffer is changed only for :write's every hour.

Set g:timeStampLeader in your ~/.vimrc to change 'Last Change: '
(to 'Last modified: ' for instance)

Use :NOMOD to force the time-stamp to be not updated.
Use :MOD to change it back.

PS: The update only works if the string 'Last Change: ' is found somewhere
in the first 20 lines of the file. Only the first found occurence is processed.

添加新评论