diff --git a/Examples.md b/Examples.md index e688ec1..c1e3d6e 100644 --- a/Examples.md +++ b/Examples.md @@ -12,6 +12,7 @@ Table of Contents * [Git](#git) * [Tags](#tags) * [tmux](#tmux) +* [homebrew](#homebrew) * [v](#v) * [Inspired by v. Opens files in ~/.viminfo](#inspired-by-v-opens-files-in-viminfo) * [With fasd.](#with-fasd) @@ -522,6 +523,45 @@ ftpane() { To search for windows and show which is currently active, add [ftwind](https://github.com/pokey/dotfiles/blob/dade6c88af31458c323e8f0247af510bca7af0f5/bin/ftwind) somewhere in your path. Then add eg `bind-key f run -b ftwind` to your `tmux.conf`. +### homebrew + +```sh +# Install (one or multiple) selected application(s) +# using "brew search" as source input +# mnemonic [B]rew [I]nstall [P]lugin +bip() { + local inst=$(brew search | fzf) + + if [[ $inst ]]; then + brew install $inst + fi +} +``` + +```sh +# Update (one or multiple) selected application(s) +# mnemonic [B]rew [U]pdate [P]lugin +bup() { + local upd=$(brew leaves | fzf) + + if [[ $upd ]]; then + brew upgrade $upd + fi +} +``` + +```sh +# Delete (one or multiple) selected application(s) +# mnemonic [B]rew [C]lean [P]lugin (e.g. uninstall) +bcp() { + local uninst=$(brew leaves | fzf) + + if [[ $uninst ]]; then + brew uninstall $uninst + fi +} +``` + ### v #### Inspired by [v](https://github.com/rupa/v). Opens files in ~/.viminfo