create an extension point to let users override wiki page lookups#148
create an extension point to let users override wiki page lookups#148lervag merged 1 commit intolervag:masterfrom
Conversation
|
Thanks for the suggestion and the PR! My initial thought is that you are on to something that looks smart, but that I will probably want to make some adjustments before merging this. I have a busy weekend, so I will not be able to give a detailed response and review until probably Monday or Tuesday, but stay tuned. I will get back to you as soon as I get the time! |
Yay! I'm not a vimscript dev so I was just hacking my way to it working. 💯 Change everything! |
|
I changed this quite abit, but I think it should still work as you want it to. Try the following settings: function! WikiSearchCommand(fname, origin)
if empty(a:fname) | return a:origin | endif
call wiki#paths#pushd(wiki#get_root())
let files = systemlist(printf('fd -e "md" "%s" |tail -n1', a:fname))
call map(files, {_, x -> fnamemodify(x, ':p')})
call wiki#paths#popd()
return get(files, 0, a:fname)
endfunction
let g:wiki_resolver = 'WikiSearchCommand'See |
Intent
I wish to use vim to edit my notes but my main notes editor is https://obsidian.md. They allow fuzzy links like
[[Bunny]]goes to aBunny.mdfile that can exist anywhere in your tree. This is different from wiki.vim link behavior.How
Allow users to define a function named
WikiSearchCommandthat takes wiki_root and fname and outputs the transformed fname.Example usage
In my vimrc to get wiki.vim to support obsidian links: