From 402e42f58487687433f8e84e9abdad545ba1938b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Wed, 12 Feb 2020 09:46:01 -0600 Subject: [PATCH] WIP --- apps/git/config | 34 +++++++++---------- apps/gpg/agent.conf | 1 - apps/shell/fish/aliases.fish | 4 +-- .../arch-linux/provisioning/2-essentials.bash | 1 + bin/nvimdiff | 2 ++ bin/vim-multi-diff-builder | 22 ++++++++++++ env/laptop/bin/workdock | 1 + env/laptop/x/docked.resources | 2 +- env/laptop/x/resources | 6 +++- 9 files changed, 50 insertions(+), 23 deletions(-) create mode 100755 bin/nvimdiff create mode 100755 bin/vim-multi-diff-builder diff --git a/apps/git/config b/apps/git/config index 6cffd0c..9130934 100644 --- a/apps/git/config +++ b/apps/git/config @@ -14,17 +14,19 @@ [core] editor = nvim - pager = diff-so-fancy | less --tabs=2 -RFX [http "https://gopkg.in"] followRedirects = true [diff] - tool = nvimdiff + tool = cat [difftool] prompt = false +[multidiff] + tool = nvimdiff -f + [alias] d = difftool s = status @@ -48,12 +50,22 @@ prompt = false [mergetool "nvimdiff"] - cmd = nvim -d $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J' + cmd = nvimdiff $BASE $LOCAL $REMOTE $MERGED -c '$wincmd w' -c '$wincmd J' + +[mergetool "cat"] + cmd = cat $BASE $LOCAL $REMOTE $MERGED + +[mergetool "echo"] + cmd = echo $BASE $LOCAL $REMOTE $MERGED + +[mergetool "vimmultidiff"] + cmd = vim-multi-diff-builder $BASE $LOCAL $REMOTE $MERGED [pager] branch = false # remove ansi codes, pad each file's diff with newlines, show as diff, remove top padding - diff = vimpager -c 'silent %sm/\\e[^mK]*[mK]//g' -c 'silent %s/^diff/\\r\\rdiff/' -c 'silent set ft=diff' -c 'silent execute \"normal gg2dd\"' + # diff = vimpager -c 'silent %sm/\\e[^mK]*[mK]//g' -c 'silent %s/^diff/\\r\\rdiff/' -c 'silent set ft=diff' -c 'silent execute \"normal gg2dd\"' + diff = less [url "git@github.com:postmates"] insteadOf = https://github.com/postmates @@ -63,17 +75,3 @@ [gpg] program = gpg2 -[color] - ui = true -[color "diff-highlight"] - oldNormal = red bold - oldHighlight = red bold 52 - newNormal = green bold - newHighlight = green bold 22 -[color "diff"] - meta = 11 - frag = magenta bold - commit = yellow bold - old = red bold - new = green bold - whitespace = red reverse diff --git a/apps/gpg/agent.conf b/apps/gpg/agent.conf index aefe8af..5ac350f 100644 --- a/apps/gpg/agent.conf +++ b/apps/gpg/agent.conf @@ -1,3 +1,2 @@ -pinentry-program /usr/bin/pinentry-curses max-cache-ttl 60480000 default-cache-ttl 60480000 diff --git a/apps/shell/fish/aliases.fish b/apps/shell/fish/aliases.fish index 120fe91..805f318 100755 --- a/apps/shell/fish/aliases.fish +++ b/apps/shell/fish/aliases.fish @@ -110,8 +110,8 @@ function g end end alias gs "git status" -alias gd "git diff" -alias gds "git diff --staged" +alias gd "git d" +alias gds "gd --staged" # alias gdv "git dv" # TODO: what is this? alias gpl "git pull" alias gp "git push" diff --git a/bin/lib/arch-linux/provisioning/2-essentials.bash b/bin/lib/arch-linux/provisioning/2-essentials.bash index aa9b7c4..15a58bf 100755 --- a/bin/lib/arch-linux/provisioning/2-essentials.bash +++ b/bin/lib/arch-linux/provisioning/2-essentials.bash @@ -55,6 +55,7 @@ pacaur --needed -S \ swaks `# SMTP CLI` \ time `# GNU time` \ fortune-mod fortune-mod-archlinux `# Fortune` \ + diff-so-fancy `# Fancy Diffs` \ --noconfirm --noedit # install rxvt-unicode script for resizing font on-the-fly diff --git a/bin/nvimdiff b/bin/nvimdiff new file mode 100755 index 0000000..9650db8 --- /dev/null +++ b/bin/nvimdiff @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +nvim -d "$@" diff --git a/bin/vim-multi-diff-builder b/bin/vim-multi-diff-builder new file mode 100755 index 0000000..746437e --- /dev/null +++ b/bin/vim-multi-diff-builder @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +td="$(mktemp -p "$pdir" -d "tmp_vim_git_multi_diff.XXXXXXXX")" +trap "rm -rf \"$td\"" EXIT + +files="$(git diff --name-only "$@")" + +for f in $files; do + d="$(dirname "$td/$f")" + rfn="$(basename "$f")" + fn="$rfn._@HEAD" + cfn="$rfn._@DISK" + mkdir -p "$d" + git --no-pager show HEAD:"$f" > "$d/$fn" 2>/dev/null || \ + echo "" > "$d/$fn" + cp "$f" "$d/$cfn" + nvim -d "$d/$fn" "$d/$cfn" + exit 3 +done + +ls -R "$td" +rm -rf "$td" diff --git a/env/laptop/bin/workdock b/env/laptop/bin/workdock index f448e54..112cfef 100755 --- a/env/laptop/bin/workdock +++ b/env/laptop/bin/workdock @@ -2,6 +2,7 @@ autorandr --change xrandr --output eDP1 --scale-from 1600x900 --filter nearest --mode 3200x1800 +"${DOTFILES_PATH}/apps/de/x/loadresources" xrdb -merge "$ENV_PATH/x/docked.resources" "${DOTFILES_PATH}/apps/de/bspwm/rc" restartbar diff --git a/env/laptop/x/docked.resources b/env/laptop/x/docked.resources index 743f1b4..fe0ad9b 100755 --- a/env/laptop/x/docked.resources +++ b/env/laptop/x/docked.resources @@ -3,5 +3,5 @@ dpi: 92 *dpi: 92 Xft.dpi: 92 -polybar.display_monitor: DP1 +polybar.display_monitor: DP1-1-8 polybar.height: 40 diff --git a/env/laptop/x/resources b/env/laptop/x/resources index fd23b1c..db5172a 100755 --- a/env/laptop/x/resources +++ b/env/laptop/x/resources @@ -1,4 +1,7 @@ +#define mono_font iosevka-lyte #define bar_font_size 12 +#define icon_font Font Awesome 5 Free Solid +#define icon_font_size 12 *.font: xft:Iosevka Nerd Font Mono:pixelsize=12,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 *.boldFont: xft:Iosevka Nerd Font Mono:style=bold:pixelsize=12,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 @@ -13,4 +16,5 @@ Xft.dpi: 190 polybar.height: 70 polybar.display_monitor: eDP1 -polybar.primary_font: iosevka-lyte:pixelsize=bar_font_size;1 +polybar.primary_font: mono_font:pixelsize=bar_font_size;1 +polybar.secondary_font: icon_font:style=Regular:pixelsize=icon_font_size;1