2023-01-04 07:28:57 -05:00
|
|
|
local ok, telescope = pcall(require, "telescope")
|
|
|
|
if not ok then
|
2023-04-03 09:19:12 -04:00
|
|
|
vim.notify("Failed to load telescope")
|
|
|
|
return
|
2023-01-04 07:28:57 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
local actions = require'telescope.actions'
|
|
|
|
local builtin = require'telescope.builtin'
|
|
|
|
|
|
|
|
telescope.setup{
|
2023-04-03 09:19:12 -04:00
|
|
|
defaults = {
|
|
|
|
mappings = {
|
|
|
|
i = {
|
|
|
|
["<c-j>"] = actions.move_selection_next,
|
|
|
|
["<c-k>"] = actions.move_selection_previous,
|
|
|
|
},
|
|
|
|
n = {
|
|
|
|
["q"] = actions.close,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2023-01-04 07:28:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
local keymap = vim.keymap.set
|
|
|
|
|
|
|
|
keymap("n","<leader>f",builtin.find_files)
|
|
|
|
keymap("n","<leader>l",builtin.live_grep)
|
|
|
|
keymap("n","<leader>L",builtin.grep_string)
|
|
|
|
|
|
|
|
keymap("n","<leader>;",builtin.current_buffer_fuzzy_find)
|
|
|
|
keymap("n","<leader>b",builtin.buffers)
|
|
|
|
|
|
|
|
keymap("n","<leader>e",function()
|
2023-04-03 09:19:12 -04:00
|
|
|
builtin.diagnostics{bufnr = 0,severity_limit = "WARN"}
|
2023-01-04 07:28:57 -05:00
|
|
|
end)
|
2023-04-03 09:19:12 -04:00
|
|
|
|
2023-01-04 07:28:57 -05:00
|
|
|
keymap("n","<leader>E",function()
|
2023-04-03 09:19:12 -04:00
|
|
|
builtin.diagnostics{severity_limit = "WARN"}
|
2023-01-04 07:28:57 -05:00
|
|
|
end)
|