plugins: Add tagbar

This commit is contained in:
Gaetan Lepage 2023-01-26 14:31:50 +01:00
parent c73bef16ab
commit f8d657c6f3
2 changed files with 36 additions and 0 deletions

View file

@ -25,6 +25,7 @@
./languages/nix.nix
./languages/plantuml-syntax.nix
./languages/rust.nix
./languages/tagbar.nix
./languages/treesitter.nix
./languages/treesitter-context.nix
./languages/treesitter-refactor.nix

View file

@ -0,0 +1,35 @@
{ pkgs
, lib
, config
, ...
}:
let
cfg = config.plugins.tagbar;
helpers = import ../helpers.nix { inherit lib; };
in
with lib;
{
options.plugins.tagbar = {
enable = mkEnableOption "tagbar";
package = helpers.mkPackageOption "tagbar" pkgs.vimPlugins.tagbar;
extraConfig = helpers.mkNullOrOption types.attrs ''
The configuration options for vimtex 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: value: nameValuePair ("tagbar_" + name) value) cfg.extraConfig;
};
}