From 1e6312d181ac15e02b48ec01d0d358e2e06edd62 Mon Sep 17 00:00:00 2001 From: megit Date: Mon, 8 Apr 2024 20:01:57 +0800 Subject: [PATCH] fix neorg and add treesitter --- config/default.nix | 1 + config/plugins/neorg.nix | 15 +++++++++------ config/plugins/treesitter.nix | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 config/plugins/treesitter.nix diff --git a/config/default.nix b/config/default.nix index 8e40133..4b38752 100644 --- a/config/default.nix +++ b/config/default.nix @@ -21,6 +21,7 @@ ./plugins/which-key.nix ./plugins/telescope.nix ./plugins/neorg.nix + ./plugins/treesitter.nix ./plugins/lsp/lsp.nix diff --git a/config/plugins/neorg.nix b/config/plugins/neorg.nix index 79246fb..1766e2f 100644 --- a/config/plugins/neorg.nix +++ b/config/plugins/neorg.nix @@ -34,12 +34,15 @@ }; "core.keybinds" = { config = { - hook = function(keybinds) - # -- unmap Alt-Enter to "core.itero.next-iteration", "" - keybinds.unmap("norg", "i", "") - # -- map Shift-Enter to "core.itero.next-iteration", "" - keybinds.remap_event("norg", "i", "", "core.itero.next-iteration", "") - end; + hook = { + __raw = ''function(keybinds) + -- unmap Alt-Enter to "core.itero.next-iteration", "" + keybinds.unmap("norg", "i", "") + -- map Shift-Enter to "core.itero.next-iteration", "" + keybinds.remap_event("norg", "i", "", "core.itero.next-iteration", "") + end; + ''; + }; }; }; }; diff --git a/config/plugins/treesitter.nix b/config/plugins/treesitter.nix new file mode 100644 index 0000000..e2b8153 --- /dev/null +++ b/config/plugins/treesitter.nix @@ -0,0 +1,16 @@ +{ + plugins = { + treesitter = { + enable = true; + incrementalSelection = { + enable = true; + keymaps = { + initSelection = "g"; + nodeIncremental = "g"; + scopeIncremental = ""; + nodeDecremental = "gm"; + }; + }; + }; + }; +}