Ambient Theme


Ⅰ. 插件描述

Automatically switch Vim background based on ambient light.

Ⅱ. 基本信息

创建日期:  2011-09-29
使用用户:  1
Github星:  2
插件作者:  Leonid Shevtsov

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'leonid-shevtsov/ambient-theme'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'leonid-shevtsov/ambient-theme'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'leonid-shevtsov/ambient-theme'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/leonid-shevtsov/ambient_theme.vim

Ⅳ. 文档说明

Set your vim theme's background based on the ambient lighting

This plugin requires OS X, and the prebuilt binary requires OS X > 10.5

Method of operation

It switches the background variable from light to dark. Works smoothly with solarized.

Limitations

Vim doesn't have a timer. So this uses a hack which only works in Normal mode.
That means the theme will switch after you exit Insert mode.

Installing

As usual; the plugin is Pathogen-compatible.

Configuration

g:AmbientLightThreshold is the sensor value which triggers the switch. The default is 100000; you can experiment yourself if you want.

echo g:AmbientLightValue will let you see the current value.

Compiling the binary yourself

There's a binary that reads the light sensor value. You'll need gcc to compile it. Otherwise, it's as simple as:

make clean; make
    • *

Leonid Shevtsov

添加新评论