From 65ed2febb5228ce000ee2067bdc35afae15ef88a Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 13 Oct 2024 19:45:25 +0300 Subject: [PATCH] feat: some go changes --- .config/nvim/after/ftplugin/go.lua | 6 +++++- .config/nvim/lua/custom/config/commands.lua | 2 +- .config/nvim/lua/custom/config/language-servers.lua | 6 +++--- .config/nvim/lua/custom/plugins/mason.lua | 2 +- .config/nvim/lua/custom/plugins/nvim-lint.lua | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.config/nvim/after/ftplugin/go.lua b/.config/nvim/after/ftplugin/go.lua index 3436b9c..cf26a95 100644 --- a/.config/nvim/after/ftplugin/go.lua +++ b/.config/nvim/after/ftplugin/go.lua @@ -1 +1,5 @@ -vim.opt_local.expandtab = false +-- Tab +vim.opt_local.expandtab = false -- convert tabs to spaces +vim.opt_local.tabstop = 4 -- number of visual spaces per TAB +vim.opt_local.softtabstop = 4 -- number of idfk tab when editing +vim.opt_local.shiftwidth = 4 -- number of spaces to insert on tab diff --git a/.config/nvim/lua/custom/config/commands.lua b/.config/nvim/lua/custom/config/commands.lua index 50fca05..37bd2fc 100644 --- a/.config/nvim/lua/custom/config/commands.lua +++ b/.config/nvim/lua/custom/config/commands.lua @@ -67,7 +67,7 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'TextChanged', 'InsertLeave' }, { local text = vim.api.nvim_buf_get_text(bufnr, start_row, start_col, end_row, end_col, {})[1] -- Highlight only the parts matching `%[a-z]` - for match_start, match_end in text:gmatch('()%%[a-z]()') do + for match_start, match_end in text:gmatch('()%%[a-zT]()') do vim.api.nvim_buf_add_highlight( bufnr, -1, diff --git a/.config/nvim/lua/custom/config/language-servers.lua b/.config/nvim/lua/custom/config/language-servers.lua index 7da2eaf..1965caa 100644 --- a/.config/nvim/lua/custom/config/language-servers.lua +++ b/.config/nvim/lua/custom/config/language-servers.lua @@ -85,12 +85,12 @@ return { vendor = true, }, hints = { - assignVariableTypes = true, - compositeLiteralFields = true, + assignVariableTypes = false, + compositeLiteralFields = false, compositeLiteralTypes = true, constantValues = true, functionTypeParameters = true, - -- parameterNames = true, + parameterNames = false, rangeVariableTypes = true, }, analyses = { diff --git a/.config/nvim/lua/custom/plugins/mason.lua b/.config/nvim/lua/custom/plugins/mason.lua index a87318a..7d18810 100644 --- a/.config/nvim/lua/custom/plugins/mason.lua +++ b/.config/nvim/lua/custom/plugins/mason.lua @@ -25,7 +25,7 @@ return { 'isort', -- python formatter for imports 'flake8', -- python linter 'gofumpt', -- go formatter - 'golangci-lint', -- go linter + -- 'golangci-lint', -- go linter 'prettierd', -- multi-lang formatter 'prettier', -- prettierd but slower, used as a fallback 'jq', -- json formatter diff --git a/.config/nvim/lua/custom/plugins/nvim-lint.lua b/.config/nvim/lua/custom/plugins/nvim-lint.lua index 67aca74..beef255 100644 --- a/.config/nvim/lua/custom/plugins/nvim-lint.lua +++ b/.config/nvim/lua/custom/plugins/nvim-lint.lua @@ -6,7 +6,7 @@ return { lint.linters_by_ft = { c = { 'clangtidy' }, cpp = { 'clangtidy' }, - -- go = { 'golangci-lint' }, + go = { 'golangcilint' }, python = { 'flake8' }, json = { 'jsonlint' }, bash = { 'shellcheck' },