Skip to content

Commit

Permalink
Adds two essential telescope keymaps (nvim-lua#528)
Browse files Browse the repository at this point in the history
* Added keymap for select Telescope picker

* Added keymap for search in all open files
  • Loading branch information
dam9000 authored Dec 4, 2023
1 parent f8c8b08 commit 3824342
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,14 @@ vim.keymap.set('n', '<leader>/', 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', '<leader>s/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' })
vim.keymap.set('n', '<leader>ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
Expand Down

0 comments on commit 3824342

Please sign in to comment.