mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 08:46:39 +00:00
chore(zsh/completion): improve completion setup for various commands
This commit is contained in:
@@ -32,19 +32,5 @@ fi
|
||||
|
||||
if command-exists orb; then
|
||||
alias oc="orb"
|
||||
|
||||
_setup-orb-completion() {
|
||||
local target
|
||||
target="${ZSH_COMPLETIONS}/_orb"
|
||||
|
||||
if [ ! -f "$target" ] || [ "$target" -ot "$(command -v orb)" ]; then
|
||||
echo "Setting up completion for orb -- $target"
|
||||
mkdir -p "$(dirname "$target")"
|
||||
orb completion zsh > "$target"
|
||||
chmod +x "$target"
|
||||
autoload -U compinit && compinit
|
||||
fi
|
||||
}
|
||||
|
||||
_setup-orb-completion
|
||||
setup-completions orb "$(command -v orb)" orb completion zsh
|
||||
fi
|
||||
|
||||
@@ -9,19 +9,7 @@ alias hl="helm"
|
||||
alias mk="minikube"
|
||||
|
||||
if command-exists kubectl; then
|
||||
_setup-kubectl-completion() {
|
||||
local target
|
||||
target="$ZSH_COMPLETIONS/_kubectl"
|
||||
|
||||
if [ ! -f "$target" ] || [ "$target" -ot "$(command -v kubectl)" ]; then
|
||||
echo "Setting up completion for kubectl -- $target"
|
||||
mkdir -p "$ZSH_COMPLETIONS"
|
||||
kubectl completion zsh > "$target"
|
||||
chmod +x "$target"
|
||||
autoload -U compinit && compinit
|
||||
fi
|
||||
}
|
||||
_setup-kubectl-completion
|
||||
setup-completions kubectl "$(command -v kubectl)" kubectl completion zsh
|
||||
|
||||
if command-exists brew-prefix; then
|
||||
switch() {
|
||||
|
||||
12
zsh/rust.zsh
12
zsh/rust.zsh
@@ -22,18 +22,10 @@ fi
|
||||
# ==============================================================================
|
||||
|
||||
if command-exists rustup; then
|
||||
_rustup() {
|
||||
unset -f _rustup
|
||||
eval "$(rustup completions zsh)"
|
||||
}
|
||||
compctl -K _rustup rustup
|
||||
setup-completions rustup "$(command -v rustup)" rustup completions zsh
|
||||
|
||||
if command-exists cargo; then
|
||||
_cargo() {
|
||||
unset -f _cargo
|
||||
eval "$(rustup completions zsh cargo)"
|
||||
}
|
||||
compctl -K _cargo cargo
|
||||
setup-completions cargo "$(command -v cargo)" rustup completions zsh cargo
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user