add trouble
side note? why was I using feat and chore and etc?
This commit is contained in:
parent
af16bba334
commit
d65c4083ba
9 changed files with 80 additions and 46 deletions
3
init.lua
3
init.lua
|
|
@ -19,6 +19,9 @@ vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
vim.keymap.set("n", "<leader>for", function()
|
vim.keymap.set("n", "<leader>for", function()
|
||||||
vim.lsp.buf.format({ async = true })
|
vim.lsp.buf.format({ async = true })
|
||||||
end, opts)
|
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,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
|
"blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
"fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||||
"fzf-lua": { "branch": "main", "commit": "76ddd6b56875bf4f6fd13848728207e738bb75a3" },
|
"fzf-lua": { "branch": "main", "commit": "bde73a6886b607246095aa59f396de5e0d036890" },
|
||||||
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
|
"gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
"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-treesitter-endwise": { "branch": "master", "commit": "8fe8a95630f4f2c72a87ba1927af649e0bfaa244" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
||||||
"rustaceanvim": { "branch": "master", "commit": "13f7f5c46d2db0b8daee64a842d8faebfe9064c0" }
|
"rustaceanvim": { "branch": "master", "commit": "f2f0c1231a5b019dbc1fd6dafac1751c878925a3" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,17 @@
|
||||||
-- Bootstrap lazy.nvim
|
-- Bootstrap lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
if vim.v.shell_error ~= 0 then
|
if vim.v.shell_error ~= 0 then
|
||||||
vim.api.nvim_echo({
|
vim.api.nvim_echo({
|
||||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
{ out, "WarningMsg" },
|
{ out, "WarningMsg" },
|
||||||
{ "\nPress any key to exit..." },
|
{ "\nPress any key to exit..." },
|
||||||
}, true, {})
|
}, true, {})
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
os.exit(1)
|
os.exit(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
|
@ -25,11 +25,11 @@ require("settings")
|
||||||
|
|
||||||
-- Setup lazy.nvim
|
-- Setup lazy.nvim
|
||||||
require("lazy").setup({
|
require("lazy").setup({
|
||||||
spec = {
|
spec = {
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
},
|
},
|
||||||
checker = {
|
checker = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
notify = false,
|
notify = false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,6 @@ return {
|
||||||
{ '<leader>fh', function() require('fzf-lua').help_tags() end, desc = 'Help tags' },
|
{ '<leader>fh', function() require('fzf-lua').help_tags() end, desc = 'Help tags' },
|
||||||
{ '<leader>fr', function() require('fzf-lua').oldfiles() end, desc = 'Recent files' },
|
{ '<leader>fr', function() require('fzf-lua').oldfiles() end, desc = 'Recent files' },
|
||||||
{ '<leader>fd', function() require('fzf-lua').diagnostic_document() end, desc = 'Diagnostics' },
|
{ '<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' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ return {
|
||||||
version = '^8',
|
version = '^8',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.rustaceamvim = {
|
vim.g.rustaceanvim = {
|
||||||
server = {
|
server = {
|
||||||
settings = {
|
settings = {
|
||||||
['rust-analyzer'] = {
|
['rust-analyzer'] = {
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@ return {
|
||||||
"ellisonleao/gruvbox.nvim",
|
"ellisonleao/gruvbox.nvim",
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = true,
|
config = true,
|
||||||
opts = ...,
|
opts = {},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,3 @@ return {
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
23
lua/plugins/trouble.lua
Normal file
23
lua/plugins/trouble.lua
Normal 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' },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,33 +1,41 @@
|
||||||
-- Line numbers
|
-- Line numbers
|
||||||
vim.opt.number = true -- show absolute line numbers
|
vim.opt.number = true -- show absolute line numbers
|
||||||
vim.opt.relativenumber = true -- show relative line numbers
|
vim.opt.relativenumber = true -- show relative line numbers
|
||||||
|
|
||||||
-- Mouse & clipboard
|
-- Mouse & clipboard
|
||||||
vim.opt.mouse = "a" -- enable mouse support
|
vim.opt.mouse = "a" -- enable mouse support
|
||||||
vim.opt.clipboard = "unnamedplus" -- use system clipboard
|
vim.opt.clipboard = "unnamedplus" -- use system clipboard
|
||||||
|
|
||||||
-- Visual behavior
|
-- Visual behavior
|
||||||
vim.opt.termguicolors = true -- enable true colors
|
vim.opt.termguicolors = true -- enable true colors
|
||||||
vim.opt.cursorline = true -- highlight the current line
|
vim.opt.cursorline = true -- highlight the current line
|
||||||
vim.opt.wrap = false -- do not wrap long lines
|
vim.opt.wrap = false -- do not wrap long lines
|
||||||
vim.opt.signcolumn = "yes" -- always show the sign number (LSP, git)
|
vim.opt.signcolumn = "yes" -- always show the sign number (LSP, git)
|
||||||
|
|
||||||
-- Scrolling
|
-- Scrolling
|
||||||
vim.opt.scrolloff = 8 -- keep space above/below cursor
|
vim.opt.scrolloff = 8 -- keep space above/below cursor
|
||||||
vim.opt.sidescrolloff = 8 -- keep space left/right of cursor
|
vim.opt.sidescrolloff = 8 -- keep space left/right of cursor
|
||||||
|
|
||||||
-- Indentation
|
-- Indentation
|
||||||
vim.opt.expandtab = true -- use spaces instead of tabs
|
vim.opt.expandtab = true -- use spaces instead of tabs
|
||||||
vim.opt.tabstop = 2 -- how many spaces a tab looks like
|
vim.opt.tabstop = 2 -- how many spaces a tab looks like
|
||||||
vim.opt.shiftwidth = 2 -- how many spaces when indenting
|
vim.opt.shiftwidth = 2 -- how many spaces when indenting
|
||||||
|
|
||||||
-- Search
|
-- Search
|
||||||
vim.opt.ignorecase = true -- case-insensitive search
|
vim.opt.ignorecase = true -- case-insensitive search
|
||||||
vim.opt.smartcase = true -- case-sensitive if uppercase is used
|
vim.opt.smartcase = true -- case-sensitive if uppercase is used
|
||||||
vim.opt.incsearch = true -- show matches while typing
|
vim.opt.incsearch = true -- show matches while typing
|
||||||
vim.opt.hlsearch = false -- do not keep matches highlighted
|
vim.opt.hlsearch = false -- do not keep matches highlighted
|
||||||
|
|
||||||
-- Window splits
|
-- Window splits
|
||||||
vim.opt.splitbelow = true -- horizontal splits open below
|
vim.opt.splitbelow = true -- horizontal splits open below
|
||||||
vim.opt.splitright = true -- vertical splits open to the right
|
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
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue