Ⅰ. 插件描述
Automatically set background on local sunrise/sunset time.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'amdt/sunset'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'amdt/sunset'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'amdt/sunset'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/Sunset
Ⅳ. 文档说明
Sunset
Project Status
This project is unmaintained and archived. Feel free to exercise your right under the license to fork this
project.
Introduction
Sunset automatically sets background when the sun rises and sets, and also
when you start Vim. When the sun is up, or rises, it'll set background=light
and when the sun is down, or sets, it'll set background=dark.
Sunset can also change your colorscheme, your [Powerline
theme](https://github.com/Lokaltog/vim-powerline), or anything else you can
think of. See Sunset_daytime_callback() and Sunset_nighttime_callback() in
the documentation for details.
So as not to interrupt you, Sunset waits for four seconds (on the CursorHold
event) after you've pressed a key or left insert mode before changing the
- If you change your background during the day or night, it'll
- that.
You must set some options in your .vimrc for Sunset to work, so please read
on for details.
If you feel that Sunset can be improved, pull requests (on the develop
branch, please) and issues are appreciated and humbly requested.
Installation
If you don't already have a preferred installation method, I recommend
installing Vundle. Once done, add the
declaration for Sunset to your .vimrc:
Bundle 'amdt/sunset'And install:
:BundleInstallNote: other installation methods are detailed in the included
documentation.
Requirements
- Sunset requires Vim 7.3
- Vim compiled with
+floatsupport. Use:versionto check if this feature
is available in your build. Requires a system with
strftime(), with the following format options:%jreturns the current day of the year.%Hreturns the current hour of the day in 24-hour time.%Mreturns the current minute of the hour.
Note: If your system's strftime() differs, please [open an issue on the
project's GitHub page](https://github.com/amdt/sunset/issues) with details.
Recommended:
- A colorscheme with light and dark variants, such as
Solarized or
Configuration
Note: If you push your dotfiles to (for example) GitHub, please see the
section titled 'A Reminder on Privacy'.
g:sunset_latitude & g:sunset_longitude
The latitude and longitude of your location in decimal. Values North and East
must be positive values, those South and West must be negative.
London, for example, lies at 51 degrees, 30 minutes North; and 7 minutes West.
In decimal, this is 51.5 degrees North, 0.1167 degrees West.
If you lived in London, you might set these options as follows:
let g:sunset_latitude = 51.5
let g:sunset_longitude = -0.1167If you lived in Tokyo (35 degrees, 40 minutes and 12 seconds North; 139
degrees, 46 minutes and 12 seconds East), you might set these options as
follows:
let g:sunset_latitude = 35.67
let g:sunset_longitude = 139.8Note: Don't forget, negative values South and West.
g:sunset_utc_offset
The difference in hours between your timezone and Coordinated Universal Time.
For example:
let g:sunset_utc_offset = 0 " London
let g:sunset_utc_offset = 1 " London (British Summer Time)
let g:sunset_utc_offset = 9 " TokyoNote: Sunset does not handle any daylight savings civil times.
A Reminder on Privacy
For those of us who publish our dotfiles on (for example) GitHub etc., please
take this as a gentle reminder that out of habit you might be about to publish
your whereabouts to the greater public. If this concerns you, using the
location of your nearest large city might suffice; Sunset will be plenty
accurate enough.
License
Sunset is distributed under the same terms as Vim itself. See :help license
for details.