Ⅰ. 插件描述
A Vim plugin for MacBook users that automatically sets the background to light or dark depending on the ambient lightⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'dinduks/vim-holylight'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'dinduks/vim-holylight'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'dinduks/vim-holylight'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/dinduks/vim-holylight
Ⅳ. 文档说明
# Holy Light
What is it?
Using a dark background for Vim (background=dark) is eyes-friendly. But in
luminous environments, it makes text quite hard to read, and it requires setting
the background variable to light.
Holy Light is a Vim plugin for MacBook users that sets that setting automatically
each time a file or buffer is opened.
Installation
Holy Light is Pathogen-friendly.
You simply need to git clone the this repository in your bundle directory, and
reload your Vim configuration (source $MYVIMRC).
How does it work?
The plugin calls the bin/holylight-checker program in order to get the current
ambient light value from the MacBook's sensor.
Depending on the returned value it sets background's value to light or dark.
The binaries' source code can be found here.
Customization
If the setting that sets the background to light or dark doesn't suit you, you can
easily change it.
Simply run the bin/realtime-checker program, then set the g:holylight_threshold
variable to the value that suits you.
The name
It is named after Stratovarius' Holy Light
song.