Skip to content

leonid-shevtsov/ambient_theme.vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Automatically switch Vim background based on ambient light.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published