lspkind: package option

This commit is contained in:
Alexander Nortung 2023-01-16 22:54:08 +01:00
parent 01ab0ba352
commit 39261bff6b

View file

@ -7,6 +7,13 @@ in
{ {
options.plugins.lspkind = { options.plugins.lspkind = {
enable = mkEnableOption "lspkind.nvim"; enable = mkEnableOption "lspkind.nvim";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.lspkind-nvim;
description = "Plugin to use for lspkind.nvim";
};
mode = mkOption { mode = mkOption {
type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]); type = with types; nullOr (enum [ "text" "text_symbol" "symbol_text" "symbol" ]);
default = null; default = null;
@ -72,7 +79,7 @@ in
} else { }); } else { });
in in
mkIf cfg.enable { mkIf cfg.enable {
extraPlugins = [ pkgs.vimPlugins.lspkind-nvim ]; extraPlugins = [ cfg.package ];
extraConfigLua = optionalString (!doCmp) '' extraConfigLua = optionalString (!doCmp) ''
require('lspkind').init(${helpers.toLuaObject options}) require('lspkind').init(${helpers.toLuaObject options})