This repository has been archived on 2024-10-06. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/lua/plugins/telescope.lua
2023-12-18 14:27:58 +01:00

30 lines
913 B
Lua

local telescope = require('telescope')
local builtin = require('telescope.builtin')
telescope.setup {
defaults = {
vimgrep_arguments = { 'rg',
'--hidden', '--color=never', '--no-heading',
'--with-filename', '--line-number',
'--column', '--smart-case',
},
},
}
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, {})