Skip to content

Commit

Permalink
[markdown] Add key bindings for edit code block (#16798)
Browse files Browse the repository at this point in the history
* * layers/+lang/markdown/packages.el: Key bindings for edit code block

* [markdown] Fix incorrect ,k key binding

---------

Co-authored-by: Aaron L. Zeng <me@bcc32.com>
  • Loading branch information
sunlin7 and bcc32 authored Jan 17, 2025
1 parent 02db539 commit 381af10
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions layers/+lang/markdown/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'(
company
company-emoji
edit-indirect
emoji-cheat-sheet-plus
gh-md
markdown-mode
Expand Down Expand Up @@ -62,6 +63,16 @@
(defun markdown/post-init-smartparens ()
(add-hook 'markdown-mode-hook #'spacemacs//activate-smartparens))

(defun markdown/init-edit-indirect ()
(use-package edit-indirect
:commands (edit-indirect-abort edit-indirect-commit)
:config
(spacemacs/set-leader-keys-for-minor-mode 'edit-indirect--overlay
dotspacemacs-major-mode-leader-key 'edit-indirect-commit
"c" 'edit-indirect-commit
"a" 'edit-indirect-abort
"k" 'edit-indirect-abort)))

(defun markdown/init-markdown-mode ()
(use-package markdown-mode
:mode
Expand All @@ -88,6 +99,7 @@
(dolist (mode markdown--key-bindings-modes)
(spacemacs/set-leader-keys-for-major-mode mode
;; rebind this so terminal users can use it
"'" 'markdown-edit-code-block
"M-RET" 'markdown-insert-list-item
;; Movement
"{" 'markdown-backward-paragraph
Expand Down

0 comments on commit 381af10

Please sign in to comment.