diff --git a/plugins/default.nix b/plugins/default.nix index e1ba054b..34434ea0 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -30,6 +30,7 @@ ./nvim-lsp ./nvim-lsp/lspsaga.nix ./nvim-lsp/lsp-lines.nix + ./nvim-lsp/trouble.nix ./pluginmanagers/packer.nix diff --git a/plugins/nvim-lsp/trouble.nix b/plugins/nvim-lsp/trouble.nix new file mode 100644 index 00000000..ccb0fd9d --- /dev/null +++ b/plugins/nvim-lsp/trouble.nix @@ -0,0 +1,23 @@ +{ config, pkgs, lib, helpers, ... }: +let + cfg = config.plugins.trouble; +in +with lib; +# with helpers; +{ + options.plugins.trouble = { + enable = mkEnableOption "trouble.nvim"; + + position = helpers.mkNullOrOption (types.enum [ "top" "left" "right" "bottom" ]) "Position of the list"; + height = helpers.mkNullOrOption types.int "Height of the trouble list when position is top or bottom"; + width = helpers.mkNullOrOption types.int "Width of the trouble list when position is left or right"; + icons = helpers.mkNullOrOption types.bool "Use devicons for filenames"; + }; + + config = mkIf cfg.enable { + extraPlugins = with pkgs.vimPlugins; [ + trouble-nvim + nvim-web-devicons + ]; + }; +} diff --git a/tests/flake.lock b/tests/flake.lock index 67900918..eef046ea 100644 --- a/tests/flake.lock +++ b/tests/flake.lock @@ -97,12 +97,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-3m9eDTuaK9RS8HpctJwSu1wnyx5/CILSGppr+6OjTPw=", - "path": "/nix/store/pp50jx20wrkbrkv3mxkwzckciy8xcqy2-source", + "narHash": "sha256-b5FuoFQsTCgKsVTQS13qmFnMmVotIQWtcjPu+WT6ubo=", + "path": "/nix/store/m90wvnc3d4rci36q0r0j7d2i1sk35cgy-source", "type": "path" }, "original": { - "path": "/nix/store/pp50jx20wrkbrkv3mxkwzckciy8xcqy2-source", + "path": "/nix/store/m90wvnc3d4rci36q0r0j7d2i1sk35cgy-source", "type": "path" } }, @@ -116,12 +116,12 @@ }, "locked": { "lastModified": 0, - "narHash": "sha256-3m9eDTuaK9RS8HpctJwSu1wnyx5/CILSGppr+6OjTPw=", - "path": "/nix/store/pp50jx20wrkbrkv3mxkwzckciy8xcqy2-source", + "narHash": "sha256-b5FuoFQsTCgKsVTQS13qmFnMmVotIQWtcjPu+WT6ubo=", + "path": "/nix/store/m90wvnc3d4rci36q0r0j7d2i1sk35cgy-source", "type": "path" }, "original": { - "path": "/nix/store/pp50jx20wrkbrkv3mxkwzckciy8xcqy2-source", + "path": "/nix/store/m90wvnc3d4rci36q0r0j7d2i1sk35cgy-source", "type": "path" } }, diff --git a/tests/flake.nix b/tests/flake.nix index 3305bbab..8f4eabf7 100644 --- a/tests/flake.nix +++ b/tests/flake.nix @@ -61,6 +61,15 @@ plugins.lsp-lines.enable = true; }; + trouble = build { + plugins.lsp = { + enable = true; + servers.clangd.enable = true; + }; + + plugins.trouble.enable = true; + }; + issue-40 = build-stable { plugins = { nix.enable = true;