Skip to content

Commit

Permalink
F1 shows man page for current command
Browse files Browse the repository at this point in the history
  • Loading branch information
serpent7776 committed Apr 6, 2024
1 parent 8cc22b9 commit 1769a8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pgcli/key_bindings.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand All @@ -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 <F1> key.")

t = event.app.current_buffer.text
os.system(f"man {t}")

@kb.add("f2")
def _(event):
"""Enable/Disable SmartCompletion Mode."""
Expand Down

0 comments on commit 1769a8f

Please sign in to comment.