sh: Unify fzf function names, add fzfman function

`fzfman` will gather all manpage topics and display them in a fzf list
to choose from. Selection will open the corresponding manpage.

Other fzf- functions have been standardized in their naming scheme:
fzf and the function without any spaces, e.g.

`fzfhistory`, `fzfyay`, `fzfyayrns`.
This commit is contained in:
Marty Oehme 2020-07-23 15:33:02 +02:00
parent d91adbfc13
commit b280e4f9ae
No known key found for this signature in database
GPG key ID: 0CCB0526EFB9611A

View file

@ -42,12 +42,16 @@ alias myip="curl -s icanhazip.com"
# fzf
if exist fzf; then
# Display fuzzy-searchable history
alias fzf_history="history | fzf --tac --height 20"
alias fzfhistory="history | fzf --tac --height 20"
fzfman() {
man "$(apropos --long "$1" | fzf | awk '{print $2, $1}' | tr -d '()')"
}
# Fuzzy search packages to install
if exist yay; then
alias fzf_yay="yay -Slq | fzf -m --preview 'yay -Si {1}' | xargs -ro yay -S"
alias fzfyay="yay -Slq | fzf -m --preview 'yay -Si {1}' | xargs -ro yay -S"
# Fuzzy uninstall packages
alias fzf_yayrns="yay -Qeq | fzf -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns"
alias fzfyayrns="yay -Qeq | fzf -m --preview 'yay -Qi {1}' | xargs -ro yay -Rns"
fi
fi