plugins: Add tagbar (#156)

* plugins: Add tagbar

* tagbar: fix typo

---------

Co-authored-by: Pedro Alves <pta2002@pta2002.com>
This commit is contained in:
Gaétan Lepage 2023-02-14 20:50:47 +01:00 committed by GitHub
parent e5ef91be0b
commit b6e01b9100
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 0 deletions

View file

@ -27,6 +27,7 @@
./languages/nix.nix ./languages/nix.nix
./languages/plantuml-syntax.nix ./languages/plantuml-syntax.nix
./languages/rust.nix ./languages/rust.nix
./languages/tagbar.nix
./languages/treesitter.nix ./languages/treesitter.nix
./languages/treesitter-context.nix ./languages/treesitter-context.nix
./languages/treesitter-refactor.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 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: value: nameValuePair ("tagbar_" + name) value) cfg.extraConfig;
};
}