Wikia

Vim Tips Wiki

Adjust display brightness in Mac OS X

Talk0
1,599pages on
this wiki
Revision as of 08:51, April 26, 2012 by JohnBeckett (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Recently created tip

We have not yet decided whether to keep this tip as its own page or merge it somewhere else. If you have a suggestion on the tip content, please edit this page or add your comments below (do not use the discussion page).

Please discuss whether to keep this as a new tip, or whether to merge it into an existing tip, on the new tips discussion page.
created March 8, 2012 · complexity basic · version 7.0

This tip adjusts the brightness of the display when Vim gains or loses focus on Mac OS X systems. This is not related to the brightness of the colorscheme.

ProcedureEdit

I like my display on full brightness with a dark colorscheme when coding. When switching from full screen Vim to a browser window or a terminal, the display settings make the screen far too bright. To avoid that, the following procedure sets the screen brightness to full when Vim gains focus, then sets the screen to half brightness when Vim loses focus.

Download the command line brightness tool from here.

Then add the following commands to your vimrc.

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

CommentsEdit

Tip could be improved if the tool were improved to report the current brightness setting so it can be restored. 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 is full screened).

Advertisement | Your ad here

Photos

Add a Photo
103photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki