plugins/git: move to by-name

This commit is contained in:
Matt Sturgeon 2024-09-05 02:39:54 +01:00
parent d016b139fc
commit 2a91b89445
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
29 changed files with 0 additions and 15 deletions

View file

@ -0,0 +1,29 @@
{
empty = {
plugins.committia.enable = true;
};
default = {
plugins.committia = {
enable = true;
settings = {
open_only_vim_starting = 1;
use_singlecolumn = "always";
min_window_width = 160;
status_window_opencmd = "belowright split";
diff_window_opencmd = "botright vsplit";
singlecolumn_diff_window_opencmd = "belowright split";
edit_window_width = 80;
status_window_min_height = 0;
};
};
};
no-packages = {
plugins.committia = {
enable = true;
gitPackage = null;
};
};
}

View file

@ -0,0 +1,171 @@
{
empty = {
plugins.diffview.enable = true;
};
example = {
plugins.diffview = {
enable = true;
diffBinaries = true;
enhancedDiffHl = true;
gitCmd = [ "git" ];
hgCmd = [ "hg" ];
useIcons = false;
showHelpHints = false;
watchIndex = true;
icons = {
folderClosed = "a";
folderOpen = "b";
};
signs = {
foldClosed = "c";
foldOpen = "d";
done = "e";
};
view = {
default = {
layout = "diff2_horizontal";
winbarInfo = true;
};
mergeTool = {
layout = "diff1_plain";
disableDiagnostics = false;
winbarInfo = false;
};
fileHistory = {
layout = "diff2_vertical";
winbarInfo = true;
};
};
filePanel = {
listingStyle = "list";
treeOptions = {
flattenDirs = false;
folderStatuses = "never";
};
winConfig = {
position = "right";
width = 20;
winOpts = { };
};
};
fileHistoryPanel = {
logOptions = {
git = {
singleFile = {
base = "a";
diffMerges = "combined";
};
multiFile.diffMerges = "first-parent";
};
hg = {
singleFile = { };
multiFile = { };
};
};
winConfig = {
position = "top";
height = 10;
winOpts = { };
};
};
commitLogPanel.winConfig.winOpts = { };
defaultArgs = {
diffviewOpen = [ "HEAD" ];
diffviewFileHistory = [ "%" ];
};
hooks = {
viewOpened = ''
function(view)
print(
("A new %s was opened on tab page %d!")
:format(view.class:name(), view.tabpage)
)
end
'';
};
keymaps = {
view = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
diff1 = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
}
];
diff2 = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
diff3 = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
diff4 = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
filePanel = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
fileHistoryPanel = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
optionPanel = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
helpPanel = [
{
mode = "n";
key = "<tab>";
action = "actions.select_next_entry";
description = "Open the diff for the next file";
}
];
};
};
};
no-packages = {
plugins.diffview = {
enable = true;
iconsPackage = null;
};
};
}

View file

@ -0,0 +1,47 @@
{
empty = {
plugins.git-conflict.enable = true;
};
defaults = {
plugins.git-conflict = {
enable = true;
settings = {
default_mappings = true;
default_commands = true;
disable_diagnostics = false;
list_opener = "copen";
highlights = {
incoming = "DiffAdd";
current = "DiffText";
ancestor = null;
};
};
};
};
example = {
plugins.git-conflict = {
enable = true;
settings = {
default_mappings = {
ours = "o";
theirs = "t";
none = "0";
both = "b";
next = "n";
prev = "p";
};
default_commands = true;
disable_diagnostics = false;
list_opener = "copen";
highlights = {
incoming = "DiffAdd";
current = "DiffText";
};
};
};
};
}

View file

@ -0,0 +1,36 @@
{
empty = {
plugins.git-worktree.enable = true;
};
telescopeEnabled = {
plugins.telescope = {
enable = true;
};
plugins.git-worktree = {
enable = true;
enableTelescope = true;
changeDirectoryCommand = "tcd";
updateOnChange = true;
updateOnChangeCommand = "e .";
clearJumpsOnChange = true;
};
};
telescopeDisabled = {
plugins.git-worktree = {
enable = true;
enableTelescope = false;
};
};
no-packages = {
plugins.git-worktree = {
enable = true;
gitPackage = null;
};
};
}

View file

