2019-08-26 00:53:18 +10:00
|
|
|
;;; editor/word-wrap/config.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(defvar +word-wrap-extra-indent 'double
|
2019-10-15 00:51:28 +10:00
|
|
|
"The amount of extra indentation for wrapped code lines.
|
2019-08-26 00:53:18 +10:00
|
|
|
|
|
|
|
When 'double, indent by twice the major-mode indentation.
|
|
|
|
When 'single, indent by the major-mode indentation.
|
|
|
|
When a positive integer, indent by this fixed amount.
|
|
|
|
When a negative integer, dedent by this fixed amount.
|
2019-10-15 00:51:28 +10:00
|
|
|
|
2019-08-26 00:53:18 +10:00
|
|
|
Otherwise no extra indentation will be used.")
|
|
|
|
|
|
|
|
(defvar +word-wrap-disabled-modes
|
|
|
|
'(fundamental-mode so-long-mode)
|
|
|
|
"Major-modes where `+global-word-wrap-mode' should not enable
|
2019-10-15 00:51:28 +10:00
|
|
|
`+word-wrap-mode'.")
|
|
|
|
|
|
|
|
(defvar +word-wrap-visual-modes
|
|
|
|
'(org-mode)
|
|
|
|
"Major-modes where `+word-wrap-mode' should not use
|
|
|
|
`adaptive-wrap-prefix-mode'.")
|
|
|
|
|
|
|
|
(defvar +word-wrap-text-modes
|
|
|
|
'(text-mode markdown-mode markdown-view-mode gfm-mode gfm-view-mode rst-mode
|
|
|
|
latex-mode LaTeX-mode)
|
|
|
|
"Major-modes where `+word-wrap-mode' should not provide extra indentation.")
|
2020-04-29 15:54:21 -04:00
|
|
|
|
|
|
|
(when (memq 'visual-line-mode text-mode-hook)
|
|
|
|
(remove-hook 'text-mode-hook #'visual-line-mode)
|
|
|
|
(add-hook 'text-mode-hook #'+word-wrap-mode))
|