mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-12-17 17:31:18 +00:00
neorg: init
This commit is contained in:
parent
ef413736e9
commit
4953057603
7 changed files with 192 additions and 0 deletions
55
modules/plugins/notes/neorg/config.nix
Normal file
55
modules/plugins/notes/neorg/config.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
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 ''
|
||||
-- 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 = {'neorg'},
|
||||
},
|
||||
}
|
||||
|
||||
require('neorg').setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
(mkIf cfg.treesitter.enable {
|
||||
vim.treesitter.enable = true;
|
||||
|
||||
vim.treesitter.grammars = [cfg.treesitter.norgPackage];
|
||||
})
|
||||
]);
|
||||
}
|
||||
6
modules/plugins/notes/neorg/default.nix
Normal file
6
modules/plugins/notes/neorg/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./neorg.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
||||
41
modules/plugins/notes/neorg/neorg.nix
Normal file
41
modules/plugins/notes/neorg/neorg.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkEnableOption mkOption;
|
||||
inherit (lib.types) str;
|
||||
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.notes.neorg = {
|
||||
enable = mkEnableOption "neorg: Neovim plugin for Neorg";
|
||||
|
||||
setupOpts = mkPluginSetupOption "Neorg" {
|
||||
setup = mkOption {
|
||||
type = str;
|
||||
default = ''
|
||||
load = {
|
||||
['core.defaults'] = {}, -- Loads default behaviour
|
||||
['core.concealer'] = {}, -- Adds pretty icons to your documents
|
||||
['core.export'] = {}, -- Adds export options
|
||||
['core.integrations.telescope'] = {}, -- Telescope integration
|
||||
['core.dirman'] = { -- Manages Neorg workspaces
|
||||
config = {
|
||||
workspaces = {
|
||||
notes = '~/Documents/neorg',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'';
|
||||
description = "Neorg configuration";
|
||||
};
|
||||
};
|
||||
|
||||
treesitter = {
|
||||
enable = mkEnableOption "Neorg treesitter" // {default = config.vim.languages.enableTreesitter;};
|
||||
norgPackage = mkGrammarOption pkgs "norg";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue