;;; Code: (defun setup-text-mode () "Disable word wrap in text mode." ;(perfect-margin-mode 1) (setq word-wrap t) (require 'flyspell) (flyspell-mode 1) (set-face-attribute 'hl-line nil :box nil) (set-face-attribute 'flyspell-incorrect-face nil :foreground nil :weight 'normal :underline '(:color "red" :style wave)) (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 'text-mode-hook 'setup-text-mode) (require 'ispell) (setq ispell-program-name (executable-find "hunspell") ispell-dictionary "en_US") (provide 'text) ;;; text.el ends here