Vim Tips Wiki
Advertisement

This may be applicable to other operating systems, but here I'm using OS X.

What's this about?

I like my display on full brightness with a dark colorsheme when I'm coding, even late at night. Some people may like other brightness adjustments. Either way, when switching between full screen Vim and browser windows/terminals my retinas would get burnt and I needed to constantly adjust brightness.

I downloaded a command line brightness tool from here: http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/

And then added the following two commands in my Vim.

:au FocusGained * :!brightness 1
:au FocusLost * :!brightness 0.5

Problem solved. Tip can be improved if the tool is improved to report current brightness setting so it could restore it. Also you probably only want this to happen if in fullscreen mode, so could possibly be improved there (if there is a way for Vim to detect it's full screened).

References

http://mattdanger.net/2008/12/adjust-mac-os-x-display-brightness-from-the-terminal/

Comments

Advertisement