@ -0,0 +1,53 @@
{
empty = {
plugins.gitblame.enable = true;
};
defaults = {
plugins.gitblame = {
enable = true;
settings = {
enabled = true;
message_template = " <author> <date> <summary>";
date_format = "%c";
message_when_not_committed = " Not Committed Yet";
highlight_group = "Comment";
set_extmark_options = { };
display_virtual_text = true;
ignored_filetypes = [ ];
delay = 250;
virtual_text_column = null;
use_blame_commit_file_urls = false;
schedule_event = "CursorMoved";
clear_event = "CursorMovedI";
clipboard_register = "+";
};
};
};
example = {
plugins.gitblame = {
enable = true;
settings = {
message_template = "<summary> <date> <author>";
date_format = "%r";
message_when_not_committed = "Oh please, commit this !";
highlight_group = "Question";
set_extmark_options.priority = 7;
display_virtual_text = false;
ignored_filetypes = [
"lua"
"c"
];
delay = 1000;
virtual_text_column = 80;
use_blame_commit_file_urls = true;
schedule_event = "CursorHold";
clear_event = "CursorHoldI";
clipboard_register = "*";
};
};
};
}

View file

@ -0,0 +1,41 @@
{ lib, pkgs, ... }:
{
empty = {
plugins.gitgutter.enable = true;
};
grep-command =
{ config, ... }:
{
plugins.gitgutter = {
enable = true;
grep = {
package = pkgs.gnugrep;
command = "";
};
};
assertions = [
{
assertion =
config.extraPackages != [ ] && lib.any (x: x.pname or null == "gnugrep") config.extraPackages;
message = "gnugrep wasn't found when it was expected";
}
];
};
no-packages =
{ config, ... }:
{
globals.gitgutter_git_executable = lib.getExe pkgs.git;
plugins.gitgutter = {
enable = true;
gitPackage = null;
};
assertions = [
{
assertion = lib.all (x: x.pname or null != "git") config.extraPackages;
message = "A git package found in extraPackages when it wasn't expected";
}
];
};
}

View file

@ -0,0 +1,13 @@
{
empty = {
plugins.gitignore.enable = true;
};
example = {
plugins.gitignore = {
enable = true;
keymap = "<leader>gi";
};
};
}

View file

@ -0,0 +1,31 @@
{
empty = {
plugins.gitlinker.enable = true;
};
defaults = {
plugins.gitlinker = {
enable = true;
remote = null;
addCurrentLineOnNormalMode = true;
actionCallback = "copy_to_clipboard";
printUrl = true;
mappings = "<leader>gy";
callbacks = {
"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";
};
};
};
}

View file

@ -0,0 +1,111 @@
{
empty = {
plugins.gitsigns.enable = true;
};
example = {
plugins.gitsigns = {
enable = true;
settings = {
signs = {
add.text = "";
change.text = "";
delete.text = "";
topdelete.text = "";
changedelete.text = "~";
untracked.text = "";
};
worktrees = [
{
toplevel.__raw = "vim.env.HOME";
gitdir.__raw = "vim.env.HOME .. '/projects/dotfiles/.git'";
}
];
on_attach = ''
function(bufnr)
if vim.api.nvim_buf_get_name(bufnr):match("test.txt") then
-- Don't attach to specific buffers whose name matches a pattern
return false
end
-- Setup keymaps
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'hs', '<cmd>lua require"gitsigns".stage_hunk()<CR>', {})
end
'';
watch_gitdir = {
enable = true;
follow_files = true;
};
sign_priority = 6;
signcolumn = true;
numhl = false;
linehl = false;
show_deleted = false;
diff_opts = {
algorithm = "myers";
internal = false;
indent_heuristic = false;
vertical = true;
linematch = null;
ignore_blank_lines = true;
ignore_whitespace_change = true;
ignore_whitespace = true;
ignore_whitespace_change_at_eol = true;
};
base = null;
count_chars = {
"__unkeyed_1" = "1";
"__unkeyed_2" = "2";
"__unkeyed_3" = "3";
"__unkeyed_4" = "4";
"__unkeyed_5" = "5";
"__unkeyed_6" = "6";
"__unkeyed_7" = "7";
"__unkeyed_8" = "8";
"__unkeyed_9" = "9";
"+" = ">";
};
status_formatter = ''
function(status)
local added, changed, removed = status.added, status.changed, status.removed
local status_txt = {}
if added and added > 0 then
table.insert(status_txt, '+' .. added)
end
if changed and changed > 0 then
table.insert(status_txt, '~' .. changed)
end
if removed and removed > 0 then
table.insert(status_txt, '-' .. removed)
end
return table.concat(status_txt, ' ')
end
'';
max_file_length = 40000;
preview_config = {
border = "single";
style = "minimal";
relative = "cursor";
row = 0;
col = 1;
};
auto_attach = true;
attach_to_untracked = true;
update_debounce = 100;
current_line_blame = false;
current_line_blame_opts = {
virt_text = true;
virt_text_pos = "eol";
delay = 1000;
ignore_whitespace = false;
virt_text_priority = 100;
};
current_line_blame_formatter = " <author>, <author_time> - <summary> ";
current_line_blame_formatter_nc = " <author>";
trouble = false;
word_diff = false;
debug_mode = false;
};
};
};
}

