Feel-ix-343 / markdown-oxide

Editor Agnostic PKM: you bring the text editor and we bring the PKM - inspired by and compatible with Obsidian
GNU General Public License v3.0
684 stars 10 forks source link

Allow forced style of markdown-style links. #104

Open jacobb opened 1 month ago

jacobb commented 1 month ago

In Obsidian, if you choose to use Markdown links, you're still able to use [[ to start triggering an autocomplete. Once finished, however, it expands to markdown style. I'd love to have this supported with oxide

Feel-ix-343 commented 1 month ago

Hey!

This is straightforward enough.

RyanGreenup commented 1 month ago

Having just looked at this code, I would actually vote against.

I myself avoid wikilinks in favour of more portable markdown links.

However, this can already be solved with with a snippet:

# ~/.config/nvim/snippets/markdown.snippets

snippet [[ "Wikilink to MD Link" A
    [$2]($1) $0

Or even straight in vim:

" ~/.config/nvim/init.vim
autocmd FileType markdown inoremap [[ [](

Whereas if we add it to the source, we'd either have to:

  1. Modify the completion_text_edit method to return a different format
  2. Possibly (not sure) have this line return Option::None if settings.wikilink_override is True

Either way, it's another config item and more code addressing an issue that vim already handles quite well.

@jacobb Is there a reason this can't be handled with snippets or `imap?

Feel-ix-343 commented 1 month ago

Too add, I remember @sQVe uses snippets for his markdown links.

I think @RyanGreenup brings up a good related point too: we are a pkm not a text editor; this means that things that can be handled by the text editor should.

As always, thanks for the discussion!

jacobb commented 1 month ago

I think these are great points. I do wonder if it's worth thinking about having things like this to store similar requests -- whether that just be in the wiki or some kind of semi-associated plugin.

Feel-ix-343 commented 1 month ago

Yea maybe in #95

RyanGreenup commented 1 month ago

Could also be good to have an FAQ / Design Decisions in #84