Using fuzzy links AKA wikilinks in org-roam


Added in org-roam 1.2.2. These are my notes from when upgrading to that version.

In this release we support fuzzy links of the form [[roam:Title]], [[roam:*Headline]] and [[roam:Title*Headline]]. Completion for these fuzzy links is supported via completion-at-point.

I think I might need to set up company-at-point. Do I have it out of the box? The double-bracket thing isn't working, anyway.

Hmm, it's because for my ngm-journal-mode, my writing mode that I use for files in my org-roam wiki, I turn it off. I think because it annoyed me with word completions all the time when I was writing. Maybe there's a way to choose which completions company mode does. I'll come back to that… for now I'll just not turn it off.

From this post, How to to get {{Title of the target note}} working with inline autocomplete i…, I can see that

(smartparens-global-mode t)
(setq company-minimum-prefix-length 2)
(setq company-idle-delay 0.25)
(setq company-backends '(company-capf))

works kind of.

But here Inserting Links (Org-roam User Manual) has a different way of doing it.

To easily insert roam links, one may wish to use a package like key-chord.

OK, I installed key-chord by adding to spacemacs extra packages.

dotspacemacs-additional-packages '(... key-chord)

Then add the recommended function from org-roam docs in to my config.

(key-chord-define org-mode-map "[[" #'ngm/insert-roam-link)

(defun ngm/insert-roam-link ()
    "Inserts an Org-roam link."
    (insert "[[roam:]]")
    (backward-char 2))

OK, so that works OK too. If I type [[ quickly, I can then start typing the name of the note and get autocompletion.

I think both of those ways work. I'll stick with the one from the docs.

1 Backlinks

This page last updated: 2020-11-26 Thu 15:53. Map. Recent changes. Source. Peer Production License. Webring: << random >>