View file

@ -0,0 +1,30 @@
{
empty = {
plugins.lazygit.enable = true;
};
defaults = {
plugins.lazygit = {
enable = true;
settings = {
floating_window_winblend = 0;
floating_window_scaling_factor = 0.9;
floating_window_border_chars = [
""
""
""
""
""
""
""
""
];
floating_window_use_plenary = 0;
use_neovim_remote = 1;
use_custom_config_file_path = 0;
config_file_path = [ ];
};
};
};
}

View file

@ -0,0 +1,300 @@
{ pkgs, ... }:
{
empty = {
plugins.neogit.enable = true;
};
defaults = {
# Otherwise `os.execute('which gpg')` returns an error and make the whole test derivation fail
# (option `settings.commit_view.verify_commit`)
extraPackages = [ pkgs.gnupg ];
plugins.neogit = {
enable = true;
settings = {
filewatcher = {
enabled = true;
};
graph_style = "ascii";
disable_hint = false;
disable_context_highlighting = false;
disable_signs = false;
git_services = {
"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";
"gitlab.com" = "https://gitlab.com/$\{owner}/$\{repository}/merge_requests/new?merge_request[source_branch]=$\{branch_name}";
};
telescope_sorter = null;
disable_insert_on_commit = "auto";
use_per_project_settings = true;
remember_settings = true;
auto_refresh = true;
sort_branches = "-committerdate";
kind = "tab";
disable_line_numbers = true;
console_timeout = 2000;
auto_show_console = true;
status = {
recent_commit_count = 10;
};
commit_editor = {
kind = "auto";
};
commit_select_view = {
kind = "tab";
};
commit_view = {
kind = "vsplit";
verify_commit = "os.execute('which gpg') == 0";
};
log_view = {
kind = "tab";
};
rebase_editor = {
kind = "auto";
};
reflog_view = {
kind = "tab";
};
merge_editor = {
kind = "auto";
};
description_editor = {
kind = "auto";
};
tag_editor = {
kind = "auto";
};
preview_buffer = {
kind = "split";
};
popup = {
kind = "split";
};
signs = {
hunk = [
""
""
];
item = [
">"
"v"
];
section = [
">"
"v"
];
};
integrations = {
telescope = null;
diffview = null;
fzf-lua = null;
};
sections = {
sequencer = {
folded = false;
hidden = false;
};
untracked = {
folded = false;
hidden = false;
};
unstaged = {
folded = false;
hidden = false;
};
staged = {
folded = false;
hidden = false;
};
stashes = {
folded = true;
hidden = false;
};
unpulled_upstream = {
folded = true;
hidden = false;
};
unmerged_upstream = {
folded = false;
hidden = false;
};
unpulled_pushRemote = {
folded = true;
hidden = false;
};
unmerged_pushRemote = {
folded = false;
hidden = false;
};
recent = {
folded = true;
hidden = false;
};
rebase = {
folded = true;
hidden = false;
};
};
ignored_settings = [
"NeogitPushPopup--force-with-lease"
"NeogitPushPopup--force"
"NeogitPullPopup--rebase"
"NeogitCommitPopup--allow-empty"
"NeogitRevertPopup--no-edit"
];
mappings = {
commit_editor = {
q = "Close";
"<c-c><c-c>" = "Submit";
"<c-c><c-k>" = "Abort";
"<m-p>" = "PrevMessage";
"<m-n>" = "NextMessage";
"<m-r>" = "ResetMessage";
};
commit_editor_I = {
"<c-c><c-c>" = "Submit";
"<c-c><c-k>" = "Abort";
};
rebase_editor = {
p = "Pick";
r = "Reword";
e = "Edit";
s = "Squash";
f = "Fixup";
x = "Execute";
d = "Drop";
b = "Break";
q = "Close";
"<cr>" = "OpenCommit";
gk = "MoveUp";
gj = "MoveDown";
"<c-c><c-c>" = "Submit";
"<c-c><c-k>" = "Abort";
"[c" = "OpenOrScrollUp";
"]c" = "OpenOrScrollDown";
};
rebase_editor_I = {
"<c-c><c-c>" = "Submit";
"<c-c><c-k>" = "Abort";
};
finder = {
"<cr>" = "Select";
"<c-c>" = "Close";
"<esc>" = "Close";
"<c-n>" = "Next";
"<c-p>" = "Previous";
"<down>" = "Next";
"<up>" = "Previous";
"<tab>" = "MultiselectToggleNext";
"<s-tab>" = "MultiselectTogglePrevious";
"<c-j>" = "NOP";
"<ScrollWheelDown>" = "ScrollWheelDown";
"<ScrollWheelUp>" = "ScrollWheelUp";
"<ScrollWheelLeft>" = "NOP";
"<ScrollWheelRight>" = "NOP";
"<LeftMouse>" = "MouseClick";
"<2-LeftMouse>" = "NOP";
};
popup = {
"?" = "HelpPopup";
A = "CherryPickPopup";
d = "DiffPopup";
M = "RemotePopup";
P = "PushPopup";
X = "ResetPopup";
Z = "StashPopup";
i = "IgnorePopup";
t = "TagPopup";
b = "BranchPopup";
B = "BisectPopup";
w = "WorktreePopup";
c = "CommitPopup";
f = "FetchPopup";
l = "LogPopup";
m = "MergePopup";
p = "PullPopup";
r = "RebasePopup";
v = "RevertPopup";
};
status = {
q = "Close";
I = "InitRepo";
"1" = "Depth1";
"2" = "Depth2";
"3" = "Depth3";
"4" = "Depth4";
"<tab>" = "Toggle";
x = "Discard";
s = "Stage";
S = "StageUnstaged";
"<c-s>" = "StageAll";
u = "Unstage";
K = "Untrack";
U = "UnstageStaged";
y = "ShowRefs";
"$" = "CommandHistory";
Y = "YankSelected";
"<c-r>" = "RefreshBuffer";
"<cr>" = "GoToFile";
"<c-v>" = "VSplitOpen";
"<c-x>" = "SplitOpen";
"<c-t>" = "TabOpen";
"{" = "GoToPreviousHunkHeader";
"}" = "GoToNextHunkHeader";
"[c" = "OpenOrScrollUp";
"]c" = "OpenOrScrollDown";
};
};
notification_icon = "󰊢";
use_default_keymaps = true;
highlight = {
italic = true;
bold = true;
underline = true;
};
};
};
};
example = {
plugins.neogit = {
enable = true;
settings = {
kind = "floating";
commit_popup.kind = "floating";
preview_buffer.kind = "floating";
popup.kind = "floating";
integrations.diffview = false;
disable_commit_confirmation = true;
disable_builtin_notifications = true;
sections = {
untracked = {
folded = true;
hidden = true;
};
unmerged = {
folded = true;
hidden = false;
};
};
mappings = {
status = {
l = "Toggle";
a = "Stage";
};
};
};
};
};
no-packages = {
plugins.neogit = {
enable = true;
gitPackage = null;
};
};
}

