all repos — nixfiles @ c80002d50f2830d7cda34df311dd6f09649ded63

System and user configuration, managed by nix and home-manager

zsh: install up, interactive pipeline previewer

Alan Pearce
commit

c80002d50f2830d7cda34df311dd6f09649ded63

parent

96684025aa667ac029c61eed47388a6cdfc16463

2 files changed, 14 insertions(+), 0 deletions(-)

changed files
M user/settings/zsh.nixuser/settings/zsh.nix
@@ -27,6 +27,7 @@ ghq
git git-lfs zsh-completions + up ]; home.activation.linkOldZshHistory =
M user/zsh/zshrcuser/zsh/zshrc
@@ -55,6 +55,19 @@
ds () { du -hd1 "$@" | $sort -h } +zle-upify() { + buf="$(echo "$BUFFER" | sed 's/[ |]*$//')" + tmp="$(mktemp)" + eval "$buf |& up -o '$tmp' 2>/dev/null" + cmd="$(tail -n +2 "$tmp")" + rm -f "$tmp" + BUFFER="$BUFFER | $cmd" + zle end-of-line +} +zle -N zle-upify + +bindkey '\e^u' zle-upify +bindkey '\e^p' zle-upify # returns the first ghq root, whereas $GHQ_ROOT returns all hash -d p=$ghq_root[0]