Skip to content

Commit

Permalink
plugins/fugit2: init
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored and nix-infra-bot committed Jan 3, 2025
1 parent 3285bbd commit e1b39b7
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 0 deletions.
72 changes: 72 additions & 0 deletions plugins/by-name/fugit2/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{ lib, ... }:
let
inherit (lib) types;
inherit (lib.nixvim) defaultNullOpts mkNullOrStr;
in
lib.nixvim.plugins.mkNeovimPlugin {
name = "fugit2";
packPathName = "fugit2.nvim";
package = "fugit2-nvim";

maintainers = [ lib.maintainers.GaetanLepage ];

settingsOptions = {
width = defaultNullOpts.mkNullable (with types; either str ints.unsigned) 100 ''
Main popup width.
'';

max_width = defaultNullOpts.mkNullable (with types; either str ints.unsigned) "80%" ''
Main popup width when expand patch view.
'';

min_width = defaultNullOpts.mkUnsignedInt 50 ''
File view width when expand patch view.
'';

content_width = defaultNullOpts.mkUnsignedInt 60 ''
File view content width.
'';

height = defaultNullOpts.mkNullable (with types; either str ints.unsigned) "60%" ''
Main popup height.
'';

show_patch = defaultNullOpts.mkBool false ''
Whether to show patch for active file when open `fugit2` main window.
'';

libgit2_path = mkNullOrStr ''
Path to `libgit2` lib if not set via environments.
'';

gpgme_path = defaultNullOpts.mkStr "gpgme" ''
Path to the `gpgme` lib.
'';

external_diffview = defaultNullOpts.mkBool false ''
Whether to use external diffview.nvim or Fugit2 implementation.
'';

blame_priority = defaultNullOpts.mkUnsignedInt 1 ''
Priority of blame virtual text.
'';

blame_info_width = defaultNullOpts.mkUnsignedInt 60 ''
Width of blame hunk detail popup.
'';

blame_info_height = defaultNullOpts.mkUnsignedInt 10 ''
Height of blame hunk detail popup.
'';

colorscheme = mkNullOrStr ''
Custom colorscheme specification.
'';
};

settingsExample = {
width = "62%";
height = "90%";
external_diffview = true;
};
}
39 changes: 39 additions & 0 deletions tests/test-sources/plugins/by-name/fugit2/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
empty = {
plugins.fugit2.enable = true;
};

defaults = {
plugins.fugit2 = {
enable = true;

settings = {
width = 100;
max_width = "80%";
min_width = 50;
content_width = 60;
height = "60%";
show_patch = false;
libgit2_path = null;
gpgme_path = "gpgme";
external_diffview = false;
blame_priority = 1;
blame_info_width = 60;
blame_info_height = 10;
colorscheme = null;
};
};
};

example = {
plugins.fugit2 = {
enable = true;

settings = {
width = "62%";
height = "90%";
external_diffview = true;
};
};
};
}

0 comments on commit e1b39b7

Please sign in to comment.