From a42c77adc824b3f2e49b2088b71bd48b2b43994c Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 3 Dec 2023 21:11:16 +0100 Subject: [PATCH 1/2] Added keymap for select Telescope picker --- init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/init.lua b/init.lua index 94f7cf4ecbe..7961d191a99 100644 --- a/init.lua +++ b/init.lua @@ -363,6 +363,7 @@ vim.keymap.set('n', '/', function() }) end, { desc = '[/] Fuzzily search in current buffer' }) +vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) From f3cb8de9d90f186a329a8455431f29004f266f77 Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Sun, 3 Dec 2023 21:25:49 +0100 Subject: [PATCH 2/2] Added keymap for search in all open files --- init.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.lua b/init.lua index 7961d191a99..4ab21837331 100644 --- a/init.lua +++ b/init.lua @@ -363,6 +363,13 @@ vim.keymap.set('n', '/', function() }) end, { desc = '[/] Fuzzily search in current buffer' }) +local function telescope_live_grep_open_files() + require('telescope.builtin').live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } +end +vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })