diff options
| author | moxie <moxie@3kgcat.fi> | 2026-03-15 10:26:03 +0200 |
|---|---|---|
| committer | moxie <moxie@3kgcat.fi> | 2026-03-15 10:26:03 +0200 |
| commit | 6e2a3e13b565596263fb3f33803acfbd55b1ccd6 (patch) | |
| tree | d4d87be731680d983479c84b77c8f61d1417473a /doc | |
| parent | 0dbe90b719fa7475b33433c4b6f2313d86eef087 (diff) | |
fix: properly handle file:// URLs in open_with_menu
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/muwiki.txt | 23 |
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 |
