2023-02-27 19:26:16 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
2023-11-07 00:50:27 +00:00
|
|
|
}: let
|
2024-03-12 00:47:01 +00:00
|
|
|
inherit (lib.modules) mkIf mkMerge;
|
|
|
|
inherit (lib.nvim.dag) entryAnywhere;
|
|
|
|
inherit (lib.nvim.binds) pushDownDefault;
|
2024-02-17 15:46:16 +00:00
|
|
|
inherit (lib.nvim.lua) toLuaObject;
|
2023-11-07 00:50:27 +00:00
|
|
|
|
2023-02-27 19:26:16 +00:00
|
|
|
cfg = config.vim.notes.orgmode;
|
|
|
|
in {
|
2023-08-07 11:56:29 +00:00
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
|
|
{
|
2024-03-12 00:47:01 +00:00
|
|
|
vim = {
|
|
|
|
startPlugins = [
|
|
|
|
"orgmode-nvim"
|
|
|
|
];
|
|
|
|
|
|
|
|
binds.whichKey.register = pushDownDefault {
|
|
|
|
"<leader>o" = "+Notes";
|
|
|
|
};
|
|
|
|
|
|
|
|
luaConfigRC.orgmode = entryAnywhere ''
|
|
|
|
-- Treesitter configuration
|
|
|
|
require('nvim-treesitter.configs').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'},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2024-02-17 15:46:16 +00:00
|
|
|
require('orgmode').setup(${toLuaObject cfg.setupOpts})
|
2024-03-12 00:47:01 +00:00
|
|
|
'';
|
2024-02-25 16:39:05 +00:00
|
|
|
};
|
2023-08-07 11:56:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
(mkIf cfg.treesitter.enable {
|
|
|
|
vim.treesitter.enable = true;
|
|
|
|
|
|
|
|
vim.treesitter.grammars = [cfg.treesitter.orgPackage];
|
|
|
|
})
|
|
|
|
]);
|
2023-02-27 19:26:16 +00:00
|
|
|
}
|