aboutsummaryrefslogtreecommitdiff
path: root/doc/muwiki.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc/muwiki.txt')
-rw-r--r--doc/muwiki.txt84
1 files changed, 12 insertions, 72 deletions
diff --git a/doc/muwiki.txt b/doc/muwiki.txt
index 7183e9e..4344a1e 100644
--- a/doc/muwiki.txt
+++ b/doc/muwiki.txt
@@ -21,7 +21,7 @@ muwiki.nvim is a lightweight wiki plugin for Neovim that uses standard
markdown syntax for creating and navigating wiki-style documentation.
Features:~
-- Standard markdown links `[text](url)` - compatible with any markdown renderer
+- Standard markdown links `[text](url)`
- Multiple wiki directories support
- External link handlers for custom URL/file opening
- Automatic templates for new pages
@@ -29,7 +29,7 @@ Features:~
Requirements:~
- Neovim v0.10+
-- Treesitter markdown parser (install with :TSInstall markdown)
+- Treesitter markdown parsers (`:TSInstall markdown markdown_inline`)
==============================================================================
2. INSTALLATION *muwiki-installation*
@@ -38,83 +38,23 @@ Using lazy.nvim:~
>lua
{
url = "https://git.3kgcat.fi/muwiki.nvim",
+ opts = {
+ -- Wiki directories (REQUIRED - configure at least one)
+ dirs = {{ name = 'default', path = '~/wiki' }},
+ },
+ -- No defaults, add your own:
keys = {
{ "<leader>ww", function() require("muwiki").open_index("default") end, desc = "Open wiki index" },
+ { "<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" },
+ { "<CR>", function() require("muwiki").create_link() end, ft = "markdown", mode = "v", desc = "Create wiki link from selection" },
},
- opts = {
- dirs = {
- { name = 'default', path = '~/wiki' },
- },
- index_file = 'index.md',
- date_fmt = '%Y-%m-%d',
- use_template = false,
- use_external_handlers = false,
- external_handlers = {
- {
- name = 'xdg-open',
- cmd = 'xdg-open',
- pattern = '.*',
- },
- },
- text_extensions = { 'md', 'txt' },
- },
- config = function(_, opts)
- local muwiki = require('muwiki')
- muwiki.setup(opts)
-
- local function setup_keymaps()
- local keymap_opts = { buffer = 0, silent = true, nowait = true }
- vim.keymap.set('n', '<CR>', function() muwiki.open_link() end, keymap_opts)
- vim.keymap.set('n', '<Tab>', function() muwiki.next_link() end, keymap_opts)
- vim.keymap.set('n', '<S-Tab>', function() muwiki.prev_link() end, keymap_opts)
- end
-
- vim.schedule(setup_keymaps)
- vim.api.nvim_create_autocmd('BufEnter', {
- pattern = '*.md',
- callback = setup_keymaps,
- })
- end,
- lazy = true,
}
<
==============================================================================
3. CONFIGURATION *muwiki-configuration*
- *muwiki.setup()*
->lua
- require("muwiki").setup({
- -- Wiki directories (REQUIRED - configure at least one)
- dirs = {
- { name = 'default', path = '~/wiki' },
- { name = 'test', path = '~/wiki_test' },
- },
-
- index_file = 'index.md',
- date_fmt = '%Y-%m-%d',
- use_template = false,
- template = [[
----
-title: ${title}
-date: ${date}
----
-]],
-
- use_external_handlers = false,
- -- External handler definitions (see |muwiki-external-handlers|)
- external_handlers = {
- {
- name = 'xdg-open',
- cmd = 'xdg-open',
- pattern = '.*',
- },
- },
-
- -- File extensions to open in Neovim (bypasses external handlers)
- -- Tip: Add binary extensions like 'png' here to open them as hex/text for inspection
- text_extensions = { 'md', 'txt' },
- })
-<
Configuration Options:~
dirs List of wiki directories (required)
@@ -364,7 +304,7 @@ Handler Examples:~
{
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 = '.*',