diff --git a/.gitignore b/.gitignore index 70ad090..0840c68 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/nvim/lua/plugins/go.lua b/nvim/lua/plugins/go.lua new file mode 100644 index 0000000..cba1194 --- /dev/null +++ b/nvim/lua/plugins/go.lua @@ -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, + }, + }, + }, +} diff --git a/nvim/lua/plugins/theme.lua b/nvim/lua/plugins/theme.lua new file mode 100644 index 0000000..f206ac3 --- /dev/null +++ b/nvim/lua/plugins/theme.lua @@ -0,0 +1,12 @@ +return { + -- add gruvbox + { "ellisonleao/gruvbox.nvim" }, + + -- Configure LazyVim to load gruvbox + { + "LazyVim/LazyVim", + opts = { + colorscheme = "gruvbox", + }, + }, +}