Move broot command as partial

This commit is contained in:
Paweł Płazieński 2024-02-27 20:54:35 +01:00
parent e1ba38a16d
commit 035ece152b
2 changed files with 15 additions and 15 deletions

15
zsh.d/broot.zsh Normal file
View File

@ -0,0 +1,15 @@
# vim: ft=zsh
function br {
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}

15
zshrc
View File

@ -654,18 +654,3 @@ zmodload zsh/complist
for partial in ${ZDOTDIR}/zsh.d/*.zsh; do for partial in ${ZDOTDIR}/zsh.d/*.zsh; do
source $partial source $partial
done done
#---------------------------------- Broot ------------------------------------
function br {
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(<"$cmd_file")
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}