diff options
| author | moxie <moxie@3kgcat.fi> | 2026-03-13 10:19:09 +0200 |
|---|---|---|
| committer | moxie <moxie@3kgcat.fi> | 2026-03-13 20:28:55 +0200 |
| commit | 716fff3bff92fd9dd67163117f71f52e7a1f5bfd (patch) | |
| tree | a7b60d685a1cfa38bee1deb14f36c0eb93197e50 /README.md | |
| parent | bc2944651f4dabc68d7f34c796400d80ba132016 (diff) | |
chore: update readme/docs
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -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 = { { "<leader>ww", function() require("muwiki").open_index("default") end, desc = "Open wiki index" }, - { "<leader>oo", function() require("muwiki").open_link_with() end, ft = "markdown", desc = "Open link menu to choose external handler" }, { "<CR>", function() require("muwiki").open_link() end, ft = "markdown", desc = "Open wiki link" }, { "<Tab>", function() require("muwiki").next_link() end, ft = "markdown", desc = "Next wiki link" }, { "<S-Tab>", 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 = { { "<CR>", 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 |
