Created
September 25, 2020 06:39
-
-
Save LinuxIsCool/4de108fe7d8d22f57003c4c742f153dd to your computer and use it in GitHub Desktop.
Fish recipe for interactively searching all of the commands on your path and openining the selected man page.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Inspiration from: https://github.com/jorgebucaran/cookbook.fish#how-do-i-find-and-run-commands-in-fish | |
# Set $all_commands to a list of all commands available on $PATH | |
set -l all_commands (ls $PATH | column) | |
# Use `whatis` to append a one-line description of each command to a file | |
for p in $all_commands | |
whatis $p | tee -a all_command_descriptions | |
end | |
# Pipe the results into fzf, use string to grab the command name, and pass to | |
# man for further investigation. | |
man (string trim (string split '(' (cat all_command_descriptions | fzf) | head -n 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment