From 31733abebd1d2407b77d018639310c9a3cbe7128 Mon Sep 17 00:00:00 2001 From: Nikita Avgustanov Date: Thu, 20 Nov 2025 12:20:52 +0400 Subject: [PATCH] Added some things for go support --- init.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 9fdb55ab..82713ec8 100644 --- a/init.lua +++ b/init.lua @@ -677,7 +677,7 @@ 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 = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -725,7 +725,9 @@ require('lazy').setup({ require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-lspconfig').setup { - ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) + ensure_installed = { + 'gopls', + }, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer) automatic_installation = false, handlers = { function(server_name) @@ -773,6 +775,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + go = { 'gofmt' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- @@ -804,12 +807,12 @@ require('lazy').setup({ -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - -- { - -- 'rafamadriz/friendly-snippets', - -- config = function() - -- require('luasnip.loaders.from_vscode').lazy_load() - -- end, - -- }, + { + 'rafamadriz/friendly-snippets', + config = function() + require('luasnip.loaders.from_vscode').lazy_load() + end, + }, }, opts = {}, }, @@ -949,7 +952,7 @@ require('lazy').setup({ main = 'nvim-treesitter.configs', -- Sets main module to use for opts -- [[ Configure Treesitter ]] See `:help nvim-treesitter` opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'go' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -978,7 +981,7 @@ 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.debug', -- require 'kickstart.plugins.indent_line', require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs',