lazy plugins

This commit is contained in:
tavo 2025-08-11 02:01:23 -06:00
parent 0bed87b198
commit 3176f4411f
3 changed files with 96 additions and 0 deletions

6
.gitignore vendored
View file

@ -269,3 +269,9 @@ syncthing/
rclone-browser/
gnome-xdg-terminals.list
yazi/
# Ignore lazyvim repo except custom configs
nvim/*
!nvim/lua/
nvim/lua/*
!nvim/lua/plugins/
nvim/lua/plugins/example.lua

78
nvim/lua/plugins/go.lua Normal file
View file

@ -0,0 +1,78 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"go",
"gomod",
"gowork",
"gosum",
},
},
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
gopls = {
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
},
analyses = {
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
usePlaceholders = true,
completeUnimported = true,
staticcheck = true,
directoryFilters = { "-.git", "-.vscode", "-.idea", "-.vscode-test", "-node_modules" },
semanticTokens = true,
},
},
},
},
setup = {
gopls = function(_, opts)
-- workaround for gopls not supporting semanticTokensProvider
-- https://github.com/golang/go/issues/54531#issuecomment-1464982242
LazyVim.lsp.on_attach(function(client, _)
if not client.server_capabilities.semanticTokensProvider then
local semantic = client.config.capabilities.textDocument.semanticTokens
client.server_capabilities.semanticTokensProvider = {
full = true,
legend = {
tokenTypes = semantic.tokenTypes,
tokenModifiers = semantic.tokenModifiers,
},
range = true,
}
end
end, "gopls")
-- end workaround
end,
},
},
},
}

View file

@ -0,0 +1,12 @@
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
}