From 042c6dcb502d602f325d2b8b11780ab91ab2e87d Mon Sep 17 00:00:00 2001 From: DataHearth Date: Thu, 11 Apr 2024 19:34:58 +0200 Subject: [PATCH] module(neovim): add gopls config & additional plugins --- modules/neovim/default.nix | 27 +++++++++++++++++++++++++++ modules/neovim/plugins/lsp.nix | 11 ++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/modules/neovim/default.nix b/modules/neovim/default.nix index 9c1b495..8fc88e8 100644 --- a/modules/neovim/default.nix +++ b/modules/neovim/default.nix @@ -90,6 +90,33 @@ in }; }; }; + extraPlugins = [ + { + config = '' + lua require("gotests").setup() + ''; + plugin = pkgs.vimUtils.buildVimPlugin { + name = "gotests.nvim"; + src = pkgs.fetchFromGitHub { + owner = "yanskun"; + repo = "gotests.nvim"; + rev = "2ddd2a3d43a7ab92cc14f6a2f84291d991a30c2d"; + hash = "sha256-OHUK2pv9VHKzSuFRo3e1Y7Akjmjbs+jjxi6NaXHqeCk="; + }; + }; + } + { + plugin = pkgs.vimUtils.buildVimPlugin { + name = "vim-go-impl"; + src = pkgs.fetchFromGitHub { + owner = "rhysd"; + repo = "vim-go-impl"; + rev = "74988dc3958f68355b9d4a3ffaa97a74d0006248"; + hash = "sha256-oPjULtIQpIf5qrCbaiybOCaB4zJDmrBuCretyXPViCM="; + }; + }; + } + ]; }; }; } diff --git a/modules/neovim/plugins/lsp.nix b/modules/neovim/plugins/lsp.nix index 98e252b..cfb2bd1 100644 --- a/modules/neovim/plugins/lsp.nix +++ b/modules/neovim/plugins/lsp.nix @@ -3,7 +3,16 @@ servers = { bashls.enable = true; dockerls.enable = true; - gopls.enable = true; + gopls = { + enable = true; + extraOptions = { + staticcheck = true; + gofumpt = true; + analyses = { + unusedvariable = true; + }; + }; + }; html.enable = true; htmx.enable = true; jsonls.enable = true;