add trouble.nvim and keybinds for diagnostics/trouble
This commit is contained in:
parent
7b88ff0512
commit
a3046b056b
3 changed files with 55 additions and 2 deletions
28
lua/weeheavy/plugins/troube.lua
Normal file
28
lua/weeheavy/plugins/troube.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
-- A pretty diagnostics, references, telescope results, quickfix and location
|
||||
-- list to help you solve all the trouble your code is causing.
|
||||
-- https://github.com/folke/trouble.nvim
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
--config = function()
|
||||
-- local oil = require("oil")
|
||||
-- oil.setup({
|
||||
-- default_file_explorer = true,
|
||||
-- columns = {
|
||||
-- --"size",
|
||||
-- "icon",
|
||||
-- },
|
||||
-- view_options = {
|
||||
-- show_hidden = true,
|
||||
-- },
|
||||
-- keymaps = {
|
||||
-- -- This should be matched to the open action in remap.lua
|
||||
-- ["<leader>e"] = "actions.close",
|
||||
-- ["<C-v>"] = "actions.select_vsplit",
|
||||
-- ["<C-x>"] = "actions.select_split",
|
||||
-- },
|
||||
-- })
|
||||
--end,
|
||||
}
|
||||
|
|
@ -77,4 +77,29 @@ vim.keymap.set({ "n", "v" }, "<leader>o", function()
|
|||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
|
||||
vim.keymap.set("n", "<leader>z", ":ZenMode<CR>") -- toggle zen-mode.nvim
|
||||
-- Toggle zen-mode.nvim
|
||||
vim.keymap.set("n", "<leader>z", ":ZenMode<CR>")
|
||||
|
||||
-- Got to next diagnostic item (any severity)
|
||||
vim.keymap.set({ "n", "v" }, "<leader>da", function()
|
||||
vim.diagnostic.goto_next({})
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next diagnostic" })
|
||||
|
||||
-- Got to next diagnostic item (error severity)
|
||||
vim.keymap.set({ "n", "v" }, "<leader>de", function()
|
||||
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR })
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next diagnostic" })
|
||||
|
||||
-- Got to next diagnostic item (warning severity)
|
||||
vim.keymap.set({ "n", "v" }, "<leader>dw", function()
|
||||
vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.WARN })
|
||||
vim.api.nvim_feedkeys("zz", "n", false)
|
||||
end, { desc = "Go to next diagnostic" })
|
||||
|
||||
-- Toggle trouble (for document)
|
||||
vim.keymap.set("n", "<leader>qq", ":TroubleToggle<CR>")
|
||||
|
||||
-- Toggle trouble (for workspace)
|
||||
vim.keymap.set("n", "<leader>QQ", ":TroubleToggle workspace_diagnostics<CR>")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue