Added keymaps to telescope to open items as well as selected quick fix list in trouble

This commit is contained in:
josean-dev 2024-04-03 11:31:43 -04:00
parent ee0bcf9b5f
commit b2876885b9

View file

@ -10,6 +10,17 @@ return {
config = function()
local telescope = require("telescope")
local actions = require("telescope.actions")
local transform_mod = require("telescope.actions.mt").transform_mod
local trouble = require("trouble")
local trouble_telescope = require("trouble.providers.telescope")
-- or create your custom action
local custom_actions = transform_mod({
open_trouble_qflist = function(prompt_bufnr)
trouble.toggle("quickfix")
end,
})
telescope.setup({
defaults = {
@ -18,7 +29,8 @@ return {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["<C-q>"] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist,
["<C-t>"] = trouble_telescope.smart_open_with_trouble,
},
},
},