update config, more stuff for golang

This commit is contained in:
chaptersix 2025-02-04 17:36:38 -06:00
parent 5bdde24dfb
commit 90b1a5fb39
1 changed files with 48 additions and 15 deletions

View File

@ -67,8 +67,8 @@ Kickstart Guide:
which is very useful when you're not exactly sure of what you're looking for.
I have left several `:help X` comments throughout the init.lua
These are hints about where to find more information about the relevant settings,
plugins or Neovim features used in Kickstart.
-- These are hints about where to find more information about the relevant settings,
-- plugins or Neovim features used in Kickstart.
NOTE: Look for lines like this
@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true
-- [[ Setting options ]]
-- See `:help vim.opt`
@ -114,9 +114,9 @@ vim.opt.showmode = false
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.schedule(function()
vim.opt.clipboard = 'unnamedplus'
end)
-- vim.schedule(function()
-- vim.opt.clipboard = 'unnamedplus'
--end)
-- Enable break indent
vim.opt.breakindent = true
@ -617,7 +617,40 @@ require('lazy').setup({
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
gopls = {
settings = {
gopls = {
analyses = {
unusedparams = true, -- Highlights unused function parameters
unusedwrite = true, -- Highlights unused variable writes
unusedvariable = true, -- Highlights unused variables
fieldalignment = true, -- Checks struct field alignment
nilness = true, -- Checks for nil dereferences
shadow = true, -- Checks for shadowed variables
unusedresult = true, -- Highlights unused function return values
},
staticcheck = true,
completeUnimported = true, -- Suggests completions for unimported packages
usePlaceholders = false, -- Adds placeholders for function arguments in completions
completionDocumentation = true, -- Shows documentation for completion items
annotations = {
bounds = true, -- Highlights array/slice index out-of-bounds errors
escape = true, -- Highlights incorrect escape sequences in string literals
inline = true, -- Shows inline diagnostics in the code
},
workspace = {
usePlaceholders = false, -- Adds placeholders for function arguments in completions
semanticTokens = true, -- Enables semantic token highlighting
experimentalPostfixCompletions = true, -- Enables postfix completions (e.g., .if, .for)
},
formatting = {
gofumpt = true,
localimports = true,
},
},
},
},
-- pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@ -694,7 +727,7 @@ require('lazy').setup({
},
},
opts = {
notify_on_error = false,
notify_on_error = true,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
@ -794,7 +827,7 @@ require('lazy').setup({
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp.
@ -931,12 +964,12 @@ require('lazy').setup({
-- Here are some example plugins that I've included in the Kickstart repository.
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- require 'kickstart.plugins.debug',
-- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs',
require 'kickstart.plugins.neo-tree',
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.