plugins/git: normalize plugin defaults

This commit is contained in:
Matt Sturgeon 2024-06-11 16:52:32 +01:00
parent 25eed3c2f5
commit a208c7181c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
8 changed files with 182 additions and 197 deletions

View file

@ -39,24 +39,21 @@ with lib;
mappings = helpers.defaultNullOpts.mkStr "<leader>gy" "Mapping to call url generation.";
callbacks =
helpers.defaultNullOpts.mkNullable (with types; attrsOf (either str helpers.nixvimTypes.rawLua))
helpers.defaultNullOpts.mkAttrsOf types.str
{
"github.com" = "get_github_type_url";
"gitlab.com" = "get_gitlab_type_url";
"try.gitea.io" = "get_gitea_type_url";
"codeberg.org" = "get_gitea_type_url";
"bitbucket.org" = "get_bitbucket_type_url";
"try.gogs.io" = "get_gogs_type_url";
"git.sr.ht" = "get_srht_type_url";
"git.launchpad.net" = "get_launchpad_type_url";
"repo.or.cz" = "get_repoorcz_type_url";
"git.kernel.org" = "get_cgit_type_url";
"git.savannah.gnu.org" = "get_cgit_type_url";
}
''
{
"github.com" = "get_github_type_url";
"gitlab.com" = "get_gitlab_type_url";
"try.gitea.io" = "get_gitea_type_url";
"codeberg.org" = "get_gitea_type_url";
"bitbucket.org" = "get_bitbucket_type_url";
"try.gogs.io" = "get_gogs_type_url";
"git.sr.ht" = "get_srht_type_url";
"git.launchpad.net" = "get_launchpad_type_url";
"repo.or.cz" = "get_repoorcz_type_url";
"git.kernel.org" = "get_cgit_type_url";
"git.savannah.gnu.org" = "get_cgit_type_url";
}
''
''
Each key can be
- the name of a built-in callback. Example: `"get_gitlab_type_url";` is setting
```lua