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.
-
Does this answer your question? [Customizing the line separating windows](https://emacs.stackexchange.com/questions/43669/customizing-the-line-separating-windows) – Drew Jul 10 '22 at 16:26
2 Answers
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? – Emmanuel Goldstein Jul 10 '22 at 11:33
-
-
1
-
-
1I 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-...`. – Jul 12 '22 at 11:35
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
.