From 86955b97561f58126a538cdb95f36eff4b8e88f7 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Wed, 13 May 2020 14:02:11 +0100 Subject: [PATCH] feat(zsh): add `cr` command to rerun and copy the last command --- dotfiles/.config/gibrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dotfiles/.config/gibrc b/dotfiles/.config/gibrc index bffbb4b3..c5a33a37 100644 --- a/dotfiles/.config/gibrc +++ b/dotfiles/.config/gibrc @@ -250,6 +250,9 @@ case $uname in esac # Copy last command. alias clc="fc -ln -1 | sed -e 's/\\\\n/\\n/g' -e 's/\\\\t/\\t/g' | cpy" +# Run last command and copy the command and its output. +# shellcheck disable=SC2155 # `r` won't work if we do `local a` as a separate command. +cr() { local a=$(r 2>&1); cpy <<<"$a"; } # fda is find all (don't ignore anything). { exists fd && alias fda='fd --no-ignore --hidden'; } \