diff --git a/lua/neorg/modules/core/integrations/treesitter/module.lua b/lua/neorg/modules/core/integrations/treesitter/module.lua index f68f10741..39d33d068 100644 --- a/lua/neorg/modules/core/integrations/treesitter/module.lua +++ b/lua/neorg/modules/core/integrations/treesitter/module.lua @@ -101,12 +101,12 @@ module.load = function() module.private.ts_utils = ts_utils - module.required["core.mode"].add_mode("traverse-heading") - module.required["core.mode"].add_mode("traverse-link") - vim.keymap.set("", "(neorg.treesitter.next.heading)", lib.wrap(module.public.goto_next_query_match, module.private.heading_query)) - vim.keymap.set("", "(neorg.treesitter.next.link)", lib.wrap(module.public.goto_next_query_match, module.private.link_query)) - vim.keymap.set("", "(neorg.treesitter.previous.heading)", lib.wrap(module.public.goto_previous_query_match, module.private.heading_query)) - vim.keymap.set("", "(neorg.treesitter.previous.link)", lib.wrap(module.public.goto_previous_query_match, module.private.link_query)) + module.required["core.mode"].add_mode("traverse-heading", { "norg" }) + module.required["core.mode"].add_mode("traverse-link", { "norg" }) + vim.keymap.set("n", "(neorg.treesitter.next.heading)", lib.wrap(module.public.goto_next_query_match, module.private.heading_query)) + vim.keymap.set("n", "(neorg.treesitter.next.link)", lib.wrap(module.public.goto_next_query_match, module.private.link_query)) + vim.keymap.set("n", "(neorg.treesitter.previous.heading)", lib.wrap(module.public.goto_previous_query_match, module.private.heading_query)) + vim.keymap.set("n", "(neorg.treesitter.previous.link)", lib.wrap(module.public.goto_previous_query_match, module.private.link_query)) end module.config.public = { diff --git a/lua/neorg/modules/core/keybinds/module.lua b/lua/neorg/modules/core/keybinds/module.lua index 8736b67a1..18d03ea33 100644 --- a/lua/neorg/modules/core/keybinds/module.lua +++ b/lua/neorg/modules/core/keybinds/module.lua @@ -31,6 +31,36 @@ module.private = { }, }, }, + ["traverse-heading"] = { + n = { + -- Move to the next heading in the document + { + "j", + "(neorg.treesitter.next.heading)", + opts = { desc = "[neorg] Move to Next Heading" }, + }, + + -- Move to the previous heading in the document + { + "k", + "(neorg.treesitter.previous.heading)", + opts = { desc = "[neorg] Move to Previous Heading" }, + }, + }, + }, + ["traverse-link"] = { + n = { + -- Move to the next link in the document + { "j", "(neorg.treesitter.next.link)", opts = { desc = "[neorg] Move to Next Link" } }, + + -- Move to the previous link in the document + { + "k", + "(neorg.treesitter.previous.link)", + opts = { desc = "[neorg] Move to Previous Link" }, + }, + }, + }, norg = { n = { -- Marks the task under the cursor as "undone"