From 035ece152bdc6684bfbb8cef3dafec8ff23b89c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20P=C5=82azie=C5=84ski?= Date: Tue, 27 Feb 2024 20:54:35 +0100 Subject: [PATCH] Move broot command as partial --- zsh.d/broot.zsh | 15 +++++++++++++++ zshrc | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 zsh.d/broot.zsh diff --git a/zsh.d/broot.zsh b/zsh.d/broot.zsh new file mode 100644 index 0000000..182491a --- /dev/null +++ b/zsh.d/broot.zsh @@ -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 +} diff --git a/zshrc b/zshrc index e78f944..e64fa7a 100644 --- a/zshrc +++ b/zshrc @@ -654,18 +654,3 @@ zmodload zsh/complist for partial in ${ZDOTDIR}/zsh.d/*.zsh; do source $partial 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 -}