mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 17:03:31 +02:00
plugins/tagbar: switch to using mkPlugin
This commit is contained in:
parent
bc0886c6bb
commit
c498d0b9c9
1 changed files with 8 additions and 27 deletions
|
@ -1,32 +1,13 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
helpers,
|
|
||||||
config,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
} @ args:
|
||||||
cfg = config.plugins.tagbar;
|
with lib;
|
||||||
in
|
with import ../helpers.nix {inherit lib;};
|
||||||
with lib; {
|
mkPlugin args {
|
||||||
options.plugins.tagbar = {
|
name = "tagbar";
|
||||||
enable = mkEnableOption "tagbar";
|
package = pkgs.vimPlugins.tagbar;
|
||||||
|
globalPrefix = "tagbar_";
|
||||||
package = helpers.mkPackageOption "tagbar" pkgs.vimPlugins.tagbar;
|
extraPackages = [pkgs.ctags];
|
||||||
|
|
||||||
extraConfig = helpers.mkNullOrOption types.attrs ''
|
|
||||||
The configuration options for tagbar without the 'tagbar_' prefix.
|
|
||||||
Example: To set 'tagbar_show_tag_count' to 1, write
|
|
||||||
extraConfig = {
|
|
||||||
show_tag_count = true;
|
|
||||||
};
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
extraPlugins = [cfg.package];
|
|
||||||
|
|
||||||
extraPackages = [pkgs.ctags];
|
|
||||||
|
|
||||||
globals = mapAttrs' (name: nameValuePair ("tagbar_" + name)) cfg.extraConfig;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue