From 50ed55c02143bd896d9f1b7f732c0bfb445e07d8 Mon Sep 17 00:00:00 2001 From: vxid <16440823+vxid@users.noreply.github.com> Date: Fri, 24 May 2019 12:23:26 +0200 Subject: [PATCH] Added a simple recipe for searching through man pages. --- Examples.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Examples.md b/Examples.md index 65e79ba..4cd679a 100644 --- a/Examples.md +++ b/Examples.md @@ -48,6 +48,7 @@ Table of Contents * [Docker](#docker) * [buku](#buku) * [i3](#i3) +* [man pages](#man-pages) @@ -1214,4 +1215,14 @@ Display in a floating window. Add this to your i3 config file (this example uses ``` bindsym $mod+d exec --no-startup-id termite -t 'fzf-menu' -e 'i3-dmenu-desktop --dmenu=fzf' for_window [title="fzf-menu"] floating enable +``` + +### Man pages +Quickly display a man page using fzf and fd. `MANPATH` has to be set to a single directory (usually `/usr/share/man`). +Accepts an optional argument for the manual section (defaults to 1). + +```sh +man-find() { + f=$(fd . $MANPATH/man${1:-1} -t f -x echo {/.} | fzf) && man $f +} ``` \ No newline at end of file