From 8236f711893f6e02db681eea3d7454dccd2d3109 Mon Sep 17 00:00:00 2001 From: bretello Date: Wed, 8 Dec 2021 23:55:41 +0100 Subject: [PATCH] zsh: add pacbins and rexplain commands --- functions.zsh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/functions.zsh b/functions.zsh index 6032254..ff44e21 100755 --- a/functions.zsh +++ b/functions.zsh @@ -301,6 +301,20 @@ git-fixup() { git -c sequence.editor=true rebase --interactive --autosquash $1^ } +if command -v pacman &>/dev/null ; then + compdef _pacman_completions_installed_packages pacbins + pacbins() { + pacman -Ql $1 | sed -n -e 's/.*\/bin\///p' | tail -n +2 + } +fi + +if command -v rustc &>/dev/null +then + rexplain() { + rustc --explain $@ | bat --language=rust - + } +fi + # dotfiles user functions if [[ -f $HOME/.dotfiles_functions ]]; then source "$HOME/.dotfiles_functions"