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

Disable when typing commands #1

Closed hkjels closed 6 years ago

hkjels commented 6 years ago

Whenever you type a command, only the tiny command-line is in focus, this doesn't work well with helm, ido etc

gonewest818 commented 6 years ago

The “hiwin” package has a feature where the user can configure a regexp and any buffer whose name matches is never modified. Assuming helm buffers have predictable names, perhaps that would work here too.

hkjels commented 6 years ago

Just tried hiwin. Not nearly as polished appearance, but I think your onto something, because it worked well with helm. I'm also not seeing the same performance-issues with it

gonewest818 commented 6 years ago

If you pull from the master branch you'll see a new configuration variable

(defcustom dimmer-exclusion-regexp nil
  "Regular expression describing buffer names that are never dimmed."
  :type '(regexp)
  :group 'dimmer)

You can set that regexp to match the buffer names of any navigation buffers you don't want dimmed. For example, if helm names all if its buffers like *helm-something* then you could

(setq dimmer-exclusion-regexp "^\*helm-.*\*$")

and they will always be "bright". Probably best to quit and restart emacs after that change.

If there are multiple things you want to exclude you can a "|" to join independent expressions like an "or". The GNU emacs docs has details.

hkjels commented 6 years ago

Works! This is the configuration I ended up with:

(use-package dimmer
  :load-path "~/.eyre/packages/dimmer.el"
  :commands dimmer-activate
  :config (setq dimmer-percent 0.4
                dimmer-exclusion-regexp "^\*")
  :init (dimmer-activate))