Skip to content

feat: unlinked mentions and link suggestions #806

@neo451

Description

@neo451

mentioned comment in #792

Two related functions are conceptually counter parts:

Unlinked mentions -> generalized backlinks/references

Obsidian app supports this natively in backlinks tab, under backlinks to current note, it should do this:

  1. use note:reference_ids for note id, file base name and aliases
  2. grep the whole vault for mentions

Link suggestions -> preemptive linking/definition/link resolution

  1. break the current buffer text into words <- not generalizable for cjk text though
  2. build a vault ids list with note:reference_ids and match current buffer text against it
  3. matching issue: same meaning different words like llm LLM Large Language Models will not match well
  4. performance issue can be improved with Add caching #579 or just async scan + cached results + partially update new files

Further idea 1: suggested workflow

  1. both result in a picker list of files or locations in current file
  2. <C-q> to pop the results into quickfix
  3. :cdo s/foo/[[&]]

Further idea 2: suggest as you type mode

like https://github.com/tadashi-aikawa/obsidian-various-complements-plugin

link suggestion could be an option mode once #749 is extensible enough, any sufficiently meaningful link can be shown in completion list

but that could be intrusive for some user, so another route of suggesting could be:

  1. a meaningful link can be hinted first, either a underline like spell checker, or an LSP diagnostic hint, or inlay hint
  2. while on that word user can use feat: LSP code action #664 to turn current word into valid link

Further idea 3: semantic suggestions

to resolve the q3 in link suggestions, we could optionally use llm and semantic search, but this feels more like work for an optional plugin, maybe generalize the "matcher" for links suggestions, by default it can be "exact", or "fuzzy" (with vim.fn.matchfuzzy), but can be override with option providers.

and a dedicated semantic search also deserve its own issue down the line, just very low priority now.

resources:

https://github.com/brianpetro/obsidian-smart-connections
https://github.com/domleca/llm-wiki

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions