summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cask1
-rw-r--r--init.el15
2 files changed, 16 insertions, 0 deletions
diff --git a/Cask b/Cask
index 689a326..14068fa 100644
--- a/Cask
+++ b/Cask
@@ -52,5 +52,6 @@
(depends-on "use-package-chords")
(depends-on "wgrep")
(depends-on "wrap-region")
+(depends-on "writeroom-mode")
(depends-on "yaml-mode")
(depends-on "yasnippet") \ No newline at end of file
diff --git a/init.el b/init.el
index 066afe2..752b703 100644
--- a/init.el
+++ b/init.el
@@ -1625,6 +1625,21 @@
:defer t
:diminish pandoc-mode)
+(use-package writeroom-mode
+ :bind ("C-c r" . writeroom-mode)
+ :config
+ (setq writeroom-restore-window-config t)
+ (setq writeroom-width fill-column)
+
+ (defvar-local km/writeroom-old-truncate-lines nil)
+
+ (defun km/writeroom-setup ()
+ (if writeroom-mode
+ (setq km/writeroom-old-truncate-lines truncate-lines
+ truncate-lines nil)
+ (setq truncate-lines km/writeroom-old-truncate-lines)))
+ (add-hook 'writeroom-mode-hook #'km/writeroom-setup))
+
;;; Language modes