Last active
March 14, 2025 15:04
-
-
Save GeneralD/8560fb923b791ab9a98e19b46b41b37a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# functions | |
function skim-brew-install() { | |
local inst=$(brew formulae | sk --query="$1" -m --preview 'brew info {}' --bind 'ctrl-space:execute-silent(brew home {})') | |
if [[ $inst ]]; then | |
for prog in $(echo $inst); do; brew install $prog; done; | |
fi | |
} | |
function skim-brew-uninstall() { | |
local uninst=$(brew leaves | sk --query="$1" -m --preview 'brew info {}' --bind 'ctrl-space:execute-silent(brew home {})') | |
if [[ $uninst ]]; then | |
for prog in $(echo $uninst); | |
do; brew uninstall $prog; done; | |
fi | |
} | |
function skim-cask-install() { | |
local inst=$(brew casks | sk --query="$1" -m --preview 'brew info --cask {}' --bind 'ctrl-space:execute-silent(brew home --cask {})') | |
if [[ $inst ]]; then | |
for prog in $(echo $inst); do; brew install --cask $prog; done; | |
fi | |
} | |
function skim-cask-uninstall() { | |
local inst=$(brew list --cask | sk --query="$1" -m --preview 'brew info --cask {}' --bind 'ctrl-space:execute-silent(brew home --cask {})') | |
if [[ $inst ]]; then | |
for prog in $(echo $inst); do; brew uninstall --cask $prog; done; | |
fi | |
} | |
zle -N skim-brew-install | |
zle -N skim-brew-uninstall | |
zle -N skim-cask-install | |
zle -N skim-cask-uninstall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment