70 lines
1.7 KiB
EmacsLisp
70 lines
1.7 KiB
EmacsLisp
;;; text.el --- text mode support -*- lexical-binding: t; -*-
|
|
;;; Commentary:
|
|
;;; Code:
|
|
|
|
(defun user--text-mode-hook ()
|
|
"Text mode hook."
|
|
(user--fundamental-mode-hook)
|
|
|
|
(user/smartparens-enable)
|
|
|
|
(rainbow-delimiters-mode-disable)
|
|
|
|
(validate-setq
|
|
;; Colons are followed by two spaces.
|
|
colon-double-space t
|
|
;; Sentences end after two spaces.
|
|
sentence-end-double-space t
|
|
;; When using fill-paragraph or auto-fill-mode break lines at 120 characters
|
|
;; by default.
|
|
fill-column 120
|
|
;; Indent using spaces.
|
|
indent-tabs-mode nil)
|
|
|
|
(when (user-flyspell-p)
|
|
;; Protect against missing dictionary.
|
|
(try-eval
|
|
;; Run spell-checker in programming mode.
|
|
(flyspell-prog-mode)))
|
|
|
|
(when (and (feature-p 'flycheck-vale)
|
|
(executable-find "vale"))
|
|
(flycheck-vale-setup))
|
|
|
|
;; TODO
|
|
;; (with-feature 'pandoc-mode
|
|
;; (pandoc-mode t))
|
|
|
|
;; Nicely wrap long lines.
|
|
(visual-line-mode t)
|
|
|
|
;;; (Bindings) ;;;
|
|
(user/bind-key-local :code :fill-paragraph 'fill-paragraph))
|
|
|
|
(use-package text-mode
|
|
:ensure nil
|
|
:defer
|
|
:hook (text-mode-hook . user--text-mode-hook)
|
|
:config
|
|
;; https://github.com/abingham/flycheck-vale
|
|
;; Flycheck integration for the vale natural language linter
|
|
(use-package flycheck-vale
|
|
:if (executable-find "vale")
|
|
:config
|
|
;; TODO
|
|
;; (add-to-list 'flycheck-vale-modes 'org-mode)
|
|
)
|
|
|
|
;; https://github.com/zzkt/smog
|
|
;; Analyse the writing style, word use and readability of prose in Emacs.
|
|
(use-package smog
|
|
:if (executable-find "style"))
|
|
|
|
;; https://github.com/emacs-straight/ftable
|
|
;; This package provides some convenient commands for filling a table.
|
|
(use-package ftable))
|
|
|
|
|
|
(provide 'modes/text)
|
|
;;; text.el ends here
|