From e9e7399c049f74dc316c520cecd4c65b4135407d Mon Sep 17 00:00:00 2001 From: jasmine Date: Thu, 26 Jun 2025 19:26:50 +0800 Subject: [PATCH] Setup neorg plugin --- config/default.nix | 1 + config/options.nix | 5 +++- config/plugins/cmp/cmp.nix | 4 +++ config/plugins/notes/neorg.nix | 48 ++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 config/plugins/notes/neorg.nix diff --git a/config/default.nix b/config/default.nix index 7145931..100e0b3 100644 --- a/config/default.nix +++ b/config/default.nix @@ -46,6 +46,7 @@ # Markdown, Notes & Productivity ./plugins/notes/markdown-preview.nix + ./plugins/notes/neorg.nix ./plugins/notes/render-markdown.nix ./plugins/notes/todo-comments.nix diff --git a/config/options.nix b/config/options.nix index b2857ca..8fdd157 100644 --- a/config/options.nix +++ b/config/options.nix @@ -6,7 +6,6 @@ showmode = false; swapfile = false; clipboard = "unnamedplus"; - conceallevel = 1; updatetime=100; undofile = true; splitright = true; @@ -17,6 +16,10 @@ shiftwidth = 2; expandtab = true; + # Required for neorg + conceallevel = 2; + foldlevel = 99; + # Using this config for sessionoptions is recommended: sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"; }; diff --git a/config/plugins/cmp/cmp.nix b/config/plugins/cmp/cmp.nix index b6e472c..73a9348 100644 --- a/config/plugins/cmp/cmp.nix +++ b/config/plugins/cmp/cmp.nix @@ -27,6 +27,10 @@ { # VimTex name = "vimtex"; } + + { # Neorg + name = "neorg"; + } ]; # Key mappings for the completion menu. diff --git a/config/plugins/notes/neorg.nix b/config/plugins/notes/neorg.nix new file mode 100644 index 0000000..24dc837 --- /dev/null +++ b/config/plugins/notes/neorg.nix @@ -0,0 +1,48 @@ +{...}:{ + plugins.neorg = { + enable = true; + + # Settings for the Neorg plugin + settings = { + load = { + # Load the core modules for Neorg + "core.defaults" = { + __empty = null; + }; + + # Display markup as icons, not text + "core.concealer" = { + __empty = null; + }; + + # Handle collections of notes + "core.dirman" = { + config = { + workspaces = { + notes = "~/Notes"; + }; + default_workspace = "notes"; + }; + }; + + # Treesitter integration + "core.integrations.treesitter" = { + config = { + install_parsers = true; + configure_parsers = true; + }; + }; + + # Enable completions with nvim-cmp + "core.completion" = { + config = { + engine = "nvim-cmp"; + }; + }; + "core.integrations.nvim-cmp" = { + __empty = null; + }; + }; + }; + }; +}