My personal wiki plugin for Neovim.
Learn how to write Neovim's plugin from [nvim] 0基础nvim插件开发教程.
For me, I just need to convert some text to link, create the note file and open it for all markdown files. So I just write the function Create_Open()
.
Install the plugin with lazy.nvim:
{
"RunfengTsui/wiki.nvim",
lazy = true,
ft = "markdown",
}
After installing it, write reuqire("wiki").setup({})
in the init.lua
file and then you can use it in your markdown file.
Now I just provide one key to create and open markdown note file, you can modify it in setup
:
require("wiki").setup({
open_file = "<leader>ww",
})
- When the
link_text
is different from the filename, use filename norlink_text
. For example, the line is[example1](./example2.md)
. When pressing the key<leader>ww
, create and open the fileexample1.md
previously. Now, it will open the fileexample2.md
after fixing the bug.