add trouble

side note? why was I using feat and chore and etc?
This commit is contained in:
Zoty 2026-04-07 11:46:51 -03:00
parent af16bba334
commit d65c4083ba
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
9 changed files with 80 additions and 46 deletions

View file

@ -19,6 +19,9 @@ vim.api.nvim_create_autocmd("LspAttach", {
vim.keymap.set("n", "<leader>for", function()
vim.lsp.buf.format({ async = true })
end, opts)
vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.jump({ count = -1 }) end)
vim.keymap.set("n", "]d", function() vim.diagnostic.jump({ count = 1 }) end)
end,
})

View file

@ -1,15 +1,16 @@
{
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
"blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
"fzf-lua": { "branch": "main", "commit": "76ddd6b56875bf4f6fd13848728207e738bb75a3" },
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
"fzf-lua": { "branch": "main", "commit": "bde73a6886b607246095aa59f396de5e0d036890" },
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
"nvim-treesitter": { "branch": "main", "commit": "d660b7c002f3922b6bb3da47206645488a698426" },
"nvim-treesitter": { "branch": "main", "commit": "7caec274fd19c12b55902a5b795100d21531391f" },
"nvim-treesitter-endwise": { "branch": "master", "commit": "8fe8a95630f4f2c72a87ba1927af649e0bfaa244" },
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
"rustaceanvim": { "branch": "master", "commit": "13f7f5c46d2db0b8daee64a842d8faebfe9064c0" }
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
"rustaceanvim": { "branch": "master", "commit": "f2f0c1231a5b019dbc1fd6dafac1751c878925a3" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }
}

View file

@ -13,6 +13,6 @@ return {
{ '<leader>fh', function() require('fzf-lua').help_tags() end, desc = 'Help tags' },
{ '<leader>fr', function() require('fzf-lua').oldfiles() end, desc = 'Recent files' },
{ '<leader>fd', function() require('fzf-lua').diagnostic_document() end, desc = 'Diagnostics' },
{ '<leader>fs', function() require('fzf-lua').lsp_document_symbosl() end, desc = 'LSP symbols' },
{ '<leader>fs', function() require('fzf-lua').lsp_document_symbols() end, desc = 'LSP symbols' },
},
}

View file

@ -3,7 +3,7 @@ return {
version = '^8',
lazy = false,
init = function()
vim.g.rustaceamvim = {
vim.g.rustaceanvim = {
server = {
settings = {
['rust-analyzer'] = {

View file

@ -2,5 +2,5 @@ return {
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = true,
opts = ...,
opts = {},
}

View file

@ -5,4 +5,3 @@ return {
indent = { enable = true },
},
}

23
lua/plugins/trouble.lua Normal file
View file

@ -0,0 +1,23 @@
return {
'folke/trouble.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
modes = {
diagnostics = {
mode = "diagnostics",
preview = {
type = "diagnostics",
relative = "win",
position = "right",
size = 0.4,
},
},
},
},
keys = {
{ '<leader>xx', '<cmd>Trouble diagnostics toggle<cr>', desc = 'Diagnostics (workspace)' },
{ '<leader>xd', '<cmd>Trouble diagnostics toggle filter.buf=0<cr>', desc = 'Diagnostics (buffer)' },
{ ']t', function() require('trouble').next({ skip_groups = true, jump = true }) end, desc = 'Next trouble item' },
{ '[t', function() require('trouble').prev({ skip_groups = true, jump = true }) end, desc = 'Prev trouble item' },
}
}

View file

@ -31,3 +31,11 @@ vim.opt.hlsearch = false -- do not keep matches highlighted
vim.opt.splitbelow = true -- horizontal splits open below
vim.opt.splitright = true -- vertical splits open to the right
-- Diagnostics
vim.diagnostic.config({
virtual_text = true, -- use virtual text for diagnostics
signs = true, -- use signs for diagnostics
underline = true, -- use underline for diagnostics
update_in_insert = false, -- update diagnostics in insert mod
severity_sort = true, -- sort diagnostics by severity
})