From b280e4f9ae9326892de778aa26861b65904ee13a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 23 Jul 2020 15:33:02 +0200 Subject: [PATCH] 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`. --- sh/.config/sh/alias | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sh/.config/sh/alias b/sh/.config/sh/alias index 0a6cb5b..3717243 100644 --- a/sh/.config/sh/alias +++ b/sh/.config/sh/alias @@ -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