WikiLinkAdd using fzf-lua
I want to use fzf-lua to pick pages for WikiLinkAdd command. I have followed the fzf-lua examples given in the documentation and reference from the telescope WikiLinkAdd picker but still can't make it work.
Here is what I got:
```lua
local function fzf_link()
fzf.files({
prompt = "Add wiki link>",
cwd = vim.g.wiki_root,
actions = {
["default"] = function(selected)
local note = selected[1]
if not note then
if fzf_data.last_query then
note = fzf_data.last_query
end
end
vim.fn["wiki#link#add"](note, "", {
transform_relative = true,
text = text,
})
end,
},
})
end
```
This will add link with path relative to the wiki root but not relative with the current page. How do I make it work?
Thank you.
关闭于 2025-10-26 10 条评论