mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-23 22:19:49 +01:00
42 lines
868 B
Nix
42 lines
868 B
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.neorg;
|
||
|
in {
|
||
|
config = mkIf cfg.enable (mkMerge [
|
||
|
{
|
||
|
vim = {
|
||
|
startPlugins = [
|
||
|
"lua-utils-nvim"
|
||
|
"nui-nvim"
|
||
|
"nvim-nio"
|
||
|
"pathlib-nvim"
|
||
|
"plenary-nvim"
|
||
|
"neorg"
|
||
|
"neorg-telescope"
|
||
|
];
|
||
|
|
||
|
binds.whichKey.register = pushDownDefault {
|
||
|
"<leader>o" = "+Notes";
|
||
|
};
|
||
|
|
||
|
pluginRC.neorg = entryAnywhere ''
|
||
|
require('neorg').setup(${toLuaObject cfg.setupOpts})
|
||
|
'';
|
||
|
};
|
||
|
}
|
||
|
|
||
|
(mkIf cfg.treesitter.enable {
|
||
|
vim.treesitter.enable = true;
|
||
|
vim.treesitter.grammars = [cfg.treesitter.norgPackage];
|
||
|
})
|
||
|
]);
|
||
|
}
|