Adds new man function

Jonathan Hodgson 5 years ago
parent 87b3a2b999
commit 2d2425f704
  1. 12
      shells/shared/functions

@ -299,3 +299,15 @@ function proxy_off(){
HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY
echo -e "Proxy environment variable removed."
}
function man(){
MAN="/usr/bin/man"
if [ -n "$1" ]; then
$MAN "$@"
return $?
else
$MAN -k . | fzf --reverse --preview="echo {1,2} | sed 's/ (/./' | sed -E 's/\)\s*$//' | xargs $MAN" | awk '{print $1 "." $2}' | tr -d '()' | xargs -r "$MAN"
return $?
fi
}
#alias man="myman"

Loading…
Cancel
Save