Get rid of `realpath` dependency
user938271 responded to my Stack Exchange question with a Vimscript-only solution. I think it still needs to have some kinks worked out, but it’s basically this (written to be Vim 8.0 compatible):
function! relatifile#vimrelative(path, curfile) let head_of_curfile = fnamemodify(a:curfile, ':h') . '/' if stridx(a:path, head_of_curfile) == 0 return substitute(a:path, head_of_curfile, '../', '') endif return '../' . relatifile#vimrelative(a:path, fnamemodify(a:curfile, ':h')) endfunction
It also needs some changes to match the
relatifile#relative(names, dir) signature.
Deleting a branch is permanent. It CANNOT be undone. Continue?