diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 29 |
1 files changed, 8 insertions, 21 deletions
@@ -22,7 +22,7 @@ See `:help muwiki` for complete documentation and configuration options. ```lua vim.pack.add({ - { src = "https://git.3kgcat.fi/muwiki.nvim" } + { src = "https://git.3kgcat.fi/muwiki.nvim", name = "muwiki" } }) ``` @@ -108,21 +108,13 @@ vim.api.nvim_create_autocmd("BufWritePre", { See `:help muwiki-autocmd` for more examples. -## Configuration Options - -### text_extensions - -Controls which file extensions open directly in Neovim when using `file://` links. Files with matching extensions bypass `xdg-open` and open in a Neovim buffer instead. - -**Default:** `{}` (empty - all file:// links open with xdg-open) - -**Format:** Accepts extensions with or without leading dot (e.g., `'txt'` or `'.txt'`) +## Configuration **Example:** ```lua muwiki.setup({ dirs = {{ name = 'default', path = '~/wiki' }}, - -- Open these file types directly in Neovim + -- Open matching file:// links in Neovim instead of xdg-open text_extensions = { 'txt', 'md', 'png' }, }) ``` @@ -131,17 +123,12 @@ This allows you to open binary files like PNG images directly in Neovim for hex **Behavior:** -**xdg-open:** - -- `[Link](https://example.com)` -- `[Link](file:///path/to/file.mp4)` - -**Neovim:** +- `[Link](https://example.com)` → xdg-open (web) +- `[Link](file:///path/to/file.mp4)` → xdg-open (file) +- `[Link](file://../relative/path/to/image.png)` → neovim (file with text_extensions match) +- `[Link](SomePage.md)` → neovim (wiki) -- `[Link](file://../relative/path/to/image.png)` → matches text_extensions -- `[Link](/absolute/path/to/file.txt)` -- `[Link](../relative/path/to/file.txt)` -- `[Link](SomePage.md)` +See `:help muwiki-configuration` for all options. ## Available Actions |
