mirror of https://git.decapod.one/brethil/dotfiles
Compare commits
2 Commits
76579a603e
...
24fc7dd2ed
Author | SHA1 | Date |
---|---|---|
brethil | 24fc7dd2ed | |
brethil | d1135262de |
|
@ -84,6 +84,11 @@ if [[ "$(command -v bat)" || "$(command -v batcat)" ]]; then
|
||||||
export BAT_THEME="gruvbox-dark"
|
export BAT_THEME="gruvbox-dark"
|
||||||
export BAT_PAGER="less $LESS"
|
export BAT_PAGER="less $LESS"
|
||||||
export PAGER=bat
|
export PAGER=bat
|
||||||
|
|
||||||
|
## this breaks symlink testing with [ -h ], best not to activate it
|
||||||
|
# alias -g -- -h='-h 2>&1 | bat --language=help --style=plain'
|
||||||
|
alias bathelp='bat --language=help --style=plain'
|
||||||
|
alias -g -- --help='--help 2>&1 | bathelp '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $SSH_CLIENT ]]; then
|
if [[ $SSH_CLIENT ]]; then
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
function fuzzyman() {
|
||||||
|
local preview_cmd
|
||||||
|
preview_cmd='command man {+1} 2>/dev/null | bat --style=plain --language=man --color=always'
|
||||||
|
|
||||||
|
apropos_args=$@
|
||||||
|
if [[ -z $apropos_args ]]; then
|
||||||
|
apropos_args="."
|
||||||
|
fi
|
||||||
|
|
||||||
|
man $(command man -k "${apropos_args}" \
|
||||||
|
| fzf \
|
||||||
|
--preview="${preview_cmd}" \
|
||||||
|
--preview-window=right,60% \
|
||||||
|
| awk '{print $1}'
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _man fuzzyman=man
|
Loading…
Reference in New Issue