From 78e5134e9bb2843a32f613311dea2f34a8e76769 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Sat, 23 Dec 2023 20:14:08 -0700 Subject: [PATCH] Update: universal man pages --- bash/.bash_functions | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bash/.bash_functions b/bash/.bash_functions index f2503eb..1a3a83f 100644 --- a/bash/.bash_functions +++ b/bash/.bash_functions @@ -53,6 +53,21 @@ sww() { fi } +# Proper manpages =================================================== +man() { + local command="$1" + + if [[ "$command" =~ \. ]]; then + ~/.configs_pointer/bin/man_py.sh "$command" + elif /usr/bin/man "$command" >/dev/null 2>&1; then + /usr/bin/man "$command" + elif command -v "$command" &>/dev/null; then + "$command" --help | nvim -R -c 'set syn=man' -- + else + echo "Error: No man page for \`$command\`" + fi +} + complete -W "console mac pc standard fn small mini" sww # Open command source code ==========================================