Sunset


Ⅰ. 插件描述

Automatically set background on local sunrise/sunset time.

Ⅱ. 基本信息

创建日期:  2012-10-16
使用用户:  7
Github星:  4
插件作者:  Alastair Touw

Ⅲ. 安装方法

使用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

Ⅳ. 文档说明

GitHub tag GitHub last commit (master) License: Vim

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

  1. If you change your background during the day or night, it'll
  2. 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:

:BundleInstall

Note: other installation methods are detailed in the included
documentation.

Requirements

  • Sunset requires Vim 7.3
  • Vim compiled with +float support. Use :version to check if this feature
    is available in your build.
  • Requires a system with strftime(), with the following format options:

    • %j returns the current day of the year.
    • %H returns the current hour of the day in 24-hour time.
    • %M returns 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

Hemisu.

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.1167

If 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.8

Note: 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 " Tokyo

Note: 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.

添加新评论