diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-06-27 02:28:54 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-06-27 15:09:44 +0100 |
commit | 2a7ba982de81f293d4170348852e6592eadc09df (patch) | |
tree | 25ce06e2d6ebd194a181cecbc8de14415019ba7f /Emacs | |
parent | 63f048baccb14ee0fd0ceac2ae6bf639b81be436 (diff) | |
download | dotfiles-2a7ba982de81f293d4170348852e6592eadc09df.tar.gz dotfiles-2a7ba982de81f293d4170348852e6592eadc09df.tar.bz2 dotfiles-2a7ba982de81f293d4170348852e6592eadc09df.zip |
(Emacs/config)+display-fill-column-indicator-mode
This adds a strict column marker for the fill-column, which is nicer
than whitespace-mode's purple text marker (though I have both enabled
of course). Turn it on for only certain modes, and set the fill
column to 80 by default but 70 in text mode buffers (because that's
what I'm used to).
Diffstat (limited to 'Emacs')
-rw-r--r-- | Emacs/.config/emacs/config.org | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 09e7762..6478c2a 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -2157,23 +2157,26 @@ limit), so set it for specific modes need the help. "w" #'whitespace-mode) :hook (before-save-hook . whitespace-cleanup) - (c-mode-hook . whitespace-mode) - (c++-mode-hook . whitespace-mode) - (haskell-mode-hook . whitespace-mode) - (python-mode-hook . whitespace-mode) - (org-mode-hook . whitespace-mode) - (text-mode-hook . whitespace-mode) + ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook org-mode-hook text-mode-hook) + . whitespace-mode) :init - (setq whitespace-style '(face empty spaces tabs newline trailing lines-char - tab-mark) - whitespace-line-column 80)) + (setq whitespace-line-column nil + whitespace-style '(face empty spaces tabs newline trailing lines-char + tab-mark))) #+end_src -** Set auto-fill-mode for all text-modes -Auto fill mode automatically newlines text on 80 characters, which -looks nice and integrates well with Evil's sentence and paragraph text -objects. +** Filling and displaying fills +I like different fill-columns for different modes: text modes should +really use 70 fill columns while code should stick to 80. #+begin_src emacs-lisp -(add-hook 'text-mode-hook #'auto-fill-mode) +(use-package emacs + :init + (setq-default fill-column 80) + (add-hook 'text-mode-hook (proc (setq-local fill-column 70))) + :hook + (text-mode-hook . auto-fill-mode) + ((c-mode-hook c++-mode-hook haskell-mode-hook python-mode-hook + org-mode-hook text-mode-hook) + . display-fill-column-indicator-mode)) #+end_src ** Show-paren-mode Show parenthesis for Emacs |