The following example sets fringe widths globally for all new frames that will be created. I like face-spec-set
, but the recommended approach is to use set-face-attribute
or M-x customize-face
to control color. The width is adjustable to create a thin or thick vertical line on either side of the window.
(add-to-list 'default-frame-alist '(left-fringe . 8))
(add-to-list 'default-frame-alist '(right-fringe . 8))
(face-spec-set 'fringe
'((((class color) (background light))
:background "red")
(((class color) (background dark))
:background "yellow")
(t
:background "cyan")))
The following is a reprint of a prior post of mine in another forum relating to this issue: https://emacs.stackexchange.com/a/5310/2287
There are a few ways to do this -- my preferred method is to set the frame defaults for the fringes:
(set-face-attribute 'fringe nil :background "red")
(add-to-list 'default-frame-alist '(left-fringe . 11))
(add-to-list 'default-frame-alist '(right-fringe . 0))
It is possible to set the windows fringes globally:
(setq-default left-fringe-width 11)
(setq-default right-fringe-width 0)
It is also possible to set the windows fringes locally:
(setq left-fringe-width 11)
(setq right-fringe-width 0)
Here is the doc-string for left-fringe-width
and right-fringe-width
:
Automatically becomes buffer-local when set.
Documentation:
Width of this buffer's left/right fringe (in pixels).
A value of 0 means no left/right fringe is shown in this buffer's window.
A value of nil means to use the left/right fringe width from the window's frame.
Setting this variable does not take effect until a new buffer is displayed
in a window. To make the change take effect, call `set-window-buffer'.
