mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 11:40:36 +00:00
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.
31 lines
882 B
Lua
31 lines
882 B
Lua
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)
|