aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/fzf-man
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/fzf-man')
-rwxr-xr-x.local/bin/fzf-man9
1 files changed, 9 insertions, 0 deletions
diff --git a/.local/bin/fzf-man b/.local/bin/fzf-man
new file mode 100755
index 0000000..0d7e7ba
--- /dev/null
+++ b/.local/bin/fzf-man
@@ -0,0 +1,9 @@
+#!/bin/sh -eu
+
+MANWIDTH=9999
+
+[ "$#" = 0 ] && apropos . \
+ | cut -d' ' -f1 | fzf --preview "MANWIDTH=$MANWIDTH man {}" | xargs man;
+
+[ "$#" = 1 ] && man -k "$1" \
+ | cut -d' ' -f1 | fzf --preview "MANWIDTH=$MANWIDTH man {}" | xargs man;