Move broot command as partial
This commit is contained in:
parent
e1ba38a16d
commit
035ece152b
15
zsh.d/broot.zsh
Normal file
15
zsh.d/broot.zsh
Normal 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
15
zshrc
@ -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
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user