diff --git a/bin/git-fetch-branch b/bin/git-fetch-branch index 0935a71..740a126 100755 --- a/bin/git-fetch-branch +++ b/bin/git-fetch-branch @@ -4,6 +4,8 @@ export USAGE=' or: ' +cd "$(git rev-parse --show-toplevel)" + # This is the recommended pattern from `man git-sh-setup`. # # shellcheck disable=SC1090 @@ -23,7 +25,6 @@ case "$#" in *) usage ;; esac - # I often change the fetch refmap to only watch my development branches and # permanent shared ones. Explicitly use a default-ish refmap to undo that and # make this create a named local branch. diff --git a/bin/watch-run b/bin/watch-run new file mode 100755 index 0000000..1f263a8 --- /dev/null +++ b/bin/watch-run @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$#" -lt 2 ]; then + >&2 echo "usage: $0 dir command [args]" + exit 1 +fi + +dir="$1"; shift +cmd=("$@") + +# I specifically want the command to expand here. +# +# shellcheck disable=SC2068 +until fd . "${dir}" | entr -dr ${cmd[@]}; do + echo 'Press Space or edit a file to re-run command' +done diff --git a/bin/watch-test b/bin/watch-test index c479a3e..be5926d 100755 --- a/bin/watch-test +++ b/bin/watch-test @@ -10,10 +10,9 @@ fi dir="$1"; shift cmd=("$@") -echo 'Press Space or edit a file to run tests' # I specifically want the command to expand here. # # shellcheck disable=SC2068 -until fd . "${dir}" | entr -cdpr ${cmd[@]}; do +until fd . "${dir}" | entr -cdr ${cmd[@]}; do echo 'Press Space or edit a file to re-run tests' done diff --git a/helix/config.toml b/helix/config.toml index dcf7be4..57dffca 100644 --- a/helix/config.toml +++ b/helix/config.toml @@ -84,12 +84,12 @@ tabpad = "‒" [keys.normal.space.y] "y" = "yank" +"Y" = "yank_to_clipboard" "j" = "yank_joined" +"J" = "yank_joined_to_clipboard" "d" = ":yank-diagnostic" [keys.normal.space.Y] -"Y" = "yank_to_clipboard" -"j" = "yank_joined_to_clipboard" "p" = ":noop %sh{printf '%%s' '%{buffer_name}' | cbcopy}" "d" = ":noop %sh{printf '%%s' $(dirname '%{buffer_name}') | cbcopy}" "b" = ":noop %sh{printf '%%s' $(basename '%{buffer_name}') | cbcopy}" diff --git a/zsh/aliases b/zsh/aliases index 8130f7c..ce54575 100644 --- a/zsh/aliases +++ b/zsh/aliases @@ -9,6 +9,9 @@ alias g='git' alias rg='rg -S' alias sg='ast-grep' +alias b='bundle' +alias bx='bundle exec' + alias timestamp='now' # I have never actually meant to start Ghostscript, but I'm sure that I'll want