Ⅰ. 插件描述
A Vim plugin to keep your eyes safe.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'soywod/vim-keepeye'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'soywod/vim-keepeye'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'soywod/vim-keepeye'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/soywod/vim-keepeye
Ⅳ. 文档说明
# KeepEye
KeepEye is a vim plugin that invites you to take a break after a huge coding session. By default, it will notify you after 25min, with the message at the middle of your status line: SAVE YOUR EYES, TAKE A BREAK.

What's new ?
- 05/30 - add system notification feature for Mac based on terminal-notifier (thanks to @crisidev)
- 05/26 - [BREAKING CHANGES] due to a lot of new features these days, a good refactor was mandatory to maintain more easily this plugin in the future. You will be notified at plugin startup if you use an obsolete option (see plugin/keepeye.vim)
- 05/25 - add support for custom audio player (thanks to @trmendes)
- 05/25 - add lightline.vim integration
- 05/25 - add User hl-group support (thanks to @kristijanhusak)
- 05/25 - add vim-airline integration
- 05/24 - add bell sound feature :bell:
- 05/23 - add system notification feature for Linux (thanks to @stsewd)
Installation
Plug 'soywod/vim-keepeye' " with vim-plugUsage
:KeepEye " to (re)start the timer
:KeepEyeClear " to clear the message and reset the status barConfiguration
Basic configuration
Launch the plugin at vim startup
let g:keepeye_autostart = boolean
" Default v:trueSetup features to activate when reach the timer
let g:keepeye_features = ['bell', 'notification', 'statusline']
" Default ['statusline']
" The bell feature plays a bell song (1)
" The notification feature shows a system notification (2)
" The statusline feature put a message in your statuslineSet the message to show (used by notification and statusline features)
let g:keepeye_message = string
" Default 'SAVE YOUR EYES, TAKE A BREAK'Set the work time
let g:keepeye_timer = integer
" Default 1500 (25min)(1) The default player used is mpv
(2) Only Linux systems are supported for now
Advanced configuration
Use hl user to color the statusline message (1)
let g:keepeye_message_hl_user = integer | v:null
" Default v:nullSet a custom player for the bell feature
let g:keepeye_feature_bell_cmd = string
" Default 'mpv'Set custom player flags for the bell
let g:keepeye_feature_bell_cmd_flags = string
" Default ''Set a custom audio file for the bell
let g:keepeye_feature_bell_audio_path = string
" Default '<PLUGIN_FOLDER>/media/bell.mp3'(1) See examples, or :help hl-User
Examples
To get the message -- BREAK TIME -- with a notification and a bell sound
let g:keepeye_features = ['bell', 'notification']
let g:keepeye_message = '-- BREAK TIME --'To color your statusline in red via the hl group User1
highlight User1 guifg=#ffffff guifb=#ff0000
let g:keepeye_features = ['statusline']
let g:keepeye_message_hl_user = 1To use moc player to ring the bell (instead of mpv)
let g:keepeye_features = ['bell']
let g:keepeye_feature_bell_cmd = 'mocp'
let g:keepeye_feature_bell_cmd_flags = '-l'