Interactively search command options from man with fzf.
Copy manoptfzf.sh
in $PATH
and source it
manoptfzf() {
local dir
man $1 | sed -n "/^\s*-. /p" | fzf --preview "manopt $1 {1}"
}
This function accept a command name and calls manopt
.
I must use an extra function because fzf pass argument as single-quoted in --preview
.
Copy in $PATH
and make executable with chmod +x
fzf doesn't see my custom bash function in --preview
, but an executable is fine.
whatis $1
man $1 | sed -n "/^\s*$2/,/^$/p"