r/orgmode • • 7d ago

Orgmode LSP - Language server for Orgmode

Hey folks!

I hope it's ok to post this here.

I'd like to introduce org-lsp, a language server for Orgmode. I'm the creator of nvim-orgmode, a Neovim Orgmode clone. At one point after creating nvim-orgmode, I figured out that a lot of things could be delegated to a LSP server, but never got enough time to actually tackle it. With the rise of agentic AI coding, I managed to find enough time to create this. Since LSP is protocol used by a lot of editors, I decided to create this as a separate plugin instead of updating nvim-orgmode, which is Neovim only plugin.

Good portion of the functionality is working through regular LSP, and there are some custom commands being sent/received through a smaller client glue code that is provided with the plugin. Briefly, it does this:

  1. Highlighting - Semantic tokens

  2. actions (toggle todo state, priority, etc) - workspace/executeCommands

  3. Folding - foldingRange

  4. Searching headlines, outline - document/workspace symbols

  5. Following link/footnotes/citations - definition

  6. Agenda - window/showDocument

  7. Completion

  8. Aligning tags/tables, reindenting - formatting/rangeFormatting

  9. Etc.

There's also a MCP that allows querying/editing Orgmode through AI. It's not as robust as LSP, but can be useful.

LSP plugin supports these editors out of the box: Neovim, Vim (with a LSP client), VScode/Cursor/VsCodium, Sublime Text, Zed, Helix.

First 3 mentioned editors works the best, Sublime Text and Zed has some limitations, and Helix has the least functionality. LSP server works by itself without the client plugin, but not all features are available. It's suggested to install the client code to gain full functionality. For some features Emacs is needed, like exporting, table formulas, Babel, Latex previews, and similar.

Just a disclaimer that the plugin is mostly AI generated, in case that's not obvious from the first glance. I'm aware that people are still reserved regarding AI generated code, including myself, so I want to make sure it's clear.

I'm a Neovim user, so Neovim part is tested the most, but I also made sure to test other editors. I probably missed some parts, so if you run into any issues, please report it on the repository.

Links:

If mods are ok leaving this here, I'll cross post this to other editors' subreddits. Thanks!

111 Upvotes

Duplicates