From 0ed3daacef4deaf4aac0b544a5e0ade3810ae40a Mon Sep 17 00:00:00 2001 From: pml68 Date: Sat, 30 Nov 2024 01:18:00 +0100 Subject: feat: add Go support --- lua/pml68/plugins/guard.lua | 5 +++++ lua/pml68/plugins/lang-specific.lua | 8 ++++++++ lua/pml68/plugins/treesitter.lua | 5 +++++ 3 files changed, 18 insertions(+) (limited to 'lua/pml68/plugins') 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 -- cgit v1.2.3