dotfiles/lua/plugins/telescope.lua

31 lines
913 B
Lua
Raw Normal View History

local telescope = require('telescope')
2023-08-03 02:49:25 +02:00
local builtin = require('telescope.builtin')
telescope.setup {
defaults = {
vimgrep_arguments = { 'rg',
'--hidden', '--color=never', '--no-heading',
'--with-filename', '--line-number',
'--column', '--smart-case',
},
},
}
2023-08-03 02:49:25 +02:00
local find_files_workspace = function()
builtin.find_files({
search_dirs = vim.lsp.buf.list_workspace_folders(),
prompt_prefix = "🔍",
})
end
local live_grep_workspace = function()
builtin.live_grep({
search_dirs = vim.lsp.buf.list_workspace_folders(),
})
end
vim.keymap.set('n', '<leader>ff', find_files_workspace, {})
vim.keymap.set('n', '<leader>fg', live_grep_workspace, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
vim.keymap.set('n', '<leader>fl', builtin.git_files, {})