mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
feat(trouble.lua): add configuration for telescope plugin to integrate with trouble plugin
The `trouble.lua` file is added to configure the integration between the `telescope` plugin and the `trouble` plugin. This configuration sets up key mappings for opening trouble windows and quickfix lists. It also adds keybindings for toggling document diagnostics, workspace diagnostics, and the quickfix list using the leader key. This configuration enhances the functionality of the `telescope` plugin by integrating it with the `trouble` plugin.
This commit is contained in:
30
lua/absolute/after/trouble.lua
Normal file
30
lua/absolute/after/trouble.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local telescope = require("telescope")
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
local trouble_telescope = require("trouble.providers.telescope")
|
||||||
|
|
||||||
|
telescope.setup({
|
||||||
|
defaults = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<C-t>"] = trouble_telescope.open_with_trouble,
|
||||||
|
["<C-q>"] = actions.send_to_qflist,
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
["<C-t>"] = trouble_telescope.open_with_trouble,
|
||||||
|
["<C-q>"] = actions.send_to_qflist,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Keybindings
|
||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
|
opts.desc = "Trouble: Open Document Diagnostics"
|
||||||
|
vim.keymap.set("n", "<leader>td", "<cmd>TroubleToggle document_diagnostics<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Trouble: Open Workspace Diagnostics"
|
||||||
|
vim.keymap.set("n", "<leader>tw", "<cmd>TroubleToggle workspace_diagnostics<CR>", opts)
|
||||||
|
|
||||||
|
opts.desc = "Trouble: Open Quickfix List"
|
||||||
|
vim.keymap.set("n", "<leader>tq", "<cmd>TroubleToggle quickfix<CR>", opts)
|
||||||
Reference in New Issue
Block a user