mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
plugins/plantuml-syntax: migrate to mkVimPlugin
This commit is contained in:
parent
471f68d9bb
commit
6c30476a4d
3 changed files with 43 additions and 33 deletions
|
@ -76,7 +76,6 @@ KNOWN_PATHS: dict[
|
||||||
"plugins/by-name/lspkind/default.nix": (State.OLD, Kind.NEOVIM, False),
|
"plugins/by-name/lspkind/default.nix": (State.OLD, Kind.NEOVIM, False),
|
||||||
"plugins/by-name/nix-develop/default.nix": (State.OLD, Kind.NEOVIM, False),
|
"plugins/by-name/nix-develop/default.nix": (State.OLD, Kind.NEOVIM, False),
|
||||||
"plugins/by-name/openscad/default.nix": (State.OLD, Kind.VIM, False),
|
"plugins/by-name/openscad/default.nix": (State.OLD, Kind.VIM, False),
|
||||||
"plugins/by-name/plantuml-syntax/default.nix": (State.OLD, Kind.VIM, False),
|
|
||||||
"plugins/by-name/rainbow-delimiters/default.nix": (State.OLD, Kind.NEOVIM, False),
|
"plugins/by-name/rainbow-delimiters/default.nix": (State.OLD, Kind.NEOVIM, False),
|
||||||
"plugins/by-name/treesitter-refactor/default.nix": (State.OLD, Kind.MISC, True),
|
"plugins/by-name/treesitter-refactor/default.nix": (State.OLD, Kind.MISC, True),
|
||||||
"plugins/by-name/treesitter-textobjects/default.nix": (
|
"plugins/by-name/treesitter-textobjects/default.nix": (
|
||||||
|
|
|
@ -1,44 +1,44 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
let
|
||||||
{
|
inherit (lib.nixvim) defaultNullOpts;
|
||||||
options.plugins.plantuml-syntax = {
|
in
|
||||||
enable = mkEnableOption "plantuml syntax support";
|
lib.nixvim.vim-plugin.mkVimPlugin {
|
||||||
|
name = "plantuml-syntax";
|
||||||
|
globalPrefix = "plantuml_";
|
||||||
|
|
||||||
package = lib.mkPackageOption pkgs "plantuml-syntax" {
|
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||||
default = [
|
|
||||||
"vimPlugins"
|
# TODO introduced 2024-03-02: remove 2024-05-02
|
||||||
"plantuml-syntax"
|
deprecateExtraConfig = true;
|
||||||
|
optionsRenamedToSettings = [
|
||||||
|
"setMakeprg"
|
||||||
|
"executableScript"
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
setMakeprg = mkOption {
|
extraOptions = {
|
||||||
type = types.bool;
|
plantumlPackage = lib.mkPackageOption pkgs "plantuml" {
|
||||||
default = true;
|
nullable = true;
|
||||||
description = "Set the makeprg to 'plantuml'";
|
|
||||||
};
|
|
||||||
executableScript = mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
description = "Set the script to be called with makeprg, default to 'plantuml' in PATH";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
extraConfig = cfg: { extraPackages = [ cfg.plantumlPackage ]; };
|
||||||
let
|
|
||||||
cfg = config.plugins.plantuml-syntax;
|
|
||||||
in
|
|
||||||
mkIf cfg.enable {
|
|
||||||
extraPlugins = [ cfg.package ];
|
|
||||||
|
|
||||||
globals = {
|
settingsOptions = {
|
||||||
plantuml_set_makeprg = cfg.setMakeprg;
|
set_makeprg = defaultNullOpts.mkFlagInt 1 ''
|
||||||
plantuml_executable_script = cfg.executableScript;
|
Set the makeprg to `plantuml`.
|
||||||
|
'';
|
||||||
|
|
||||||
|
executable_script = defaultNullOpts.mkStr "plantuml" ''
|
||||||
|
Set the script to be called with makeprg, default to `plantuml` in `$PATH`.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
settingsExample = {
|
||||||
|
set_makeprg = true;
|
||||||
|
executable_script = "plantuml";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,4 +2,15 @@
|
||||||
empty = {
|
empty = {
|
||||||
plugins.plantuml-syntax.enable = true;
|
plugins.plantuml-syntax.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
plugins.plantuml-syntax = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
set_makeprg = 1;
|
||||||
|
executable_script = "plantuml";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue