make flyspell work nicely with latex

This commit is contained in:
ndwarshuis 2018-10-11 17:08:13 -04:00
parent 1e7f3f1d5d
commit f58ebba0d1
1 changed files with 18 additions and 5 deletions

View File

@ -403,11 +403,17 @@ desktop file exec directive."
(yas-reload-all)) (yas-reload-all))
#+END_SRC #+END_SRC
** flyspell ** flyspell
Obviously I am going to use =helm= when I spellcheck something.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package flyspell-correct-helm (use-package flyspell-correct-helm
:ensure t :ensure t
:after (helm flyspell)) :after (helm flyspell))
#+END_SRC #+END_SRC
Additionally, I want to automatically highlight errors whenever =flyspell-mode= is enabled.
#+BEGIN_SRC emacs-lisp
(add-hook 'flyspell-mode-hook 'flyspell-buffer)
#+END_SRC
** progmode ** progmode
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(add-hook 'prog-mode-hook #'prettify-symbols-mode) (add-hook 'prog-mode-hook #'prettify-symbols-mode)
@ -525,6 +531,11 @@ I like having my lines short and readable (also easier to git). Turn on autofill
(add-hook 'LaTeX-mode-hook #'nd/turn-on-auto-fill-maybe) (add-hook 'LaTeX-mode-hook #'nd/turn-on-auto-fill-maybe)
(add-hook 'LaTeX-mode-hook #'fci-mode) (add-hook 'LaTeX-mode-hook #'fci-mode)
#+END_SRC #+END_SRC
**** flyspell
Spell checking is important for prose
#+BEGIN_SRC emacs-lisp
(add-hook 'LaTeX-mode-hook (lambda () (flyspell-mode 1)))
#+END_SRC
* org-mode * org-mode
** major mode ** major mode
*** general config *** general config
@ -2294,11 +2305,6 @@ ESS has not joined the dark side. Configure similarly to term (see below) where
(add-hook 'evil-insert-state-entry-hook (add-hook 'evil-insert-state-entry-hook
'nd/ess-char-mode-insert nil t))) 'nd/ess-char-mode-insert nil t)))
#+END_SRC #+END_SRC
*** flyspell
#+BEGIN_SRC emacs-lisp
(evil-define-key 'nornal 'flyspell-mode-map
(kbd "C-;") 'flyspell-correct-previous-word-generic)
#+END_SRC
*** collection *** collection
Most packages that don't have an evil version are in this one. I don't like surprises so I set =evil-collection-modes-list= with the modes I actually want. Some of these are further configured below. Most packages that don't have an evil version are in this one. I don't like surprises so I set =evil-collection-modes-list= with the modes I actually want. Some of these are further configured below.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2438,11 +2444,18 @@ These are for mode-specific bindings that can/should be outside of the evil maps
'(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile)) '(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile))
#+END_SRC #+END_SRC
*** helm-prefix *** helm-prefix
Some of these are useful enough that I make give them a direct binding without requiring a prefix. For now this is fine.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(define-key helm-command-prefix (kbd "b") 'helm-bibtex) (define-key helm-command-prefix (kbd "b") 'helm-bibtex)
(define-key helm-command-prefix (kbd "S") 'helm-swoop) (define-key helm-command-prefix (kbd "S") 'helm-swoop)
(define-key helm-command-prefix (kbd "<f8>") 'helm-resume) (define-key helm-command-prefix (kbd "<f8>") 'helm-resume)
#+END_SRC #+END_SRC
Give =f= to =nd/helm-flyspell-correct= instead of =helm-multi-files= and give the latter =F= (used much less).
#+BEGIN_SRC emacs-lisp
(define-key helm-command-prefix (kbd "f") 'helm-flyspell-correct)
(define-key helm-command-prefix (kbd "F") 'helm-multi-files)
#+END_SRC
*** outline-magic *** outline-magic
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(define-key outline-minor-mode-map (kbd "<tab>") 'outline-cycle) (define-key outline-minor-mode-map (kbd "<tab>") 'outline-cycle)