Adjust your vim color scheme to a light one when it's bright outside! This only works if your running Linux on your Macbook, I think.
Install this:
https://github.com/chriskempson/vim-tomorrow-theme
Then place the above code in your .vimrc
function! AdjustToLight() | |
let lightFile = "/sys/devices/platform/applesmc.768/light" | |
for line in readfile(lightFile, '', 1) | |
let line = substitute(line, '[()]', '', '') | |
let parts = split(line, ',') | |
let light = parts[0] | |
if light > 150 | |
if g:colors_name != "Tomorrow" | |
silent! colorscheme Tomorrow | |
endif | |
else | |
if g:colors_name != "Tomorrow-Night" | |
silent! colorscheme Tomorrow-Night | |
endif | |
endif | |
endfor | |
endfunction | |
augroup Light | |
autocmd! | |
autocmd CursorHold,CursorHoldI,CursorMoved,CursorMovedI * call AdjustToLight() | |
augroup END |
Adjust your vim color scheme to a light one when it's bright outside! This only works if your running Linux on your Macbook, I think.
Install this:
https://github.com/chriskempson/vim-tomorrow-theme
Then place the above code in your .vimrc