diff --git a/pgcli/key_bindings.py b/pgcli/key_bindings.py index 9c016f7ff..66c1abcff 100644 --- a/pgcli/key_bindings.py +++ b/pgcli/key_bindings.py @@ -1,4 +1,5 @@ import logging +import os from prompt_toolkit.enums import EditingMode from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.filters import ( @@ -20,6 +21,14 @@ def pgcli_bindings(pgcli): tab_insert_text = " " * 4 + @kb.add("f1") + def _(event): + """Show man page for current command.""" + _logger.debug("Detected key.") + + t = event.app.current_buffer.text + os.system(f"man {t}") + @kb.add("f2") def _(event): """Enable/Disable SmartCompletion Mode."""