How filepaths are currently handled is problematic for the situation OP described. But additionally, given the same feature, that filepath handling also leads to the following inconsistency.
Suppose I have two wiki names myWikiPrsn
and myWikiWork
, pointing to ~/p
and ~/w
respectively. If the file I'm in happens to be in a directory somewhere under ~/p
, then (wn.myWikiPrsn:thisFolderNow/1.md)
tries to open subfolder thisFolderNow
wherever that current file happens to be whereas (wn.myWikiWork:thisFolderNow/1.md)
tries subfolder ~/w/thisFolderNow
and looks for file 1.md
there.
Given the current filepath handling specification there is of course a logic to this (if you're going to jump to ~/w/
from somewhere under ~/p
where else can you jump to?). But having filepath handling that follows, say, a distinction between "relative to root at myWikiPrsn
" vs "relative to current folder" would be very helpful. If I then decide to move the location of the file, its pointer locations would still be correct. Moreover, such filepath handling would then be consistent with how we manipulate files within vi (say when we open files with ":e"). And, an argument could be made for consistency across wn.myWikiPrsn:thisFolderNow/1.md
and wn.myWikiWork:thisFolderNow/1.md
usage.
For those unfamiliar with the concept, my myWikiPrsn
and myWikiWork
are vimwiki names I use to point real locations in my files, via their .path
component. That way when I move my folder locations (to rebalance loads for instance) all I have to do is adjust the two .path
lines in this section of my .vimrc
"Multiple Wikis
" https://opensource.com/article/18/6/vimwiki-gitlab-notes
"
" Use wiki names via :h vimwiki-option-name
" Clone off a default https://github.com/vimwiki/vimwiki/issues/365
let myWikiDefault = {}
let myWikiDefault.syntax = 'markdown'
let myWikiDefault.ext = 'md'
"
let myWikiPrsn = copy(myWikiDefault)
let myWikiPrsn.path = '~/0/Floor/1/VimWiki/'
let myWikiPrsn.name = 'myWikiPrsn'
let myWikiWork.path = '~/0/Light/1/VimWiki'
let myWikiWork.name = 'myWikiWork'
let g:vimwiki_list = [myWikiPrsn, myWikiWork]