obsidian.nvim
obsidian.nvim copied to clipboard
Match link following with deafault vim bindings.
🚀 The feature, motivation and pitch
It would be awesome if the funcionality of the follow link command, gf, could be expanded to mirror all of vim's builtin "go to file" commands.
I.e:
gFwhich opens at a line number could open at an anchor tag.C-w fandC-w Fto open in a new window.C-w gfandC-w gFto open in a new tab.
Alternatives
An alternative to the gf could be to mirror vims "tag" commands and making use of the builtin jumplist. It would make sense for navigating markdown to work the same as when navigating the vim help docs.
But since the gf binding is already used and that one as far as I know does not use vims jumplist it's probably more intuitive if the same binding does the "same" thing so to speak.
Additional context
#99 Seems to address the capital F functionality of this feature. However if that pull request is implemented and applied to the gf command (making gf now follow anchor links) and then this feature implemented (making gF follow anchor links and gf revert to previous behavior) it might break users own custom configs twice if they are relying on gf having consistent behaviour.
Hey @Natr1x this would be to have. Personally I'd be fine with gf following anchor links, in which case I'd probably never use gF (though I don't use it anyway). But I'm happy to hear other opinions. Of course users could always customize to their liking, so we're talking about what the default behavior should be.
C-w f and C-w gf should be straight-forward to implement already.