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.
2 Answers
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.
emacs -q
M-x customie-theme RET adwaita RET
. Click oncustomize
link.
- The customization buffer shows all themed variables.
adwaita
doesn't provide any customization forwindow-divider
faces or variables.
- Go to the end of the customization buffer with
ESC >
, and useInsert Variable
andInsert Additional Face
to add faces and variabes need. You can also customize their values.
- Go to the beginning of the customization buffer with
ESC <
, and pressSave Theme
. This is what you will see
On save you will also see a message saying where
Emacs
is putting the new customization file. In my caseEmacs
writes the theme settings to/home/whitetrillium/.emacs.d/adwaita-theme.el
.In the same session or different session, do a
M-x load-theme RET adwaita RET
. This is what you will see. Note thewindow-divider
settings have taken effect.
- 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-divider
s. But I see an entry for modus-operandi
. So, when you are using custom themes YMMV.
As an aside, I think,
Emacs
should display the currently active theme(s) in modeline. I frequently see people looking at screenshots, and asking "What theme?" is that ....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
.
To get this
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
-
Thanks, this works! Is this variable specified also in the doom theme files? Jul 10, 2022 at 11:33
-
-
1I have updated my previous answer.– user31220Jul 11, 2022 at 8:40
-
-
1I always prefer to go with
custom-set-variabes
andcustom-set-faces
.Emacs
writes theemacs-lisp
code for me, and I don't have to remember or learn theemacs-lisp
syntax. Btw, the answer to question is, in 99.99% of cases it is OK to usesetq
in place ofcustom-set-...
.– user31220Jul 12, 2022 at 11:35