kakoune: set up package with plugins

This commit is contained in:
Natsu Kagami 2024-09-28 16:18:16 +02:00
parent 983a1fb071
commit f636223a8c
Signed by: nki
GPG key ID: 55A032EB38B49ADB
5 changed files with 375 additions and 0 deletions

View file

@ -0,0 +1,29 @@
hook global WinSetOption filetype=(markdown) %{
map buffer normal <c-b> ": enter-user-mode markdown-menu<ret>"
}
# A menu for common markdown actions
declare-user-mode markdown-menu
map -docstring "Toggle the checkboxes on the same line" global markdown-menu t ": markdown-toggle-checkbox<ret>"
define-command -hidden markdown-toggle-checkbox %{
try %{
execute-keys -draft "xs^\s*- \[( |x)\]<ret>h: markdown-toggle-checkbox-selections<ret>"
}
}
define-command -hidden markdown-toggle-checkbox-selections %{
try %{
execute-keys -draft -itersel ": markdown-toggle-checkbox-one<ret>"
}
}
define-command -hidden markdown-toggle-checkbox-one %{
try %{
execute-keys -draft "sx<ret>r "
} catch %{
execute-keys -draft "s <ret>rx"
}
}