mirror of
https://github.com/josean-dev/dev-environment-files.git
synced 2025-01-08 17:21:23 +01:00
Retained comments
This commit is contained in:
parent
443d81eff2
commit
7bab2b8fb5
1 changed files with 16 additions and 6 deletions
|
@ -10,18 +10,27 @@ return {
|
|||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
local transform_mod = require("telescope.actions.mt").transform_mod
|
||||
|
||||
-- Update the import for trouble sources
|
||||
local trouble = require("trouble.sources.telescope")
|
||||
local trouble = require("trouble")
|
||||
local trouble_telescope = require("trouble.sources.telescope")
|
||||
|
||||
-- or create your custom action
|
||||
local custom_actions = transform_mod({
|
||||
open_trouble_qflist = function(prompt_bufnr)
|
||||
trouble.toggle("quickfix")
|
||||
end,
|
||||
})
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "smart" },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-q>"] = actions.send_selected_to_qflist,
|
||||
["<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 + custom_actions.open_trouble_qflist,
|
||||
["<C-t>"] = trouble_telescope.open, -- Use the new way to integrate with Trouble via Telescope
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -29,7 +38,8 @@ return {
|
|||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
local keymap = vim.keymap
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
|
||||
|
|
Loading…
Reference in a new issue