diff --git a/.config/shell/git b/.config/shell/git index ddad2d7..c58f03e 100644 --- a/.config/shell/git +++ b/.config/shell/git @@ -3,7 +3,9 @@ alias g="git" alias bfg="java -jar $HOME/daten/applications/bfg-1.13.0.jar" alias magit='nvim -c MagitOnly' -alias y='yadm' +y() { + test "$#" -eq 0 && yadm s || yadm "$@" +} yc() { echo "config/$1:" >/tmp/yc-msg yadm commit -v --template /tmp/yc-msg ${@:2} -- "$XDG_CONFIG_HOME/$1" diff --git a/.local/bin/scripts/st-diff b/.local/bin/scripts/st-diff index 4995e16..d6f5fec 100755 --- a/.local/bin/scripts/st-diff +++ b/.local/bin/scripts/st-diff @@ -8,11 +8,12 @@ if test "$#" -gt 0 ( stats "$orig" "$1"; dif "$orig" "$@" ) | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen test "$?" -eq "2" && exit 1 - echo "y|r to restore, n|d to delete" + echo "y|r to restore, n|d to delete, m to merge" read reply case "$reply" in (y|r) st-restore "$1";; (n|d) rm -v "$1";; + (m) touch /tmp/empty && git merge-file "$orig" /tmp/empty "$1" && nvim "$orig" && rm "$1";; esac else find -name '*sync-conflict*' -exec st-diff '{}' \; fi