orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

Org-roam functionality from within orgmode.nvim

Open megalithic opened this issue 4 years ago • 16 comments

Does this feature exist in Emacs orgmode core?

No

Orgmode link

So, first off, thank you @kristijanhusak for this wonderful plugin! I'm slowly getting into org-mode things, coming from zettelkasten using (https://github.com/mickael-menu/zk and https://github.com/megalithic/zk.nvim).

This isn't necessarily a "feature request" per-say but more of a survey of org-roam usage with orgmode.nvim. I've been looking at now I might be able to port all of my notes from zk land, or more specifically how note linking and related functionality might work here in orgmode.nvim.

Is this something you've ever had interest in? Do you normally just use long-form/long-lived org files? I'd love to hear from other users of this plug-in too.

Feature value

Parity with org-roam, within orgmode.nvim.

Additional context

No response

megalithic avatar Aug 14 '21 02:08 megalithic

I never used Roam or org-roam before. Can you give me brief explanation what are the key features of it?

kristijanhusak avatar Aug 17 '21 11:08 kristijanhusak

Would also love to see some features from org-roam implemented. One of the key things is the ability to create linked notes on demand and be able to view the network of linked files.

Say I have a file shopping.org with contents:

#+TITLE: Shopping List

* Here's what I need to buy:
- Eggs
- Milk
- Bread

org-roam lets me create a second org file with metadata in the header to link back to shopping.org. Say I want to make a note about eggs. I can hit a keybind with my cursor on Eggs and a capture template opens with a prepopulated :PROPERTIES: drawer

:PROPERTIES:
ID: <unique-id>
:END:
#+TITLE: Eggs

%?

shopping.org is then linked to this file using a unique ID

#+TITLE: Shopping list

* Shopping list:
- [[id:<unique-id-to-eggs>][Eggs]]
- Milk
- Bread

When I'm in the linked notes about eggs, I can also access a menu to view backlinks

Eggs     <- current note
Backlinks (1)
Shopping List (top)     <- list of linked files, their hierarchy in the note tree, and their content

* Here's what I need to buy:
- Eggs
- Milk
- Bread

ourigen avatar Aug 18 '21 01:08 ourigen

Since org-roam is a plugin itself for Emacs Orgmode, same thing applies for this. I don't want to support anything in the core, that's a separate plugin in Emacs orgmode. I don't plan to built any support for this since I'm both not familiar with all the functionality, and I don't plan to use it. I'm open for suggestions on #26 for improvements on plugin infrastructure that would help someone else build the plugin.

kristijanhusak avatar Aug 19 '21 12:08 kristijanhusak

Just a bump to let you know that many people who are used to vim/nvim would be happy with this integration which would also let people who for example use Logseq be able to use their favourite editor (nvim) !

krillin666 avatar Aug 31 '21 14:08 krillin666

Another bump up. org-roam is a fantastic quality of life improvement to core org-mode. Would love orgmode.nvim to support this (either in core, or in plugins).

krishnakumarg1984 avatar Dec 29 '21 12:12 krishnakumarg1984

I've been looking at now I might be able to port all of my notes from zk land, or more specifically how note linking and related functionality might work here in orgmode.nvim.

Hey, @megalithic I know this is not related to the issue, but I gotta ask if you managed to port all your notes from zk ? I've been using zk happily for a while and it's great. But I've been looking into using orgmode for notes. The problem is that now all my notes are managed with zk, with all the metadata like notes ID's and tags.

So I'd like to ask if you ported your notes from zk and if so, how did you do it ?

rafamadriz avatar Jan 04 '22 01:01 rafamadriz

Does anyone have experience with org-roam? I would like to have a breakdown of the things that would be needed for someone to build this. I'm planning to start creating an API that would be callable by the plugins, and it would be helpful to know what would be useful for this.

kristijanhusak avatar Jan 05 '22 16:01 kristijanhusak

I've been looking at now I might be able to port all of my notes from zk land, or more specifically how note linking and related functionality might work here in orgmode.nvim.

Hey, @megalithic I know this is not related to the issue, but I gotta ask if you managed to port all your notes from zk ? I've been using zk happily for a while and it's great. But I've been looking into using orgmode for notes. The problem is that now all my notes are managed with zk, with all the metadata like notes ID's and tags.

So I'd like to ask if you ported your notes from zk and if so, how did you do it ?

Man, to be honest, I've only used zk type things; I've wanted to give orgmode a try and more specifically org-roam to potentially take the place of zk-specific things. I have only read about org-roam and watched some vids by "System Crafters" on youtube about it.

megalithic avatar Jan 05 '22 19:01 megalithic

I have a general question to all of this. org-roam uses the org-id library which is part of the org-mode distribution, but it is a module which has to be enabled. Another module which i use is org-habit, also a module which has to be enabled. Will those modules be part of nvim-orgmode aor are they counted as plugins too?

rotlaus avatar Jan 06 '22 12:01 rotlaus

If they are part of the core in emacs orgmode, they can be in core here. So no, those are not counted as plugins.

kristijanhusak avatar Jan 06 '22 12:01 kristijanhusak

Does anyone have experience with org-roam? I would like to have a breakdown of the things that would be needed for someone to build this. I'm planning to start creating an API that would be callable by the plugins, and it would be helpful to know what would be useful for this.

