diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index f5c250f..5c509f0 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -17,6 +17,7 @@ return { formatters_by_ft = { lua = { "stylua" }, ruby = { "rufo" }, + go = { "gofmt" }, }, }, } diff --git a/.config/nvim/lua/plugins/lint.lua b/.config/nvim/lua/plugins/lint.lua index e0ad35d..8969b29 100644 --- a/.config/nvim/lua/plugins/lint.lua +++ b/.config/nvim/lua/plugins/lint.lua @@ -1,13 +1,24 @@ return { "mfussenegger/nvim-lint", + opts = { + linters_by_ft = { + -- ruby = { "rubocop", "standardrb" }, + ruby = { "standardrb" }, + go = { "golangcilint" }, + }, + }, config = function() - require("lint").linters_by_ft = { - ruby = { "rubocop", "standardrb" }, + local lint = require("lint") + + lint.linters_by_ft = { + -- ruby = { "rubocop", "standardrb" }, + ruby = { "standardrb" }, + go = { "golangcilint" }, } vim.api.nvim_create_autocmd({ "BufWritePost" }, { callback = function() - require("lint").try_lint() + lint.try_lint() end, }) end, diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index c5c7df7..eef86c3 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -1,14 +1,14 @@ return { { "williamboman/mason.nvim", - config = function() + config = function() require("mason").setup() end, -}, + }, { "williamboman/mason-lspconfig.nvim", dependencies = { "williamboman/mason.nvim" }, - config = function() + config = function() require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", @@ -49,6 +49,7 @@ return { }, }) lspconfig.pyright.setup({}) + lspconfig.gopls.setup({}) end, }, }