aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/muwiki.txt23
1 files changed, 15 insertions, 8 deletions
diff --git a/doc/muwiki.txt b/doc/muwiki.txt
index c22be0f..1542c75 100644
--- a/doc/muwiki.txt
+++ b/doc/muwiki.txt
@@ -204,14 +204,20 @@ Add template for new files~ *muwiki-au
Open with menu example~ *muwiki-autocmd-open-with*
>
- vim.keymap.set('n', '<leader>o', function()
- muwiki.open_with_menu({
- { name = "Zathura", cmd = "zathura", exts = {"pdf"} },
- { name = "swayimg", cmd = "swayimg", exts = {"png", "jpg", "jpeg", "gif", "webp"} },
- { name = "mpv", cmd = "mpv", exts = {"mp4", "mkv", "avi", "mov", "webm"} },
- { name = "xdg-open", cmd = "xdg-open" },
- })
- end, { buffer = true, desc = "Open with..." })
+ 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', '<leader>o', function()
+ muwiki.open_with_menu({
+ { name = "Zathura", cmd = "zathura", exts = {"pdf"} },
+ { name = "swayimg", cmd = "swayimg", exts = {"png", "jpg", "jpeg", "gif", "webp"} },
+ { name = "mpv", cmd = "mpv", exts = {"mp4", "mkv", "avi", "mov", "webm"} },
+ { name = "xdg-open", cmd = "xdg-open" },
+ })
+ end, { buffer = args.buf, desc = "Open with..." })
+ end,
+ })
<
==============================================================================
@@ -220,6 +226,7 @@ Open with menu example~ *muwiki-au
Run |:checkhealth muwiki| to verify:
- Wiki directories are configured and exist
- Treesitter markdown parser is installed
+- Treesitter markdown_inline parser is installed
==============================================================================
RECOMMENDED PLUGINS