From 716fff3bff92fd9dd67163117f71f52e7a1f5bfd Mon Sep 17 00:00:00 2001 From: moxie Date: Fri, 13 Mar 2026 10:19:09 +0200 Subject: chore: update readme/docs --- README.md | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 02f4f37..e2d7df1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A lightweight wiki plugin for Neovim using standard markdown syntax. ## Requirements - Neovim v0.10+ -- Treesitter markdown parser (`:TSInstall markdown`) +- Treesitter markdown parsers (`:TSInstall markdown markdown_inline`) ## Features @@ -26,17 +26,11 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim): url = "https://git.3kgcat.fi/muwiki.nvim", opts = { -- Wiki directories (REQUIRED - configure at least one) - dirs = { - { name = 'default', path = '~/wiki' }, - }, - index_file = 'index.md', - use_template = false, - use_external_handlers = false, - create_missing_dirs = false, + dirs = {{ name = 'default', path = '~/wiki' }}, }, + -- No defaults, add your own: keys = { { "ww", function() require("muwiki").open_index("default") end, desc = "Open wiki index" }, - { "oo", function() require("muwiki").open_link_with() end, ft = "markdown", desc = "Open link menu to choose external handler" }, { "", function() require("muwiki").open_link() end, ft = "markdown", desc = "Open wiki link" }, { "", function() require("muwiki").next_link() end, ft = "markdown", desc = "Next wiki link" }, { "", function() require("muwiki").prev_link() end, ft = "markdown", desc = "Previous wiki link" }, @@ -45,13 +39,11 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim): } ``` -**Note:** The `ft = "markdown"` condition ensures keymaps are only active in markdown files. Actions automatically check if the buffer is within a configured wiki directory and do nothing if not. - ## Keymaps Configure keymaps using lazy.nvim's `keys` option or set them up manually: -**Default keymaps (lazy.nvim):** +**Keymaps (lazy.nvim):** ```lua keys = { { "", function() require("muwiki").open_link() end, ft = "markdown" }, @@ -78,11 +70,12 @@ vim.api.nvim_create_autocmd('BufEnter', { Note: Actions check if the buffer is within a configured wiki directory and do nothing if not. **Available actions:** + - `open_link()` - Open link under cursor - `next_link()` - Jump to next markdown link - `prev_link()` - Jump to previous markdown link -- `open_link_with()` - Open link with custom external handler - `create_link()` - Create link from visual selection +- `open_link_with()` - Open link with custom external handler See `:help muwiki-commands` for complete API documentation. @@ -136,7 +129,7 @@ external_handlers = { { name = 'Copy URL', cmd = function(url) - vim.fn.jobstart({ 'wl-copy', url }, { detach = true }) + vim.system({ 'wl-copy', url }, { detach = true }) vim.notify('URL copied to clipboard', vim.log.levels.INFO) end, pattern = '.*', @@ -151,6 +144,7 @@ external_handlers = { ``` **Handler properties:** + - `name` - Display name in the handler menu - `cmd` - Command string or Lua function - `pattern` - Lua pattern(s) to match URLs (string or table of strings; optional, matches all if omitted) @@ -169,6 +163,7 @@ create_missing_dirs = 'notify', -- or 'silent', 'prompt', or false (default) ``` **Options:** + - `false` - Don't create directories (default) - `true` or `'notify'` - Create directories and show notification - `'silent'` - Create directories without notification -- cgit v1.2.3