From 90b1a5fb3913902eb415a5c79a4203dcd8601b14 Mon Sep 17 00:00:00 2001 From: chaptersix Date: Tue, 4 Feb 2025 17:36:38 -0600 Subject: [PATCH] update config, more stuff for golang --- init.lua | 63 ++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index 4eae8e7d..3c7ce760 100644 --- a/init.lua +++ b/init.lua @@ -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 --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_next_item(), --[''] = 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.