Live data from Hacker News

Tree-sitter grammar for org-mode

github.com

1–10 of 32 posts

Re: Tree-sitter grammar for org-mode

#2
From the readme:

> Org grammar for tree-sitter. It is not meant to implement emacs' orgmode parser, but to implement a grammar that can usefully parse org files to be used in neovim and any library that uses tree-sitter parsers.

This grammar is in active development and is being used by nvim-orgmode/orgmode [1], a org-mode neovim plugin.

Some additional resources some might find useful:

* Org Syntax - https://orgmode.org/worg/dev/org-syntax.html

* EBNF grammar - https://github.com/200ok-ch/org-parser/blob/master/resources...

* Tree-sitter - https://tree-sitter.github.io/tree-sitter/

[1] https://github.com/nvim-orgmode/orgmode

Re: Tree-sitter grammar for org-mode

#5

I don't care for org mode but this could be huge for people that do. I find being able to open + edit notes quickly helps my thought process more, so hopefully this can help with that.

> I find being able to open + edit notes quickly helps my thought process more,

I use org with roam in Doom Emacs. The org roam notes directory is backed by git.

https://www.orgroam.com/

It allows for using a Zettelkasten style approach to note taking inside of Emacs. The basic idea is small quick notes that are cross referenced, indexed, and searchable.

Doom Emacs is like Spacemacs were access to commands are activated through hitting the space bar while in Evil's command mode.

This way if you stumble across a link or something notable or get an idea you want to hit later it takes about 15-20 seconds to generate a new note card, link it to other ones, and then get back to whatever you were doing before you got distracted.

And then later you can go back and refine and expand on the idea with more note cards and have something you can easily use for a future reference.

Nvim has it's own Zettelkasten-style note taking plugins, of course. But what sets Org apart, IMO, is just how flexible and FAST it is as a text-based UI for writing documents. Makes using MarkDown seem plodding in comparison.

My favorite is, though, reStructuredText. RST was a work of genius.

But the clincher for Org, when compared to RST, ends up being Org-babel. The ability to embed multiple formats into a single document, be able to quickly render those other documents to separate files, and being able to execute source code and maintain state between multiple src segments is crazy effective. Completely awesome if you want to get into literate programming.

This turns your personal text-based notebook into having capabilities akin to Wolfwam or Jupyter Notebooks. Can even turn your indexed notes into an interface for Jupyter or Wolfram Mathmatica if you really want to.

It's pretty nuts.

Having something like that for NeoVim would be extremely nice. With new versions of Emacs having Wayland and Native Compilation it has improved performance significantly, but I don't think it will ever approach to just how fast NeoVim can be.

Re: Tree-sitter grammar for org-mode

#6
post #5

I don't care for org mode but this could be huge for people that do. I find being able to open + edit notes quickly helps my thought process more, so hopefully this can help with that.

> I find being able to open + edit notes quickly helps my thought process more, I use org with roam in Doom Emacs. The org roam notes directory is backed by git. https://www.orgroam.com/ It allows for using a Zettelkasten style approach to note taking inside of Emacs. The basic idea is small quick notes that are cross referenced, indexed, and searchable. Doom Emacs is like Spacemacs were access to commands are activa…

> Having something like that for NeoVim would be extremely nice. With new versions of Emacs having Wayland and Native Compilation it has improved performance significantly, but I don't think it will ever approach to just how fast NeoVim can be.

Always good to remind that emacsclient makes starting an Emacs frame/window instantaneous.

Re: Tree-sitter grammar for org-mode

#7

From the readme: > Org grammar for tree-sitter. It is not meant to implement emacs' orgmode parser, but to implement a grammar that can usefully parse org files to be used in neovim and any library that uses tree-sitter parsers. This grammar is in active development and is being used by nvim-orgmode/orgmode [1], a org-mode neovim plugin. Some additional resources some might find useful: * Org Syntax - https://orgmode…

We're in the middle of updating the org syntax document. I've been preoccupied and haven't gotten a chance to take another pass, but there should be a new version out in the next month or so. See also [0].

0. https://github.com/tgbugs/laundry/tree/master/laundry/gramma...

Re: Tree-sitter grammar for org-mode

#8
This is very exciting.

IMO the Tools For Thought (#TFT) ecosystem is crying out for a standard interchange format to break down the silos. Org-mode could be that format. It's not just an outliner format, it's the best markup[1] and supports pretty much everything you need for journaling/task-management/project-management etc.

What's been missing thus far is a single canonical definition that everyone can build on (beyond the org-mode source code). I'd love to see this be the reference implementation of Karl Voits Orgdown proposal [2]. (BTW there was a recent relevant discussion here [3])

[1] https://karl-voit.at/2017/09/23/orgmode-as-markup-only

[2] https://gitlab.com/publicvoit/orgdown

[3] https://news.ycombinator.com/item?id=30879327

Re: Tree-sitter grammar for org-mode

#9

From the readme: > Org grammar for tree-sitter. It is not meant to implement emacs' orgmode parser, but to implement a grammar that can usefully parse org files to be used in neovim and any library that uses tree-sitter parsers. This grammar is in active development and is being used by nvim-orgmode/orgmode [1], a org-mode neovim plugin. Some additional resources some might find useful: * Org Syntax - https://orgmode…

I'd had the 1.0 commit sitting on my machine for a while, this post gave me the activation energy to bump it. The grammar is fairly stable now.

Re: Tree-sitter grammar for org-mode

#10
post #5

I don't care for org mode but this could be huge for people that do. I find being able to open + edit notes quickly helps my thought process more, so hopefully this can help with that.

> I find being able to open + edit notes quickly helps my thought process more, I use org with roam in Doom Emacs. The org roam notes directory is backed by git. https://www.orgroam.com/ It allows for using a Zettelkasten style approach to note taking inside of Emacs. The basic idea is small quick notes that are cross referenced, indexed, and searchable. Doom Emacs is like Spacemacs were access to commands are activa…

I’m a long time emacs and org-mode user but I switched to neovim for 90% of my development work. I still use emacs for org-mode and I doubt I would ever use org-mode in neovim because it relies on being implemented in the entire emacs system and the emacs lisp language . Nothing short of embedding emacs on neovim would make it tenable. I have the same problem in the other direction, viper is not a substitute for neovim.
Post reply on HN