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 and Peter-McKinney committed Apr 9, 2024
1 parent c989e3f commit e87cc8c
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 @@ -470,6 +470,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' })
-- pete custom
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>g^h', require('custom.telescope_pickers').git_diff_files, { desc = 'Search [G]it Diff Files' })
Expand Down

0 comments on commit e87cc8c

Please sign in to comment.