nvf/modules/plugins/notes/orgmode/config.nix
Thales Menato e0f6fe7a2a
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
treesitter: attempt to adapt to (breaking) Nixpkgs changes (#1315)
* feat: update from builtGrammars to grammarPlugins

* fix: renamed packages

* chore: revert back the configs part

* wip: try using config

* chore: update flake

* docs: update release-note

---------

Co-authored-by: raf <raf@notashelf.dev>
2026-01-05 16:07:31 +00:00

47 lines
1.2 KiB
Nix

{
config,
lib,
...
}: let
inherit (lib.modules) mkIf mkMerge;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.binds) pushDownDefault;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.notes.orgmode;
in {
config = mkIf cfg.enable (mkMerge [
{
vim = {
startPlugins = ["orgmode"];
binds.whichKey.register = pushDownDefault {
"<leader>o" = "+Notes";
};
pluginRC.orgmode = entryAnywhere ''
-- Treesitter configuration
require('nvim-treesitter.config').setup {
-- If TS highlights are not enabled at all, or disabled via `disable` prop,
-- highlighting will fallback to default Vim syntax highlighting
highlight = {
enable = true,
-- Required for spellcheck, some LaTex highlights and
-- code block highlights that do not have ts grammar
additional_vim_regex_highlighting = {'org'},
},
}
require('orgmode').setup(${toLuaObject cfg.setupOpts})
'';
};
}
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.orgPackage];
})
]);
}