gonewest818 / dimmer.el

Interactively highlight which buffer is active by dimming the others.
GNU General Public License v3.0
267 stars 14 forks source link
emacs themes

dimmer.el

Visually highlight the selected buffer.

MELPA Stable MELPA CircleCI

Description

This package provides a minor mode that indicates which buffer is currently active by dimming the faces in the other buffers. It does this nondestructively, and computes the dimmed faces dynamically such that your overall color scheme is shown in a muted form without requiring you to define what is a "dim" version of every face.

dimmer.el can be configured to adjust foreground colors (default), background colors, or both.

Demo

Demo Video

(click thumbnail for higher quality)

Go here to see a gallery of dimmer effects based on different customizations.

Usage Example

 (require 'dimmer)
 (dimmer-configure-which-key)
 (dimmer-configure-helm)
 (dimmer-mode t)

Customization

Configuration

By default dimmer excludes the minibuffer and echo areas from consideration, so that most packages that use the minibuffer for interaction will behave as users expect.

Please submit pull requests with configurations for other packages!

How colors are adjusted

This package chooses a "dimmed" version of the foreground (and/or the background color) of each of your defined faces. It does this by shifting those face some fraction of the way toward the colors defined in the default face.

In spite of the name I chose for this package, the newly adjusted color isn't always "dimmer" that the original. It's more accurate to say we're reducing the contrast of your color theme by bringing the foreground and background colors closer together.

Here are a few examples of that.

Perhaps this all sounds complicated but rest assured that in practice, the dimmed colors will look natural and (most importantly) will be consistent with your selected theme. It'll just seem like the selected buffer "pops" visually compared to the rest.

Troubleshooting

Windows aren't dimming when I switch from one to another.

Do you have different buffers in those windows? It's very common to test this package by installing it, launching emacs, and splitting *scratch* into two windows and then toggling between the two windows. Users may be surprised to find nothing happens.

Why not? This module makes use of the face-remap-* APIs in Emacs, and these APIs work on buffers rather than windows. If you have multiple windows displaying the same buffer they will dim or undim together. Which means, until and unless you switch the other window to a new buffer, you won't see the dimming effect.

If/when Emacs offers the controls I need to do window-specific face remaps, I'll gladly put this feature in. In the meantime, my configuration combines this package with global-hl-line-mode so I still have a visual cue which window is active.

It doesn't dim enough. I can barely see it.

Users of light themes may need to increase dimmer-fraction in order to see the effect. I may someday increase the default.

Dimmed colors sometimes look "wrong". They're getting shifted to the wrong hue.

Try customizing dimmer-use-colorspace and choose RGB instead. Customize this variable and read the documentation in the customization screens for more background on this issue.

License

Copyright (C) 2017-2021 Neil Okamoto

Distributed under the GNU General Public License, Version 3