feat: add Markdown polymode
This commit is contained in:
parent
17a9aed526
commit
102b0fb19c
1 changed files with 35 additions and 0 deletions
35
config.org
35
config.org
|
|
@ -4260,6 +4260,41 @@ Some more convenient leader key bindings would be nice to prevent having to traw
|
|||
"c L" #'lsp-avy-lens)
|
||||
#+end_src
|
||||
|
||||
** Markdown
|
||||
|
||||
#+call: confpkg("Mode: Markdown")
|
||||
|
||||
*** Polymode
|
||||
|
||||
Markdown allows for inserting code from other languages into itself. To make this integration more seamless, we can use the =poly-markdown= package to add syntax highlighting and major mode features of the corresponding language to the buffer.
|
||||
|
||||
#+begin_src emacs-lisp :tangle packages.el
|
||||
(package! poly-markdown)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(add-hook! markdown-mode #'poly-markdown-mode)
|
||||
#+end_src
|
||||
|
||||
**** Agda Polymode
|
||||
|
||||
The Agda integration with Markdown specifically requires some changes to the polymode, as its syntax highlighting scheme is different from the usual =font-lock= system that it expects.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(after! poly-markdown
|
||||
(object-add-to-list
|
||||
poly-markdown-fenced-code-innermode :init-functions
|
||||
(defun ~/polymode-agda2-init-function (_)
|
||||
(when (eq major-mode 'agda2-mode)
|
||||
(font-lock-mode 0)
|
||||
(setq indent-line-function #'indent-relative)))))
|
||||
|
||||
(after! agda2-mode
|
||||
;; This highlighting interferes with Markdown's styling
|
||||
(setq agda2-highlight-faces
|
||||
(assq-delete-all 'background agda2-highlight-faces)))
|
||||
#+end_src
|
||||
|
||||
** Slint
|
||||
|
||||
#+call: confpkg("Mode: Slint")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue