0

I installed Doom themes on my Emacs. I would like to know how to manually change the color face of the vertical line that divides different buffers. By default it has a dark color not very undistinguishable from the background.

1

2 Answers 2

0

How to add window-divider settings to a theme

This is how one customizes a theme ... For this example I am using emacs -q and will describe the steps for customizing adwaita theme.

  1. emacs -q
  2. M-x customie-theme RET adwaita RET. Click on customize link.

M-x customie-theme RET adwaita RET`

  1. The customization buffer shows all themed variables. adwaita doesn't provide any customization for window-divider faces or variables.

adwaita has no customization for window-divider

  1. Go to the end of the customization buffer with ESC >, and use Insert Variable and Insert Additional Face to add faces and variabes need. You can also customize their values.

Use Insert Variable and Insert Additional Face

  1. Go to the beginning of the customization buffer with ESC <, and press Save Theme. This is what you will see

Save Theme

  1. On save you will also see a message saying where Emacs is putting the new customization file. In my case Emacs writes the theme settings to /home/whitetrillium/.emacs.d/adwaita-theme.el.

  2. In the same session or different session, do a M-x load-theme RET adwaita RET. This is what you will see. Note the window-divider settings have taken effect.

Adwaita theme with window-divider

  1. FWIW, this is what the customization file for a theme looks like.
(deftheme adwaita
  "Face colors similar to the default theme of Gnome 3 (Adwaita).
The colors are chosen to match Adwaita window decorations and the
default look of the Gnome 3 desktop.")

(custom-theme-set-variables
 'adwaita
 '(window-divider-default-bottom-width 3)
 '(window-divider-default-right-width 3)
 '(window-divider-default-places t)
 '(window-divider-mode t))

(custom-theme-set-faces
 'adwaita
 ;; Existing faces Snipped
 '(window-divider ((t (:foreground "red"))))
 '(default ((((class color) (min-colors 89)) (:background "#EDEDED" :foreground "#2E3436")))))

(provide-theme 'adwaita)



adwaita doesn't provide custom window-dividers. But I see an entry for modus-operandi. So, when you are using custom themes YMMV.


As an aside, I think,

  1. Emacs should display the currently active theme(s) in modeline. I frequently see people looking at screenshots, and asking "What theme?" is that ....
  2. M-x customize-create-theme should interactively query for theme. Right now, the interactive invocation takes no arguments.

If someone is reading this, and if it makes sense, and its worth your while, please take the above requests to emacs-bugs or emacs-devel.

0

To get this

Window Divider Mode

do this

(custom-set-variables
 '(window-divider-default-bottom-width 2)
 '(window-divider-default-places t)
 '(window-divider-default-right-width 2)
 '(window-divider-mode t))

(custom-set-faces
 '(window-divider ((t (:foreground "red")))))

M-x customize-apropos-faces RET window divider

Also look at

(info "(emacs) Window Dividers")

which can be reached through C-h r i window divider

5
  • Thanks, this works! Is this variable specified also in the doom theme files? Jul 10, 2022 at 11:33
  • Also, is there a way to make it thinner? Thanks. Jul 10, 2022 at 12:31
  • 1
    I have updated my previous answer.
    – user31220
    Jul 11, 2022 at 8:40
  • Is it ok to use setq instead of custom-set-variables? Jul 12, 2022 at 8:20
  • 1
    I always prefer to go with custom-set-variabes and custom-set-faces. Emacs writes the emacs-lisp code for me, and I don't have to remember or learn the emacs-lisp syntax. Btw, the answer to question is, in 99.99% of cases it is OK to use setq in place of custom-set-....
    – user31220
    Jul 12, 2022 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.