diff options
| -rw-r--r-- | lua/pml68/configs/lspconfig.lua | 1 | ||||
| -rw-r--r-- | lua/pml68/configs/mason.lua | 3 | ||||
| -rw-r--r-- | lua/pml68/configs/settings/gopls.lua | 10 | ||||
| -rw-r--r-- | lua/pml68/plugins/guard.lua | 5 | ||||
| -rw-r--r-- | lua/pml68/plugins/lang-specific.lua | 8 | ||||
| -rw-r--r-- | lua/pml68/plugins/treesitter.lua | 5 | ||||
| -rw-r--r-- | lua/pml68/remap.lua | 6 |
7 files changed, 38 insertions, 0 deletions
diff --git a/lua/pml68/configs/lspconfig.lua b/lua/pml68/configs/lspconfig.lua index 60c4e44..8d16958 100644 --- a/lua/pml68/configs/lspconfig.lua +++ b/lua/pml68/configs/lspconfig.lua @@ -21,6 +21,7 @@ local servers = { "lua_ls", "glsl_analyzer", "csharp_ls", + "gopls", } vim.api.nvim_create_autocmd({ "BufEnter" }, { diff --git a/lua/pml68/configs/mason.lua b/lua/pml68/configs/mason.lua index c6b7c02..0f87a8e 100644 --- a/lua/pml68/configs/mason.lua +++ b/lua/pml68/configs/mason.lua @@ -19,6 +19,9 @@ return { "kotlin-language-server", "jdtls", "csharp-language-server", + "gopls", + "gofumpt", + "golines", }, PATH = "skip", ui = { diff --git a/lua/pml68/configs/settings/gopls.lua b/lua/pml68/configs/settings/gopls.lua new file mode 100644 index 0000000..a2b5212 --- /dev/null +++ b/lua/pml68/configs/settings/gopls.lua @@ -0,0 +1,10 @@ +return { + settings = { + gopls = { + completeUnimported = true, + analyses = { + unusedparams = true, + }, + }, + }, +} diff --git a/lua/pml68/plugins/guard.lua b/lua/pml68/plugins/guard.lua index 9f033b3..86cdfd2 100644 --- a/lua/pml68/plugins/guard.lua +++ b/lua/pml68/plugins/guard.lua @@ -12,6 +12,11 @@ return { cmd = "jq", stdin = true }) + ft("go"):fmt({ + cmd = "golines", + args = { "--max-len=80", "--base-formatter=gofumpt" }, + stdin = true, + }) vim.g.guard_config = { fmt_on_save = true, lsp_as_default_formatter = true diff --git a/lua/pml68/plugins/lang-specific.lua b/lua/pml68/plugins/lang-specific.lua index f2cb418..218cfeb 100644 --- a/lua/pml68/plugins/lang-specific.lua +++ b/lua/pml68/plugins/lang-specific.lua @@ -7,6 +7,14 @@ return { { "mfussenegger/nvim-jdtls" }, + -- Go + { + "olexsmir/gopher.nvim", + ft = "go", + build = function() + vim.cmd("silent! GoInstallDeps") + end, + }, -- Rust { "rust-lang/rust.vim", diff --git a/lua/pml68/plugins/treesitter.lua b/lua/pml68/plugins/treesitter.lua index 3d395ea..805246d 100644 --- a/lua/pml68/plugins/treesitter.lua +++ b/lua/pml68/plugins/treesitter.lua @@ -30,6 +30,11 @@ return { "gitignore", "gitattributes", "gitcommit", + "go", + "gosum", + "gomod", + "gotmpl", + "gowork", }, highlight = { enable = true diff --git a/lua/pml68/remap.lua b/lua/pml68/remap.lua index 220319a..8cfd1d7 100644 --- a/lua/pml68/remap.lua +++ b/lua/pml68/remap.lua @@ -42,6 +42,12 @@ vim.keymap.set("n", "<leader>gol", "<cmd>CellularAutomaton game_of_life<CR>") vim.keymap.set("n", "<leader>ll", "<cmd>VimtexCompile<CR>") vim.keymap.set("n", "<leader>vl", "<cmd>VimtexView<CR>") +-- Go +vim.keymap.set("n", "<leader>gj", "<cmd>GoTagAdd json<CR>") +vim.keymap.set("n", "<leader>gy", "<cmd>GoTagAdd yaml<CR>") +vim.keymap.set("n", "<leader>ge", "<cmd>GoIfErr<CR>") +vim.keymap.set("n", "<leader>gt", "<cmd>GoMod tidy<CR>") + -- Screenkey vim.keymap.set("n", "<leader>sk", "<cmd>Screenkey<CR>") |
