dotfiles/fish.configlink/functions/mactools.fish

43 lines
1.1 KiB
Fish
Raw Normal View History

2020-07-31 01:12:17 +00:00
#!/usr/local/bin/fish
function mactools
2020-08-01 00:44:02 +00:00
2020-07-31 01:12:17 +00:00
function copy --description 'Copy file contents into clipboard'
cat $argv | pbcopy
end
2020-08-01 00:44:02 +00:00
2020-08-02 14:20:25 +00:00
abbr -a casks 'vim $DOTS/homebrew/Caskfile'
2020-11-28 21:09:24 +00:00
function brews --description "Open Homebrew bundles file"
set -lx brewdir $DOTS/homebrew
set -l brewfile (basename $brewdir/*.Brewfile \
| fzf \
--height 70% \
--preview-window right:70% \
--preview 'bat --color=always $brewdir/{}' \
)
and vim $brewdir/$brewfile
end
function brewinfo --description "Lookup brew plugins"
set -l inst (brew search | eval "fzf $FZF_DEFAULT_OPTS -m --header='[brew:info]'")
if not test (count $inst) = 0
for prog in $inst
brew info "$prog"
end
end
end
2020-08-01 00:44:02 +00:00
function brewsearch --description "Install brew plugins"
set -l inst (brew search | eval "fzf $FZF_DEFAULT_OPTS -m --header='[brew:install]'")
if not test (count $inst) = 0
for prog in $inst
brew install "$prog"
end
end
end
2020-07-31 01:12:17 +00:00
end