Ⅰ. 插件描述
Time your editing durationⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'chrisbra/buftimer'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'chrisbra/buftimer'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'chrisbra/buftimer'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/chrisbra/buftimer
Ⅳ. 文档说明
BufTimer
Time your editing duration
This small plugin uses Vims reltime feature, to measure how long you spend editing your files.
This means, it defines a couple of autocommands to start and stop a timer per buffer. You can see the timing statistics by using :BufTimer for the current buffer or :BufTimerReport for all buffers (what all buffers mean, depends on the configuration variable g:btrOpt variable).
This plugin is based on Bill McCarthys BufTimer plugin which itself is based on a discussion on the vim mailinglist, but has been further rewritten.
Configuration
There are only some configuration items, to further refine the behaviour of this plugin.
g:btrOpt
This variable determines, which buffers it will consider when outputting the:BufTimerReportstatistics. Values:- 0 consider all existing buffers,
- 1 consider only listed buffers,
- 2 consider only loaded buffers.
(default value: 0)
g:buftimer_map
This Variable can be set to a keys combination to trigger the output of the:BufTimerreport. To specify a key mapping, simply put into your .vimrc:
:let g:buftimer_map = "<leader>bt"
(default value: not set)
g:buftimer_report_map
This Variable can be set to a keys combination to trigger the output of the:BufTimerreport. To specify a key mapping, simply put into your .vimrc:
:let g:buftimer_report_map = "<leader>br"
(default value: not set)
g:buf_report_autosave_periodic
This Variable can be set in order to periodicly (in seconds) save report to a file. Simply put into your .vimrc:
:let g:buf_report_autosave_periodic = 1000
(default : disabled)
g:buf_report_autosave_dir
This Variable can be set in order to specify which directory report file will written to
:let g:buf_report_autosave_dir = "/tmp"
(default : /tmp)
Commands
:BufTimerReport the time spent in the current buffer:BufTimerReportPrint a report about the time spent in all buffers.:BufTimerReport filenamePrint a report to file when Vim quits
Installation
Use the plugin manager of your choice. Or download the [Vimball][] version of the plugin, edit it with Vim and simply source it (:so %).
License & Copyright
Based on work by Bill McCarthy. Further developed by Christian Brabandt.
The Vim License applies. See :h license
© 2013 by Christian Brabandt
NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK
