How to insert links with '[[' brackets like logseq or obsidian?

What happened?

I was checking out logseq recently, and honestly the best thing was being able to link to new nodes simply by typing brackets, something like . This is way better than what I currently have in org-roam, where I have to escape insert mode, press SPC n r i, type the name of the link, and then press C-c C-c, then enter insert mode again. Now, linking to nodes by putting their names inside of brackets works in org-roam, but only of the nodes exist, but if they don’t, nothing useful can be done.

What did you expect to happen?

It would be nice to have similar functionality to logseq. I know there has actually been a lot of discussion around this feature, but those were in 2020, i.e. before org roam v2. I was just wondering if it is possible. Although if it is not, the next best thing to do is to bind org-roam-node-insert to something that doesn’t require escaping insert mode (which I learned, is M-SPC m m i by default,was hoping to set it to M-SPC only), which should be easy. Same thing can be said for org-capture-finalize. But I was wondering if there was another solution. I realize that I don’t really have a need to type in anything to a note while I’m typing on something else, so would it be possible to have org-capture-finalize run automatically after I create a node using org-roam-node-insert?

Steps to reproduce

  1. Type some text with double brackets in a roam note. It will show existing nodes, but won’t create a new one.

I’ve something in my config that accomplishes this: literate-dotfiles/config.org at 94c20931131bc779894569aaa5163ef3b65aa80b · Zetagon/literate-dotfiles · GitHub based on Inserting a link after typing “[[” in Org - Kisaragi Hiu

But you could also rely on completion (e.g. company) since org-roam already provides that.

Btw, reproduction is really only relevant for bug reports.

Something like :immediate-finish? (e.g. literate-dotfiles/config.org at 94c20931131bc779894569aaa5163ef3b65aa80b · Zetagon/literate-dotfiles · GitHub) Template elements (The Org Manual)

3 Likes

Thanks a lot for the :immediate-finish tip! As for the first link you posted, that functionality already exists by default, my main problem was with creating new nodes.

It calls org-roam-node-insert though so you should be able to create notes with it.

2 Likes

Oh sorry, I didn’t realize, thank you very much!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.