How to use the radian.key_bindings.create_key_bindings function in radian

To help you get started, we’ve selected a few radian examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github randy3k / radian / radian / session.py View on Github external
input_processors = []
    if settings.highlight_matching_bracket:
        input_processors.append(HighlightMatchingBracketProcessor())

    session.register_mode(
        "r",
        activator=lambda session: session.prompt_text == settings.prompt,
        insert_new_line=True,
        history_share_with="browse",
        get_message=lambda: settings.prompt,
        multiline=settings.indent_lines,
        complete_while_typing=settings.complete_while_typing,
        lexer=PygmentsLexer(SLexer),
        completer=RCompleter(),
        key_bindings=create_key_bindings(),
        input_processors=input_processors,
        prompt_key_bindings=create_r_key_bindings(prase_text_complete)
    )
    session.register_mode(
        "shell",
        on_post_accept=shell_process_text,
        insert_new_line=True,
        get_message=lambda: settings.shell_prompt,
        multiline=settings.indent_lines,
        complete_while_typing=settings.complete_while_typing,
        lexer=None,
        completer=SmartPathCompleter(),
        prompt_key_bindings=create_shell_key_bindings()
    )
    session.register_mode(
        "browse",
github randy3k / radian / radian / prompt.py View on Github external
def shell_process_text(session):
        text = session.default_buffer.text
        run_command(text)

    session.register_mode(
        "r",
        native=True,
        activator=lambda session: session.prompt_text == session.default_prompt,
        insert_new_line=True,
        history_share_with="browse",
        message=ANSI(session.default_prompt),
        multiline=session.indent_lines,
        complete_while_typing=session.complete_while_typing,
        lexer=PygmentsLexer(SLexer),
        completer=RCompleter(timeout=session.completion_timeout),
        key_bindings=create_key_bindings(),
        prompt_key_bindings=create_r_key_bindings(prase_text_complete)
    )
    session.register_mode(
        "shell",
        native=False,
        on_done=shell_process_text,
        insert_new_line=True,
        message=ANSI(session.shell_prompt),
        multiline=session.indent_lines,
        complete_while_typing=session.complete_while_typing,
        lexer=None,
        completer=SmartPathCompleter(),
        prompt_key_bindings=create_shell_key_bindings()
    )
    session.register_mode(
        "browse",
github randy3k / radian / radian / session.py View on Github external
input_processors = []
    if settings.highlight_matching_bracket:
        input_processors.append(HighlightMatchingBracketProcessor())

    session.register_mode(
        "r",
        activator=lambda session: session.prompt_text == settings.prompt,
        insert_new_line=True,
        history_share_with="browse",
        get_message=lambda: settings.prompt,
        multiline=settings.indent_lines,
        complete_while_typing=settings.complete_while_typing,
        lexer=PygmentsLexer(SLexer),
        completer=RCompleter(timeout=settings.completion_timeout),
        key_bindings=create_key_bindings(),
        input_processors=input_processors,
        prompt_key_bindings=create_r_key_bindings(prase_text_complete)
    )
    session.register_mode(
        "shell",
        on_post_accept=shell_process_text,
        insert_new_line=True,
        get_message=lambda: settings.shell_prompt,
        multiline=settings.indent_lines,
        complete_while_typing=settings.complete_while_typing,
        lexer=None,
        completer=SmartPathCompleter(),
        prompt_key_bindings=create_shell_key_bindings()
    )
    session.register_mode(
        "browse",