Skip to content

Latest commit

 

History

History
91 lines (75 loc) · 2.75 KB

writing-config.org

File metadata and controls

91 lines (75 loc) · 2.75 KB

Configuration of packages for writing

Use writeroom-mode to have a clutter-free writing environment

(defun on-writeroom-mode-start()
  (progn
    (message "Entering writeroom mode.")
    (company-mode 0)))

(defun on-writeroom-mode-end()
  (progn
    (message "Exiting writeroom mode.")
    (company-mode 1)))

(use-package writeroom-mode
  :defer t
  :bind (("C-c wr" . writeroom-mode))
  :init (progn
          (add-hook 'writeroom-mode-enable-hook 'on-writeroom-mode-start)
          (add-hook 'writeroom-mode-disable-hook 'on-writeroom-mode-end))
  :config
  (setq writeroom-width 70))

Use writegood-mode to avoid clichees and weasel words

(use-package writegood-mode
  :defer t
  :bind (("C-c wg" . writegood-mode)))

Use AUCTeX for LaTeX editing

;; As described in https://github.com/jwiegley/use-package/issues/379
;; and also as found in https://www.reddit.com/r/emacs/comments/7ux1qj/using_auctex_mode_to_sync_latex_documents_and/dto2z02/
(use-package tex-mode
  :defer t
  :ensure auctex
  :init (progn
          (setq TeX-auto-save t)
          (setq TeX-parse-self t)
          (setq-default TeX-master nil)
          (setq TeX-view-program-selection '((output-pdf "PDF Tools"))
          TeX-source-correlate-start-server t)
          (add-hook 'LaTeX-mode-hook 'visual-line-mode)
          (add-hook 'LaTeX-mode-hook 'flyspell-mode)
          (add-hook 'LaTeX-mode-hook 'turn-on-reftex)
          (add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
          (setq reftex-plug-into-AUCTeX t)))

Use company-auctex

Configure company-backends

(defun rp/setup-company-backends ()
  (setq-local company-backends '((company-auctex-labels
                                  company-auctex-bibs
                                  company-auctex-macros
                                  company-auctex-environments
                                  company-auctex-symbols
                                  company-capf))))

Configure company-auctex

(use-package company-auctex
  :commands (company-auctex
             company-auctext-labels
             company-auctest-bibs
             company-auctex-macros
             company-auctext-symbols
             company-auctext-environments)
  :defer t
  :hook
  (tex-mode . rp/setup-company-backends))

Use olivetti-mode for a nice wrapping of the text in page

(use-package olivetti
  :defer t)