diff --git a/modules/lang/sh/autoload.el b/modules/lang/sh/autoload.el index 9310e63e6..c9f221874 100644 --- a/modules/lang/sh/autoload.el +++ b/modules/lang/sh/autoload.el @@ -36,3 +36,13 @@ (with-current-buffer "*shell*" (rename-buffer (format "*shell [%s]*" dest-sh)) (current-buffer)))) + +;;;###autoload +(defun +sh-lookup-documentation-handler () + "Look up documentation in `man' or `woman'." + (interactive) + (call-interactively + (if (executable-find "man") + #'man + #'woman)) + (current-buffer)) diff --git a/modules/lang/sh/config.el b/modules/lang/sh/config.el index 944cebbf0..d64d67258 100755 --- a/modules/lang/sh/config.el +++ b/modules/lang/sh/config.el @@ -16,6 +16,7 @@ :config (set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;")) (set-repl-handler! 'sh-mode #'+sh/open-repl) + (set-lookup-handlers! 'sh-mode :documentation #'+sh-lookup-documentation-handler) (set-ligatures! 'sh-mode ;; Functional :def "function"