aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/muwiki.txt21
-rw-r--r--doc/tags2
2 files changed, 23 insertions, 0 deletions
diff --git a/doc/muwiki.txt b/doc/muwiki.txt
index 26faa65..1b5fb24 100644
--- a/doc/muwiki.txt
+++ b/doc/muwiki.txt
@@ -13,6 +13,7 @@ CONTENTS *muwiki-contents*
7.1 Auto-create directories ............................. |muwiki-autocmd-mkdir|
7.2 Add template for new files .......................... |muwiki-autocmd-template|
7.3 Open with menu examples ............................. |muwiki-autocmd-open-with|
+ 7.4 Toggle checkbox ..................................... |muwiki-autocmd-toggle-checkbox|
8. Health Check ............................................ |muwiki-health|
==============================================================================
@@ -173,6 +174,12 @@ muwiki.wiki_root({bufnr}) *muwiki.wiki_root()*
Get the wiki root directory for a buffer.
Returns the path or nil if buffer is not in a wiki.
+muwiki.toggle_checkbox() *muwiki.toggle_checkbox()*
+ Toggle the checkbox at cursor position using treesitter.
+ Also toggles all nested child checkboxes to match the
+ parent's new state. Works when cursor is anywhere on
+ the line.
+
==============================================================================
7. AUTOCOMMANDS & RECIPES *muwiki-autocmd*
@@ -270,6 +277,20 @@ Custom open handler using get_link()~ *muwiki-a
})
<
+Toggle checkbox with Shift+T~ *muwiki-autocmd-toggle-checkbox*
+>
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = "markdown",
+ callback = function(args)
+ if not muwiki.wiki_root(args.buf) then return end
+ vim.keymap.set('n', '<S-t>', muwiki.toggle_checkbox,
+ { buffer = args.buf, desc = "Toggle checkbox" })
+ end,
+ })
+<
+This will toggle the checkbox at cursor position and all nested child
+checkboxes to match the parent's new state.
+
==============================================================================
8. HEALTH CHECK *muwiki-health*
diff --git a/doc/tags b/doc/tags
index 5f52c12..811c082 100644
--- a/doc/tags
+++ b/doc/tags
@@ -25,3 +25,5 @@ muwiki.open_with_menu() muwiki.txt /*muwiki.open_with_menu()*
muwiki.prev_link() muwiki.txt /*muwiki.prev_link()*
muwiki.setup() muwiki.txt /*muwiki.setup()*
muwiki.wiki_root() muwiki.txt /*muwiki.wiki_root()*
+muwiki.toggle_checkbox() muwiki.txt /*muwiki.toggle_checkbox()*
+muwiki-autocmd-toggle-checkbox muwiki.txt /*muwiki-autocmd-toggle-checkbox*