From ed71b9fa43e9c1cd0c88c0d537c7215c61896767 Mon Sep 17 00:00:00 2001 From: Akhil Wali Date: Sat, 19 Oct 2019 09:41:08 +1300 Subject: [PATCH] Add grip-mode for live GF markdown previews --- modules/lang/markdown/README.org | 2 ++ modules/lang/markdown/config.el | 2 ++ modules/lang/markdown/doctor.el | 4 ++++ modules/lang/markdown/packages.el | 3 +++ 4 files changed, 11 insertions(+) diff --git a/modules/lang/markdown/README.org b/modules/lang/markdown/README.org index 0f0e6c7d4..818a761ef 100644 --- a/modules/lang/markdown/README.org +++ b/modules/lang/markdown/README.org @@ -122,6 +122,8 @@ installed through your OS's package manager: non-evil users). This will open a preview of your compiled markdown document in your browser. +Alternatively, you can use ~grip-mode~ through =+grip=. + * Configuration ** Changing how markdown is compiled When ~markdown-preview~ is invoked (=SPC m b= or =C-c l b=), it consults diff --git a/modules/lang/markdown/config.el b/modules/lang/markdown/config.el index 1dadcecf7..0aaa0002b 100644 --- a/modules/lang/markdown/config.el +++ b/modules/lang/markdown/config.el @@ -69,6 +69,8 @@ capture, the end position, and the output buffer.") "o" #'markdown-open "p" #'markdown-preview "e" #'markdown-export + (:when (featurep! +grip) + "p" #'grip-mode) (:prefix ("i" . "insert") "t" #'markdown-toc-generate-toc "i" #'markdown-insert-image diff --git a/modules/lang/markdown/doctor.el b/modules/lang/markdown/doctor.el index dd1468394..5f96fa53e 100644 --- a/modules/lang/markdown/doctor.el +++ b/modules/lang/markdown/doctor.el @@ -16,3 +16,7 @@ (unless (executable-find cmd) (warn! "Couldn't find %S. markdown-preview command won't work" cmd)))))) + +(when (featurep! +grip) + (unless (executable-find "grip") + (warn! "Couldn't find grip. grip-mode will not work"))) diff --git a/modules/lang/markdown/packages.el b/modules/lang/markdown/packages.el index 47f6a45aa..b8ebb6a13 100644 --- a/modules/lang/markdown/packages.el +++ b/modules/lang/markdown/packages.el @@ -4,3 +4,6 @@ (package! markdown-mode) (package! markdown-toc) (package! edit-indirect) + +(when (featurep! +grip) + (package! grip-mode))