2022-12-23 00:08:07 +01:00
|
|
|
local telescope = require "telescope"
|
2022-10-22 00:38:18 +02:00
|
|
|
local map = vim.api.nvim_set_keymap
|
|
|
|
|
2022-12-23 00:08:07 +01:00
|
|
|
telescope.setup {
|
2021-11-05 17:44:11 +01:00
|
|
|
defaults = {
|
|
|
|
vimgrep_arguments = {
|
|
|
|
"rg",
|
|
|
|
"--color=never",
|
|
|
|
"--no-heading",
|
|
|
|
"--with-filename",
|
|
|
|
"--line-number",
|
|
|
|
"--column",
|
|
|
|
"--smart-case",
|
2022-07-06 23:04:52 +02:00
|
|
|
"--hidden",
|
2021-11-05 17:44:11 +01:00
|
|
|
},
|
|
|
|
},
|
2022-01-22 17:58:41 +01:00
|
|
|
|
2022-05-06 14:36:32 +02:00
|
|
|
pickers = {
|
|
|
|
find_files = {
|
|
|
|
find_command = { "fd", "--type", "f", "--strip-cwd-prefix", "--hidden" },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2022-01-22 17:58:41 +01:00
|
|
|
extensions = {
|
|
|
|
["ui-select"] = {
|
2022-01-23 01:25:35 +01:00
|
|
|
require("telescope.themes").get_dropdown {},
|
|
|
|
},
|
2022-01-22 17:58:41 +01:00
|
|
|
},
|
2021-11-05 17:44:11 +01:00
|
|
|
}
|
2022-01-22 17:58:41 +01:00
|
|
|
|
2022-12-23 00:08:07 +01:00
|
|
|
telescope.load_extension "ui-select"
|
|
|
|
telescope.load_extension "harpoon"
|
2022-10-22 00:38:18 +02:00
|
|
|
|
2022-12-23 11:15:55 +01:00
|
|
|
-- File finding mappings
|
2022-10-22 00:38:18 +02:00
|
|
|
map("n", "ff", "<cmd>Telescope find_files<cr>", { silent = true })
|
|
|
|
map("n", "fg", "<cmd>Telescope live_grep<cr>", { silent = true })
|
2022-12-23 11:15:55 +01:00
|
|
|
|
|
|
|
-- LSP mappings
|
|
|
|
map("n", "gd", "<cmd>Telescope lsp_definitions<CR>", { silent = true })
|
|
|
|
map("n", "gi", "<cmd>Telescope lsp_implementations<CR>", { silent = true })
|
|
|
|
map("n", "gr", "<cmd>Telescope lsp_references<CR>", { silent = true })
|
2022-10-22 00:38:18 +02:00
|
|
|
map("n", "gs", "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", { silent = true })
|
2022-12-23 11:15:55 +01:00
|
|
|
|
|
|
|
map("n", "gp", "<cmd>Telescope diagnostics bufnr=0<CR>", { silent = true })
|
|
|
|
map("n", "gP", "<cmd>Telescope diagnostics<CR>", { silent = true })
|
|
|
|
|
|
|
|
-- other mappings
|
2022-12-23 00:08:07 +01:00
|
|
|
map("n", "gm", "<cmd>Telescope harpoon marks<cr>", { silent = true })
|