From 3824342d107850dfe5b179d0a39e0d8fcd54411d Mon Sep 17 00:00:00 2001 From: Damjan 9000 Date: Mon, 4 Dec 2023 16:45:01 +0100 Subject: Adds two essential telescope keymaps (#528) * Added keymap for select Telescope picker * Added keymap for search in all open files --- init.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 76ddd45..36cc9a5 100644 --- a/init.lua +++ b/init.lua @@ -399,6 +399,14 @@ 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' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) -- cgit v1.2.3