misc cleanup

This commit is contained in:
iofq 2026-01-18 12:53:24 -06:00
parent 1943a3c679
commit cabf5f52e1
7 changed files with 111 additions and 52 deletions

View file

@ -9,6 +9,12 @@
};
core.editor = "nvim";
pull.rebase = true;
difftool."nvim_difftool" = {
cmd = ''nvim -c "packadd nvim.difftool" -c "DiffTool $LOCAL $REMOTE"'';
};
diff = {
tool = "nvim_difftool";
};
};
signing = {
key = "cjriddz@protonmail.com";
@ -50,6 +56,7 @@
conflict-marker-style = "git";
merge-editor = "vimdiff";
diff-editor = "diffview";
diff-instructions = false;
diff-formatter = ":git";
movement = {
edit = true;
@ -97,6 +104,42 @@
''
];
};
merge-tools.diffview-new = {
program = "sh";
edit-args = [
"-c"
''
set -eux
nix run /home/e/dev/nvim.nix -- \
--server $NVIM \
--remote-send "<cmd>lua require('difftool').open('$left', '$right', {ignore = { '.git', '.jj' }})<cr>"
until nix run /home/e/dev/nvim.nix -- \
--headless \
--server "$NVIM" \
--remote-expr "v:lua.require'iofq.jj'.is_jj_diffedit_open()" 2>/dev/null | grep 0; do
sleep 1
done
''
];
diff-args = [
"-c"
''
set -eu
rm -f "$right/JJ-INSTRUCTIONS"
git -C "$left" init -q
git -C "$left" add -A
git -C "$left" commit -q -m baseline --allow-empty
mv "$left/.git" "$right"
git -C "$right" add --intent-to-add -A
(cd "$right"; nvim -c "lua vim.g.snacks_indent=false" -c "lua require('lazy').load({plugins = {'diffview.nvim'}})" -c DiffviewOpen)
git -C "$right" diff-index --quiet --cached HEAD && { echo "No changes done, aborting split."; exit 1; }
git -C "$right" commit -q -m split
git -C "$right" restore . # undo changes in modified files
git -C "$right" reset . # undo --intent-to-add
git -C "$right" clean -q -df # remove untracked files
''
];
};
snapshot = {
max-new-file-size = "10MiB";
};