first commit
config imported from personal dotfiles aleee-idk/dots
This commit is contained in:
commit
d3a88cbb28
85 changed files with 5236 additions and 0 deletions
21
chezmoi/dot_config/fzf/widgets/man_widget.zsh
Normal file
21
chezmoi/dot_config/fzf/widgets/man_widget.zsh
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
fzf-man-widget() {
|
||||
batman="man {1} | col -bx | bat --language=man --plain --color always --theme=\"Monokai Extended\""
|
||||
man -k . | sort \
|
||||
| awk -v CYN=${CYN} -v BLU=${BLU} -v RES=${RES} -v BLD=${BLD} '{ $1=CYN BLD $1; $2=RES BLU;} 1' \
|
||||
| fzf \
|
||||
-q "$LBUFFER" \
|
||||
--ansi \
|
||||
--tiebreak=begin \
|
||||
--prompt=' Man > ' \
|
||||
--header="M-u: update mandb | M-t: tl;dr | M-c: cheat.sh | M:m manual " \
|
||||
--preview-window '50%,rounded,<50(down,80%,border-up)' \
|
||||
--preview "${batman}" \
|
||||
--bind "enter:execute(man {1})" \
|
||||
--bind "alt-c:+change-preview(curl -s cht.sh/{1})+change-prompt(ﯽ Cheat > )" \
|
||||
--bind "alt-m:+change-preview(${batman})+change-prompt( Man > )" \
|
||||
--bind "alt-u:execute(sudo mandb && echo -e '\nUpdating tl;dr cache...';tldr --update)" \
|
||||
--bind "alt-t:+change-preview(tldr --color=always {1})+change-prompt(ﳁ TLDR > )"
|
||||
zle reset-prompt
|
||||
}
|
||||
zle -N fzf-man-widget
|
||||
bindkey '^[h' fzf-man-widget
|
||||
Loading…
Add table
Add a link
Reference in a new issue