summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Li <li.davidm96@gmail.com>2018-03-04 19:50:27 -0500
committerDavid Li <li.davidm96@gmail.com>2018-03-04 19:50:27 -0500
commita69b0e1f7eb6b93688d48effb21760d656b4756a (patch)
treebc79106388d9b795d5024b7d39c482c818b70c80
parent1b65da4f0aa16cc0ffe31aa1f105296a51bd133e (diff)
Use adaptive-wrap mode when available
-rw-r--r--init.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/init.el b/init.el
index 438abd4..947011e 100644
--- a/init.el
+++ b/init.el
@@ -258,6 +258,14 @@ This functions should be added to the hooks of major modes for programming."
(setq org-latex-listings t)
;; (add-to-list 'org-latex-packages-alist '("" "listings"))
+;; adaptive-wrap when available
+
+(when (fboundp 'adaptive-wrap-prefix-mode)
+ (defun my-activate-adaptive-wrap-prefix-mode ()
+ "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously."
+ (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1)))
+ (add-hook 'visual-line-mode-hook 'my-activate-adaptive-wrap-prefix-mode))
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.