How to enable `fill-column-indicator` on startup
You should remove (setq-default fci-mode t)
.
fci-mode
is not global, so you could use a mode hook. If, for example, your opening document on startup is emacs-lisp-mode
, you could place something like this inside your Preferences.el
file.
(add-hook 'emacs-lisp-mode-hook (lambda ()
(fci-mode 1)
))
You will need to use a mode hook for each major mode; or, you will need to modify fci-mode by adding a global setting.
For anyone who is interested in looking at the source-code, here is the link to the Github repository: https://github.com/alpaker/Fill-Column-Indicator
Don't put ~/.emacs.d
itself in your load-path
. Always use a sub-directory.
e.g.: use ~/.emacs.d/lisp/fill-column-indicator.el
and:
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp"))
(require 'fill-column-indicator)
This library doesn't provide a global minor mode, but you can make one yourself like so:
(define-globalized-minor-mode my-global-fci-mode fci-mode turn-on-fci-mode)
(my-global-fci-mode 1)
or toggle it interactively with M-x my-global-fci-mode
RET
With Emacs 27 comes the display-fill-column-indicator-mode
minor mode, which obsoletes the fill-column-indicator
package. You can add:
(add-hook 'prog-mode-hook (lambda ()
(display-fill-column-indicator-mode)))
to ~/.emacs
to enable it for prog-mode
buffers, or:
(global-display-fill-column-indicator-mode)
to enable it globally. To toggle it, use M-x display-fill-column-indicator-mode
.