Skip to content

Contributing Guide ​

Thanks for wanting to help out with nvim-orgmode, we appreciate the effort!

Reporting Bugs/Features ​

📣 Please always make a quick search in our issue-tracker before reporting anything. If the bug/feature has already been reported, continue the conversation on the existing issue.

We distinguish between core (part of orgmode) and non-core features. The former will be prioritized. Bugs get the highest priority.

If you're reporting a core feature, please be sure to provide a link that describes it. There are several places where features could be documented, have a look at these resources. The more info you provide the better!

Documentation ​

If you spot something missing in our docs, don't hesitate making a PR. The wiki can be edited freely.

Development ​

Philosophy ​

We try to mimic the behavior of Emacs Orgmode as closely as possible. Variable names follow the same naming convention as in Emacs Orgmode, except that they are in snake_case instead of kebab-case.

Example: org-agenda-files in Emacs is org_agenda_files in nvim-orgmode.

Local dev ​

Requirements:

To set up local development, run make setup_dev. This will add a pre-commit hook that will auto format all files before committing them. You can always manually format all files with make format command

Code ​

If you prefer working on an issue that has been reported, please leave a comment voicing your interest.

Please document any new code you add with emmylua annotations. Feel free to add annotations/docs to any existing functions integral to your PR that are missing them.

Tests ​

To run tests run make test in the nvim-orgmode directory:

example
make test

To run a specific test you can set a FILE environment variable to a specific spec you want to test. Example:

example
make test FILE=./tests/plenary/api/api_spec.lua

📝 NOTE: Tests are currently not working on Windows. Test run will only verify if tree-sitter grammar can be installed, and exit with a success message.

Parser ​

Parsing is done via builtin treesitter parser and the tree-sitter-org grammar.

Changes to the grammar go to tree-sitter-org. Orgmode installs the grammar from a release tag, so a grammar change needs a new tag there before orgmode can use it. To update orgmode to a new tag:

  1. Set required_version in lua/orgmode/utils/treesitter/install.lua to the new tag.
  2. Find what changed in the grammar: diff src/node-types.json and test/corpus/ in tree-sitter-org between the old and the new tag. Adjust queries/org/*.scm and the Lua code that matches node types by name. A query with an unknown node type fails to load, but node names in Lua strings and changes to the tree shape only show up in tests. A renamed highlight capture breaks user overrides, so mark the commit as breaking.
  3. Run :Org install_treesitter_grammar to install the new version, then run make test and check the highlighting in a few org files.

Commits ​

Ensure that you follow the Conventional Commits specification (e.g., feat: add new feature, fix: correct bug, docs: update documentation).