mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 03:06:40 +00:00
chore(shell): add custom command-path helper
This commit is contained in:
@@ -32,5 +32,5 @@ fi
|
||||
|
||||
if command-exists orb; then
|
||||
alias oc="orb"
|
||||
setup-completions orb "$(command -v orb)" orb completion zsh
|
||||
setup-completions orb "$(command-path orb)" orb completion zsh
|
||||
fi
|
||||
|
||||
@@ -10,7 +10,7 @@ git-largest-objects() {
|
||||
sed -n 's/^blob //p' |
|
||||
sort --numeric-sort --key=2 |
|
||||
cut -c 1-12,41- |
|
||||
$(command -v gnumfmt || echo numfmt) \
|
||||
$(command-path gnumfmt || echo numfmt) \
|
||||
--field=2 \
|
||||
--to=iec-i \
|
||||
--suffix=B \
|
||||
|
||||
@@ -9,7 +9,7 @@ alias hl="helm"
|
||||
alias mk="minikube"
|
||||
|
||||
if command-exists kubectl; then
|
||||
setup-completions kubectl "$(command -v kubectl)" kubectl completion zsh
|
||||
setup-completions kubectl "$(command-path kubectl)" kubectl completion zsh
|
||||
|
||||
export KREW_ROOT="$HOME/.krew"
|
||||
path_append "${KREW_ROOT}/bin"
|
||||
|
||||
@@ -22,10 +22,10 @@ fi
|
||||
# ==============================================================================
|
||||
|
||||
if command-exists rustup; then
|
||||
setup-completions rustup "$(command -v rustup)" rustup completions zsh
|
||||
setup-completions rustup "$(command-path rustup)" rustup completions zsh
|
||||
|
||||
if command-exists cargo; then
|
||||
setup-completions cargo "$(command -v cargo)" rustup completions zsh cargo
|
||||
setup-completions cargo "$(command-path cargo)" rustup completions zsh cargo
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
|
||||
if command-exists zoxide; then
|
||||
cached-eval "$(command -v zoxide)" zoxide init --cmd zox zsh
|
||||
cached-eval "$(command-path zoxide)" zoxide init --cmd zox zsh
|
||||
|
||||
# Use functions to allow regular zsh completion for cd to work.
|
||||
cd() { __zoxide_z "$@"; }
|
||||
|
||||
@@ -47,7 +47,7 @@ setup-completions() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z "$(command -v "$cmd")" ]]; then
|
||||
if [[ -z "$(command-path "$cmd")" ]]; then
|
||||
echo "setup-completions: Command not found: $cmd" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user