From cde7f74d0b635e0eb6e943291a12957732fcd82c Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Mon, 11 Nov 2024 09:48:41 +0100 Subject: [PATCH] feat(neorg): add telescope search --- lazy-lock.json | 1 + lua/lazy-configure.lua | 3 ++- lua/neorg-configure.lua | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lazy-lock.json b/lazy-lock.json index 4af42f5..664a155 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -20,6 +20,7 @@ "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.nvim": { "branch": "main", "commit": "7b4d5d48b6b5a75009d63f8f3e4ef4819b7e8139" }, "neorg": { "branch": "main", "commit": "81ee90cb2d72ac43bfadb7dd276646f34c8f85be" }, + "neorg-telescope": { "branch": "main", "commit": "ddb2556644cae922699a239bbb0fe16e25b084b7" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, diff --git a/lua/lazy-configure.lua b/lua/lazy-configure.lua index d21f6ec..b460aaa 100644 --- a/lua/lazy-configure.lua +++ b/lua/lazy-configure.lua @@ -280,7 +280,7 @@ require('lazy').setup({ }, { "nvim-neorg/neorg", - dependencies = { "luarocks.nvim" }, + dependencies = { "luarocks.nvim", { "nvim-lua/plenary.nvim" }, { "nvim-neorg/neorg-telescope" } }, lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default version = "*", -- Pin Neorg to the latest stable release config = function() @@ -311,6 +311,7 @@ require('lazy').setup({ type = "empty", }, }, + ["core.integrations.telescope"] = {}, } } end, diff --git a/lua/neorg-configure.lua b/lua/neorg-configure.lua index e170713..0174f24 100644 --- a/lua/neorg-configure.lua +++ b/lua/neorg-configure.lua @@ -44,6 +44,16 @@ vim.api.nvim_set_keymap("n", "nee", ":Neorg export to-file /tmp/neorg-ex { noremap = true, silent = true, desc = "[N]eorg [E]xport Predefined" }) vim.api.nvim_set_keymap("n", "nef", ":Neorg export to-file ", { noremap = true, silent = true, desc = "[N]eorg [E]xport [F]ile" }) +vim.api.nvim_set_keymap("n", "nh", "(neorg.telescope.search_headings)", + { noremap = true, silent = true, desc = "[N]eorg search [H]eading" }) +vim.api.nvim_set_keymap("n", "nl", "(neorg.telescope.find_linkable)", + { noremap = true, silent = true, desc = "[N]eorg find [L]inkable" }) +vim.api.nvim_set_keymap("n", "nf", "(neorg.telescope.find_norg_files)", + { noremap = true, silent = true, desc = "[N]eorg find [F]ile" }) +vim.api.nvim_set_keymap("n", "nb", "(neorg.telescope.backlinks.file_backlinks)", + { noremap = true, silent = true, desc = "[N]eorg file [B]acklinks" }) +vim.api.nvim_set_keymap("n", "", "(neorg.telescope.insert_link)", + { noremap = true, silent = true, desc = "Neorg insert [L]ink" }) -- Tasks vim.api.nvim_set_keymap("n", "td", "(neorg.qol.todo-items.todo.task-done)",