tl;dr
It is not a standard operation but you can add it pretty easily. See this answer (link).
If you're still willing to do hack on the source code...
I've read the source code of readline and it looks like it is pretty doable to add the desired functionality. readline already supports v option which allows you to enter the editing mode and open your $EDITOR. If one analyse the logic of how readline opens $EDITOR then it should be pretty easy to open man with the word under the cursor as an argument.
Here are some interesting greps:
- grep -RI EDITOR *- doc/hsuser.texi:is used: @code{$@{FCEDIT:-$@{EDITOR:-vi@}@}}. This says to use the doc/hsuser.texi:@env{EDITOR} variable if that is set, or @code{vi} if neither is set. doc/rluser.texi:@code{$VISUAL}, @code{$EDITOR}, and @code{emacs} examples/rlfe/ChangeLog: * line options; use EDITOR/VISUAL to set vi/emacs preference. examples/rlfe/README:but if the the environment variable EDITOR is set to "vi" that examples/rlfe/rlfe.c: * line options; use EDITOR/VISUAL to set vi/emacs preference. examples/rlfe/rlfe.c: if (getenv ("EDITOR") != 0) examples/rlfe/rlfe.c: vi |= strcmp (getenv ("EDITOR"), "vi") == 0;
- grep -RI -C 5 editing-mode *.c- bind.c- { "bell-style", V_STRING, sv_bell_style }, bind.c- { "comment-begin", V_STRING, sv_combegin }, bind.c- { "completion-display-width", V_INT, sv_compwidth }, bind.c- { "completion-prefix-display-length", V_INT, sv_dispprefix }, bind.c- { "completion-query-items", V_INT, sv_compquery }, bind.c: { "editing-mode", V_STRING, sv_editmode }, bind.c- { "emacs-mode-string", V_STRING, sv_emacs_modestr }, bind.c- { "history-size", V_INT, sv_histsize }, bind.c- { "isearch-terminators", V_STRING, sv_isrchterm }, bind.c- { "keymap", V_STRING, sv_keymap }, bind.c- { "keyseq-timeout", V_INT, sv_seqtimeout }, -- -- bind.c- else if (_rl_stricmp (name, "completion-query-items") == 0) bind.c- { bind.c- sprintf (numbuf, "%d", rl_completion_query_items); bind.c- return (numbuf); bind.c- } bind.c: else if (_rl_stricmp (name, "editing-mode") == 0) bind.c- return (rl_get_keymap_name_from_edit_mode ()); bind.c- else if (_rl_stricmp (name, "history-size") == 0) bind.c- { bind.c- sprintf (numbuf, "%d", history_is_stifled() ? history_max_entries : 0); bind.c- return (numbuf); -- -- funmap.c- { "do-lowercase-version", rl_do_lowercase_version }, funmap.c- { "downcase-word", rl_downcase_word }, funmap.c- { "dump-functions", rl_dump_functions }, funmap.c- { "dump-macros", rl_dump_macros }, funmap.c- { "dump-variables", rl_dump_variables }, funmap.c: { "emacs-editing-mode", rl_emacs_editing_mode }, funmap.c- { "end-kbd-macro", rl_end_kbd_macro }, funmap.c- { "end-of-history", rl_end_of_history }, funmap.c- { "end-of-line", rl_end_of_line }, funmap.c- { "exchange-point-and-mark", rl_exchange_point_and_mark }, funmap.c- { "forward-backward-delete-char", rl_rubout_or_delete }, -- -- funmap.c- { "vi-column", rl_vi_column }, funmap.c- { "vi-complete", rl_vi_complete }, funmap.c- { "vi-delete", rl_vi_delete }, funmap.c- { "vi-delete-to", rl_vi_delete_to }, funmap.c- { "vi-eWord", rl_vi_eWord }, funmap.c: { "vi-editing-mode", rl_vi_editing_mode }, funmap.c- { "vi-end-bigword", rl_vi_eWord }, funmap.c- { "vi-end-word", rl_vi_end_word }, funmap.c- { "vi-eof-maybe", rl_vi_eof_maybe }, funmap.c- { "vi-eword", rl_vi_eword }, funmap.c- { "vi-fWord", rl_vi_fWord },