The roam philosophy in general contains atomized building blocks (pieces of text / code) that can be bound together in a graph. It is similar to how wikipedia works; an article may have many (back)links to other articles in the site, together form a knowledge graph. For roam to become a part of this project, I would reckon that it is essential to have a labeling/id system. The org roam mode itself in emacs has features such as

  • org-roam-node-insert
  • org-roam-node-find
  • org-roam-capture

There are additional graph generating functions that can be called, but the "core" is rather small I believe.

cvanelteren avatar May 26 '22 11:05 cvanelteren

Does anyone have experience with org-roam? I would like to have a breakdown of the things that would be needed for someone to build this. I'm planning to start creating an API that would be callable by the plugins, and it would be helpful to know what would be useful for this.

From what I see with a quick glance, the main thing nvim-orgmode lacks (especially if you want compatibility with other org-roam files) is a "custom protocol" handling for links. Is it possible to have a link like [[roam:79e95553-0a5b-4cf4-b2ad-67c418577045][This is a link to another note in my realm]] ?

All the rest is (a lot of) work left for plugin implementers: very pragmatically, org-roam is just a big cache of (id, file path, heading) entries inside a sql database:

  • org-roam-node-insert queries the db for all the headings, passes them to Emacs/vim so the user chooses one, and it inserts a link with the same pattern as above.
  • we need the ability to provide custom link handlers in nvim-orgmode, so that when following a roam: link, eventually the plugin gets called, to query the db for the file path/location of the heading matching the id, returning to nvim to open the relevant buffer
  • Adding and removing properties to files and heading is necessary as well, so that a function can be created to add the id property accordingly

Otherwise, org-roam is mostly about updating the db whenever relevant (a file gets saved, or you just added a link or something), and then wrapping db queries in an API so the requests are easier to make.

If you're curious, the db schema looks like that right now, it holds more data than just id/file path, but that's the idea.

tl;dr: as long as it's possible to add/remove properties to file/headings, and to plug a custom link handler, I think replicating org-roam would be possible (long, but possible).

gagbo avatar Feb 10 '23 22:02 gagbo

I'm trying to clone org-roam for neovim, an ideal goal would be to have one to one feature parity with org-roam.

But in beginning I'm only considering: adding nodes through org-roam-capture and find a node using org-roam-node-find, the part of finding a node is easy and simple but the "capture part" is where things fall apart.

When org-roam creates a new file node it uses org-entry-properties org-heading-components org-get-outline-path etc which return elisp lists and org roam stores those lists directly in its database.

I think these functions should be provided by this plugin. But returning elisp lists ?? ehhh

SyedFasiuddin avatar Sep 01 '23 11:09 SyedFasiuddin

Would also love to see some features from org-roam implemented. One of the key things is the ability to create linked notes on demand and be able to view the network of linked files.

Say I have a file shopping.org with contents:

#+TITLE: Shopping List

* Here's what I need to buy:
- Eggs
- Milk
- Bread

org-roam lets me create a second org file with metadata in the header to link back to shopping.org. Say I want to make a note about eggs. I can hit a keybind with my cursor on Eggs and a capture template opens with a prepopulated :PROPERTIES: drawer

:PROPERTIES:
ID: <unique-id>
:END:
#+TITLE: Eggs

%?

shopping.org is then linked to this file using a unique ID

#+TITLE: Shopping list

* Shopping list:
- [[id:<unique-id-to-eggs>][Eggs]]
- Milk
- Bread

When I'm in the linked notes about eggs, I can also access a menu to view backlinks

Eggs     <- current note
Backlinks (1)
Shopping List (top)     <- list of linked files, their hierarchy in the note tree, and their content

* Here's what I need to buy:
- Eggs
- Milk
- Bread

check out https://github.com/nvim-neorg/neorg it has built in support for links, though not unique ids. personally I only write prose. I'd tried org-roam and doom emacs. but I had issues when working from different machines, (Intel Mac, Apple Silicon Macs, linux laptops) with neorg, I have to manually enter the note name, esc into normal mode, press enter while cursor is over the link name and it generates a new note. though there isn't a link, using your example, in eggs.org to go back to shopping.org.

but again I'm a prose writer and have a hard enough time getting plugins to work. let alone figure out capture templates etc.

on the plus side, I read somewhere that org and neorg are going to be natively supported in Neovim 0.10

gallo-s-chingon avatar Dec 22 '23 17:12 gallo-s-chingon

I'm trying to clone org-roam for neovim, an ideal goal would be to have one to one feature parity with org-roam.

But in beginning I'm only considering: adding nodes through org-roam-capture and find a node using org-roam-node-find, the part of finding a node is easy and simple but the "capture part" is where things fall apart.

When org-roam creates a new file node it uses org-entry-properties org-heading-components org-get-outline-path etc which return elisp lists and org roam stores those lists directly in its database.

I think these functions should be provided by this plugin. But returning elisp lists ?? ehhh

I forked your repo, and also does some modify on org-roam-ui, the basic need can be met for myself : p

https://github.com/CaryWill/org-roam-ui.nvim https://github.com/CaryWill/org-roam.nvim

CaryWill avatar Jan 11 '24 12:01 CaryWill