summaryrefslogtreecommitdiff
path: root/lisp/text.el
blob: 3ee8e33b9e166512485be3902f95179b26ed5fca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

;;; Code:
(defun setup-text-mode ()
  "Disable word wrap in text mode."
  ;(perfect-margin-mode 1)
  (setq word-wrap t)
  (display-line-numbers-mode -1)
  )

(defun my-perfect-margin-mode-hook()
  (when (and (stringp buffer-file-name)
             (string-match "\\.txt\\'" buffer-file-name))
    (perfect-margin-mode 1))
  )

(use-package perfect-margin
  :ensure t
  :config
  (add-hook 'text-mode-hook 'my-perfect-margin-mode-hook)
  (add-hook 'org-mode-hook 'perfect-margin-mode))

(add-hook 'text-mode-hook 'setup-text-mode)
(use-package ispell
  :ensure t
  :config
  (setq ispell-program-name (executable-find "hunspell")
        ispell-dictionary "en_US")
  )

(use-package flyspell
    :ensure t
    :hook (text-mode . flyspell-mode)
    :config
    (set-face-attribute 'hl-line nil
                        :box nil)
    (set-face-attribute 'flyspell-incorrect-face nil :foreground nil :weight 'normal :underline '(:color "red" :style wave))
    )

(provide 'text)
;;; text.el ends here