From 398736176c126e9b52dd43e87f9e5c8b1fad8453 Mon Sep 17 00:00:00 2001 From: Fabrice Mouhartem Date: Wed, 11 Dec 2024 15:42:38 +0100 Subject: [PATCH] feat(neorg): Telescope live_grep in neorg working directory --- lua/neorg-configure.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lua/neorg-configure.lua b/lua/neorg-configure.lua index 2954562..bcfa2d9 100644 --- a/lua/neorg-configure.lua +++ b/lua/neorg-configure.lua @@ -36,6 +36,13 @@ vim.api.nvim_create_autocmd({ "FileType" }, { end, }) +local function live_grep_neorg() + local neorg_root = '~/Sync/neorg' -- TODO: get it from neorg + require('telescope.builtin').live_grep { + cwd = neorg_root, + } +end + -- document existing key chains require('which-key').add { { "l", group = "neorg [L]ist" }, @@ -69,3 +76,5 @@ 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.keymap.set("n", "n/", live_grep_neorg, + { noremap = true, silent = true, desc = "[N]eorg Live Grep" })