summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-04-01 22:52:47 -0400
committerKyle Meyer <kyle@kyleam.com>2016-04-01 22:52:47 -0400
commite55f456f968393e30c9ae5371940f6ef2d6d5480 (patch)
tree3af48c9105c4f1d78380cf6457cc30ee3a272c5c
parent1265f00e2b706d8b40a14439ea50b7546f332ece (diff)
downloademacs.d-e55f456f968393e30c9ae5371940f6ef2d6d5480.tar.gz
Install writeroom-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