View file

@ -0,0 +1,87 @@
{
empty = {
# This test is flaky and fails non-deterministically
test.runNvim = false;
plugins.octo.enable = true;
};
example = {
# This test is flaky and fails non-deterministically
test.runNvim = false;
plugins.octo = {
enable = true;
settings = {
ssh_aliases = {
"github.com-work" = "github.com";
};
mappings_disable_default = true;
mappings = {
issue.react_heart = "<leader>rh";
file_panel.select_prev_entry = "[q";
};
};
};
};
withFzfLuaPicker = {
# This test is flaky and fails non-deterministically
test.runNvim = false;
plugins.octo = {
enable = true;
settings.picker = "fzf-lua";
};
};
defaults = {
# This test is flaky and fails non-deterministically
test.runNvim = false;
plugins.octo = {
enable = true;
settings = {
use_local_fs = false;
enable_builtin = false;
reaction_viewer_hint_icon = "";
user_icon = " ";
timeline_marker = "";
timeline_indent = "2";
right_bubble_delimiter = "";
left_bubble_delimiter = "";
github_hostname = "";
snippet_context_lines = 4;
timeout = 5000;
ui.use_sign_column = true;
picker = "telescope";
default_remote = [
"upstream"
"origin"
];
gh_env = { };
ssh_aliases = { };
picker_config = {
use_emojis = false;
mappings = {
open_in_browser.lhs = "<C-b>";
copy_url.lhs = "<C-y>";
checkout_pr.lhs = "<C-o>";
merge_pr.lhs = "<C-r>";
};
};
issues.order_by = {
field = "CREATED_AT";
direction = "DESC";
};
};
};
};
}