 
 ;; enable visual line mode always by default
 (global-visual-line-mode t)
+
+;; enable adaptive line wrapping together with visual-line-mode
+(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))
 
 ;; -------------------------------------------------------------------------------------
 ;; TeX options


(leaf-key* "M-r" 'comment-or-uncomment-region-or-line)

(global-unset-key (kbd "M-C-o"))
(global-unset-key (kbd "M-C-;"))


(leaf markdown-mode
  :ensure t)
(leaf multiple-cursors
  :ensure t)

(leaf adaptive-wrap
  :ensure t)

(leaf leaf-key)
