mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-22 08:53:28 +02:00
plugins/git: normalize plugin defaults
This commit is contained in:
parent
25eed3c2f5
commit
a208c7181c
8 changed files with 182 additions and 197 deletions
|
@ -73,7 +73,7 @@ let
|
||||||
current window.
|
current window.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
winOpts = mkAttributeSet "{}" ''
|
winOpts = mkAttributeSet { } ''
|
||||||
Table of window local options (see |vim.opt_local|).
|
Table of window local options (see |vim.opt_local|).
|
||||||
These options are applied whenever the window is opened.
|
These options are applied whenever the window is opened.
|
||||||
'';
|
'';
|
||||||
|
@ -96,11 +96,11 @@ in
|
||||||
See ':h diffview-config-enhanced_diff_hl'
|
See ':h diffview-config-enhanced_diff_hl'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
gitCmd = mkNullable (types.listOf types.str) ''[ "git" ]'' ''
|
gitCmd = mkListOf types.str [ "git" ] ''
|
||||||
The git executable followed by default args.
|
The git executable followed by default args.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
hgCmd = mkNullable (types.listOf types.str) ''[ "hg" ]'' ''
|
hgCmd = mkListOf types.str [ "hg" ] ''
|
||||||
The hg executable followed by default args.
|
The hg executable followed by default args.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ in
|
||||||
List only the commits in the specified revision range.
|
List only the commits in the specified revision range.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
pathArgs = mkNullable (types.listOf types.str) "[]" ''
|
pathArgs = mkListOf types.str [ ] ''
|
||||||
Limit the target files to only the files matching the given
|
Limit the target files to only the files matching the given
|
||||||
path arguments (git pathspec is supported).
|
path arguments (git pathspec is supported).
|
||||||
'';
|
'';
|
||||||
|
@ -381,7 +381,7 @@ in
|
||||||
Limit the number of commits.
|
Limit the number of commits.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
l = mkNullable (types.listOf types.str) "[]" ''
|
l = mkListOf types.str [ ] ''
|
||||||
`{ ("<start>,<end>:<file>" | ":<funcname>:<file>")... }`
|
`{ ("<start>,<end>:<file>" | ":<funcname>:<file>")... }`
|
||||||
|
|
||||||
Trace the evolution of the line range given by <start>,<end>,
|
Trace the evolution of the line range given by <start>,<end>,
|
||||||
|
@ -454,9 +454,9 @@ in
|
||||||
commonDesc = "Default args prepended to the arg-list for the listed commands";
|
commonDesc = "Default args prepended to the arg-list for the listed commands";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
diffviewOpen = mkNullable (types.listOf types.str) "[ ]" commonDesc;
|
diffviewOpen = mkListOf types.str [ ] commonDesc;
|
||||||
|
|
||||||
diffviewFileHistory = mkNullable (types.listOf types.str) "[ ]" commonDesc;
|
diffviewFileHistory = mkListOf types.str [ ] commonDesc;
|
||||||
};
|
};
|
||||||
|
|
||||||
hooks =
|
hooks =
|
||||||
|
|
|
@ -24,7 +24,7 @@ helpers.neovim-plugin.mkNeovimPlugin config {
|
||||||
|
|
||||||
settingsOptions = {
|
settingsOptions = {
|
||||||
default_mappings =
|
default_mappings =
|
||||||
helpers.defaultNullOpts.mkNullable (with types; either bool (attrsOf str)) "true"
|
helpers.defaultNullOpts.mkNullable (with types; either bool (attrsOf str)) true
|
||||||
''
|
''
|
||||||
This plugin offers default buffer local mappings inside conflicted files.
|
This plugin offers default buffer local mappings inside conflicted files.
|
||||||
This is primarily because applying these mappings only to relevant buffers is impossible
|
This is primarily because applying these mappings only to relevant buffers is impossible
|
||||||
|
|
|
@ -24,23 +24,21 @@ in
|
||||||
|
|
||||||
highlightGroup = helpers.defaultNullOpts.mkStr "Comment" "The highlight group for virtual text.";
|
highlightGroup = helpers.defaultNullOpts.mkStr "Comment" "The highlight group for virtual text.";
|
||||||
|
|
||||||
displayVirtualText =
|
displayVirtualText = helpers.defaultNullOpts.mkBool true "If the blame message should be displayed as virtual text. You may want to disable this if you display the blame message in statusline.";
|
||||||
helpers.defaultNullOpts.mkNullable (types.nullOr types.bool) (toString true)
|
|
||||||
"If the blame message should be displayed as virtual text. You may want to disable this if you display the blame message in statusline.";
|
|
||||||
|
|
||||||
ignoredFiletypes = helpers.defaultNullOpts.mkNullable (types.listOf types.str) (toString
|
ignoredFiletypes =
|
||||||
[ ]
|
helpers.defaultNullOpts.mkListOf types.str [ ]
|
||||||
) "A list of filetypes for which gitblame information will not be displayed.";
|
"A list of filetypes for which gitblame information will not be displayed.";
|
||||||
|
|
||||||
delay =
|
delay =
|
||||||
helpers.defaultNullOpts.mkUnsignedInt 0
|
helpers.defaultNullOpts.mkUnsignedInt 0
|
||||||
"The delay in milliseconds after which the blame info will be displayed.";
|
"The delay in milliseconds after which the blame info will be displayed.";
|
||||||
|
|
||||||
virtualTextColumn =
|
virtualTextColumn =
|
||||||
helpers.defaultNullOpts.mkNullable types.ints.unsigned (toString null)
|
helpers.defaultNullOpts.mkNullable types.ints.unsigned null
|
||||||
"Have the blame message start at a given column instead of EOL. If the current line is longer than the specified column value the blame message will default to being displayed at EOL.";
|
"Have the blame message start at a given column instead of EOL. If the current line is longer than the specified column value the blame message will default to being displayed at EOL.";
|
||||||
|
|
||||||
extmarkOptions = helpers.defaultNullOpts.mkAttributeSet (toString null) "nvim_buf_set_extmark optional parameters. (Warning: overwriting id and virt_text will break the plugin behavior)";
|
extmarkOptions = helpers.defaultNullOpts.mkAttributeSet null "nvim_buf_set_extmark optional parameters. (Warning: overwriting id and virt_text will break the plugin behavior)";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,7 @@ with lib;
|
||||||
mappings = helpers.defaultNullOpts.mkStr "<leader>gy" "Mapping to call url generation.";
|
mappings = helpers.defaultNullOpts.mkStr "<leader>gy" "Mapping to call url generation.";
|
||||||
|
|
||||||
callbacks =
|
callbacks =
|
||||||
helpers.defaultNullOpts.mkNullable (with types; attrsOf (either str helpers.nixvimTypes.rawLua))
|
helpers.defaultNullOpts.mkAttrsOf types.str
|
||||||
''
|
|
||||||
{
|
{
|
||||||
"github.com" = "get_github_type_url";
|
"github.com" = "get_github_type_url";
|
||||||
"gitlab.com" = "get_gitlab_type_url";
|
"gitlab.com" = "get_gitlab_type_url";
|
||||||
|
@ -55,8 +54,6 @@ with lib;
|
||||||
"git.savannah.gnu.org" = "get_cgit_type_url";
|
"git.savannah.gnu.org" = "get_cgit_type_url";
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
''
|
|
||||||
|
|
||||||
Each key can be
|
Each key can be
|
||||||
- the name of a built-in callback. Example: `"get_gitlab_type_url";` is setting
|
- the name of a built-in callback. Example: `"get_gitlab_type_url";` is setting
|
||||||
```lua
|
```lua
|
||||||
|
|
|
@ -84,7 +84,7 @@ with lib;
|
||||||
Note: Word diff is enabled by typing "r" in a popup window.
|
Note: Word diff is enabled by typing "r" in a popup window.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
floatingWinOps = helpers.defaultNullOpts.mkNullable (types.attrsOf types.anything) "{}" ''
|
floatingWinOps = helpers.defaultNullOpts.mkAttrsOf types.anything { } ''
|
||||||
Options passed to nvim_open_win() on opening a popup window. This is useful when you want to
|
Options passed to nvim_open_win() on opening a popup window. This is useful when you want to
|
||||||
override some window options.
|
override some window options.
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -225,7 +225,6 @@ with lib;
|
||||||
|
|
||||||
count_chars =
|
count_chars =
|
||||||
helpers.defaultNullOpts.mkAttrsOf types.str
|
helpers.defaultNullOpts.mkAttrsOf types.str
|
||||||
''
|
|
||||||
{
|
{
|
||||||
"__unkeyed_1" = "1";
|
"__unkeyed_1" = "1";
|
||||||
"__unkeyed_2" = "2";
|
"__unkeyed_2" = "2";
|
||||||
|
@ -238,7 +237,6 @@ with lib;
|
||||||
"__unkeyed_9" = "9";
|
"__unkeyed_9" = "9";
|
||||||
"+" = ">";
|
"+" = ">";
|
||||||
}
|
}
|
||||||
''
|
|
||||||
''
|
''
|
||||||
The count characters used when `signs.*.show_count` is enabled.
|
The count characters used when `signs.*.show_count` is enabled.
|
||||||
The `+` entry is used as a fallback. With the default, any count outside of 1-9 uses the `>`
|
The `+` entry is used as a fallback. With the default, any count outside of 1-9 uses the `>`
|
||||||
|
@ -272,7 +270,6 @@ with lib;
|
||||||
|
|
||||||
preview_config =
|
preview_config =
|
||||||
helpers.defaultNullOpts.mkAttrsOf types.anything
|
helpers.defaultNullOpts.mkAttrsOf types.anything
|
||||||
''
|
|
||||||
{
|
{
|
||||||
border = "single";
|
border = "single";
|
||||||
style = "minimal";
|
style = "minimal";
|
||||||
|
@ -280,7 +277,6 @@ with lib;
|
||||||
row = 0;
|
row = 0;
|
||||||
col = 1;
|
col = 1;
|
||||||
}
|
}
|
||||||
''
|
|
||||||
''
|
''
|
||||||
Option overrides for the Gitsigns preview window.
|
Option overrides for the Gitsigns preview window.
|
||||||
Table is passed directly to `nvim_open_win`.
|
Table is passed directly to `nvim_open_win`.
|
||||||
|
|
|
@ -15,17 +15,24 @@ helpers.vim-plugin.mkVimPlugin config {
|
||||||
maintainers = [ helpers.maintainers.AndresBermeoMarinelli ];
|
maintainers = [ helpers.maintainers.AndresBermeoMarinelli ];
|
||||||
|
|
||||||
settingsOptions = {
|
settingsOptions = {
|
||||||
floating_window_winblend = helpers.defaultNullOpts.mkNullable (types.ints.between 0 100) "0" ''
|
floating_window_winblend = helpers.defaultNullOpts.mkNullable (types.ints.between 0 100) 0 ''
|
||||||
Set the transparency of the floating window.
|
Set the transparency of the floating window.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
floating_window_scaling_factor =
|
floating_window_scaling_factor =
|
||||||
helpers.defaultNullOpts.mkNullable types.numbers.nonnegative "0.9"
|
helpers.defaultNullOpts.mkNullable types.numbers.nonnegative 0.9
|
||||||
"Set the scaling factor for floating window.";
|
"Set the scaling factor for floating window.";
|
||||||
|
|
||||||
floating_window_border_chars =
|
floating_window_border_chars = helpers.defaultNullOpts.mkListOf types.str [
|
||||||
helpers.defaultNullOpts.mkListOf types.str ''["╭" "─" "╮" "│" "╯" "─" "╰" "│"]''
|
"╭"
|
||||||
"Customize lazygit popup window border characters.";
|
"─"
|
||||||
|
"╮"
|
||||||
|
"│"
|
||||||
|
"╯"
|
||||||
|
"─"
|
||||||
|
"╰"
|
||||||
|
"│"
|
||||||
|
] "Customize lazygit popup window border characters.";
|
||||||
|
|
||||||
floating_window_use_plenary = helpers.defaultNullOpts.mkBool false ''
|
floating_window_use_plenary = helpers.defaultNullOpts.mkBool false ''
|
||||||
Whether to use plenary.nvim to manage floating window if available.
|
Whether to use plenary.nvim to manage floating window if available.
|
||||||
|
@ -41,7 +48,7 @@ helpers.vim-plugin.mkVimPlugin config {
|
||||||
|
|
||||||
config_file_path = helpers.defaultNullOpts.mkNullable (
|
config_file_path = helpers.defaultNullOpts.mkNullable (
|
||||||
with types; either str (listOf str)
|
with types; either str (listOf str)
|
||||||
) "[]" "Custom config file path or list of custom config file paths.";
|
) [ ] "Custom config file path or list of custom config file paths.";
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsExample = {
|
settingsExample = {
|
||||||
|
|
|
@ -42,13 +42,11 @@ in
|
||||||
Disables signs for sections/items/hunks.
|
Disables signs for sections/items/hunks.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
git_services = helpers.defaultNullOpts.mkAttrsOf types.str ''
|
git_services = helpers.defaultNullOpts.mkAttrsOf types.str {
|
||||||
{
|
|
||||||
"github.com" = "https://github.com/$\{owner}/$\{repository}/compare/$\{branch_name}?expand=1";
|
"github.com" = "https://github.com/$\{owner}/$\{repository}/compare/$\{branch_name}?expand=1";
|
||||||
"bitbucket.org" = "https://bitbucket.org/$\{owner}/$\{repository}/pull-requests/new?source=$\{branch_name}&t=1";
|
"bitbucket.org" = "https://bitbucket.org/$\{owner}/$\{repository}/pull-requests/new?source=$\{branch_name}&t=1";
|
||||||
"gitlab.com" = "https://gitlab.com/$\{owner}/$\{repository}/merge_requests/new?merge_request[source_branch]=$\{branch_name}";
|
"gitlab.com" = "https://gitlab.com/$\{owner}/$\{repository}/merge_requests/new?merge_request[source_branch]=$\{branch_name}";
|
||||||
}
|
} "Used to generate URL's for branch popup action 'pull request'.";
|
||||||
'' "Used to generate URL's for branch popup action 'pull request'.";
|
|
||||||
|
|
||||||
fetch_after_checkout = helpers.defaultNullOpts.mkBool false ''
|
fetch_after_checkout = helpers.defaultNullOpts.mkBool false ''
|
||||||
Perform a fetch if the newly checked out branch has an upstream or pushRemote set.
|
Perform a fetch if the newly checked out branch has an upstream or pushRemote set.
|
||||||
|
@ -174,7 +172,12 @@ in
|
||||||
mapAttrs
|
mapAttrs
|
||||||
(
|
(
|
||||||
n: v:
|
n: v:
|
||||||
helpers.defaultNullOpts.mkListOf types.str ''["${v.closed}" "${v.opened}"]'' ''
|
helpers.defaultNullOpts.mkListOf types.str
|
||||||
|
[
|
||||||
|
"${v.closed}"
|
||||||
|
"${v.opened}"
|
||||||
|
]
|
||||||
|
''
|
||||||
The icons to use for open and closed ${n}s.
|
The icons to use for open and closed ${n}s.
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
|
@ -284,7 +287,6 @@ in
|
||||||
|
|
||||||
ignored_settings =
|
ignored_settings =
|
||||||
helpers.defaultNullOpts.mkListOf types.str
|
helpers.defaultNullOpts.mkListOf types.str
|
||||||
''
|
|
||||||
[
|
[
|
||||||
"NeogitPushPopup--force-with-lease"
|
"NeogitPushPopup--force-with-lease"
|
||||||
"NeogitPushPopup--force"
|
"NeogitPushPopup--force"
|
||||||
|
@ -292,7 +294,6 @@ in
|
||||||
"NeogitCommitPopup--allow-empty"
|
"NeogitCommitPopup--allow-empty"
|
||||||
"NeogitRevertPopup--no-edit"
|
"NeogitRevertPopup--no-edit"
|
||||||
]
|
]
|
||||||
''
|
|
||||||
''
|
''
|
||||||
Table of settings to never persist.
|
Table of settings to never persist.
|
||||||
Uses format "Filetype--cli-value".
|
Uses format "Filetype--cli-value".
|
||||||
|
@ -303,26 +304,21 @@ in
|
||||||
mkMappingOption = helpers.defaultNullOpts.mkAttrsOf (with types; either str (enum [ false ]));
|
mkMappingOption = helpers.defaultNullOpts.mkAttrsOf (with types; either str (enum [ false ]));
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
commit_editor = mkMappingOption ''
|
commit_editor = mkMappingOption {
|
||||||
{
|
|
||||||
q = "Close";
|
q = "Close";
|
||||||
"<c-c><c-c>" = "Submit";
|
"<c-c><c-c>" = "Submit";
|
||||||
"<c-c><c-k>" = "Abort";
|
"<c-c><c-k>" = "Abort";
|
||||||
"<m-p>" = "PrevMessage";
|
"<m-p>" = "PrevMessage";
|
||||||
"<m-n>" = "NextMessage";
|
"<m-n>" = "NextMessage";
|
||||||
"<m-r>" = "ResetMessage";
|
"<m-r>" = "ResetMessage";
|
||||||
}
|
} "Mappings for the commit editor.";
|
||||||
'' "Mappings for the commit editor.";
|
|
||||||
|
|
||||||
commit_editor_I = mkMappingOption ''
|
commit_editor_I = mkMappingOption {
|
||||||
{
|
|
||||||
"<c-c><c-c>" = "Submit";
|
"<c-c><c-c>" = "Submit";
|
||||||
"<c-c><c-k>" = "Abort";
|
"<c-c><c-k>" = "Abort";
|
||||||
}
|
} "Mappings for the commit editor (insert mode)";
|
||||||
'' "Mappings for the commit editor (insert mode)";
|
|
||||||
|
|
||||||
rebase_editor = mkMappingOption ''
|
rebase_editor = mkMappingOption {
|
||||||
{
|
|
||||||
p = "Pick";
|
p = "Pick";
|
||||||
r = "Reword";
|
r = "Reword";
|
||||||
e = "Edit";
|
e = "Edit";
|
||||||
|
@ -339,18 +335,14 @@ in
|
||||||
"<c-c><c-k>" = "Abort";
|
"<c-c><c-k>" = "Abort";
|
||||||
"[c" = "OpenOrScrollUp";
|
"[c" = "OpenOrScrollUp";
|
||||||
"]c" = "OpenOrScrollDown";
|
"]c" = "OpenOrScrollDown";
|
||||||
}
|
} "Mappings for the rebase editor.";
|
||||||
'' "Mappings for the rebase editor.";
|
|
||||||
|
|
||||||
rebase_editor_I = mkMappingOption ''
|
rebase_editor_I = mkMappingOption {
|
||||||
{
|
|
||||||
"<c-c><c-c>" = "Submit";
|
"<c-c><c-c>" = "Submit";
|
||||||
"<c-c><c-k>" = "Abort";
|
"<c-c><c-k>" = "Abort";
|
||||||
}
|
} "Mappings for the rebase editor (insert mode).";
|
||||||
'' "Mappings for the rebase editor (insert mode).";
|
|
||||||
|
|
||||||
finder = mkMappingOption ''
|
finder = mkMappingOption {
|
||||||
{
|
|
||||||
"<cr>" = "Select";
|
"<cr>" = "Select";
|
||||||
"<c-c>" = "Close";
|
"<c-c>" = "Close";
|
||||||
"<esc>" = "Close";
|
"<esc>" = "Close";
|
||||||
|
@ -367,11 +359,9 @@ in
|
||||||
"<ScrollWheelRight>" = "NOP";
|
"<ScrollWheelRight>" = "NOP";
|
||||||
"<LeftMouse>" = "MouseClick";
|
"<LeftMouse>" = "MouseClick";
|
||||||
"<2-LeftMouse>" = "NOP";
|
"<2-LeftMouse>" = "NOP";
|
||||||
}
|
} "Mappings for the finder.";
|
||||||
'' "Mappings for the finder.";
|
|
||||||
|
|
||||||
popup = mkMappingOption ''
|
popup = mkMappingOption {
|
||||||
{
|
|
||||||
"?" = "HelpPopup";
|
"?" = "HelpPopup";
|
||||||
A = "CherryPickPopup";
|
A = "CherryPickPopup";
|
||||||
d = "DiffPopup";
|
d = "DiffPopup";
|
||||||
|
@ -391,11 +381,9 @@ in
|
||||||
p = "PullPopup";
|
p = "PullPopup";
|
||||||
r = "RebasePopup";
|
r = "RebasePopup";
|
||||||
v = "RevertPopup";
|
v = "RevertPopup";
|
||||||
}
|
} "Mappings for popups.";
|
||||||
'' "Mappings for popups.";
|
|
||||||
|
|
||||||
status = mkMappingOption ''
|
status = mkMappingOption {
|
||||||
{
|
|
||||||
q = "Close";
|
q = "Close";
|
||||||
I = "InitRepo";
|
I = "InitRepo";
|
||||||
"1" = "Depth1";
|
"1" = "Depth1";
|
||||||
|
@ -422,8 +410,7 @@ in
|
||||||
"}" = "GoToNextHunkHeader";
|
"}" = "GoToNextHunkHeader";
|
||||||
"[c" = "OpenOrScrollUp";
|
"[c" = "OpenOrScrollUp";
|
||||||
"]c" = "OpenOrScrollDown";
|
"]c" = "OpenOrScrollDown";
|
||||||
}
|
} "Mappings for status.";
|
||||||
'' "Mappings for status.";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
notification_icon = helpers.defaultNullOpts.mkStr "" ''
|
notification_icon = helpers.defaultNullOpts.mkStr "" ''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue