Adds new man function

master
Jonathan Hodgson 5 years ago
parent 1af6faa3d7
commit 75eb5214de
  1. 12
      shells/shared/functions

@ -299,3 +299,15 @@ function proxy_off(){
HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY HTTP_PROXY HTTPS_PROXY FTP_PROXY RSYNC_PROXY
echo -e "Proxy environment variable removed." 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