diff --git a/examples/ptpython_config/config.py b/examples/ptpython_config/config.py index a834112c..e5e1d16f 100644 --- a/examples/ptpython_config/config.py +++ b/examples/ptpython_config/config.py @@ -144,6 +144,32 @@ def _(event): " Map 'jj' to Escape. " event.cli.key_processor.feed(KeyPress(Keys.Escape)) """ + + @repl.add_key_binding('(') + def _(event): + event.cli.current_buffer.insert_text("(") + event.cli.current_buffer.insert_text(")" , move_cursor=False) + + @repl.add_key_binding('[') + def _(event): + event.cli.current_buffer.insert_text("[") + event.cli.current_buffer.insert_text("]" , move_cursor=False) + + @repl.add_key_binding('{') + def _(event): + event.cli.current_buffer.insert_text("{") + event.cli.current_buffer.insert_text("}" , move_cursor=False) + + @repl.add_key_binding("'") + def _(event): + event.cli.current_buffer.insert_text("'") + event.cli.current_buffer.insert_text("'" , move_cursor=False) + + @repl.add_key_binding('"') + def _(event): + event.cli.current_buffer.insert_text('"') + event.cli.current_buffer.insert_text('"' , move_cursor=False) + # Custom key binding for some simple autocorrection while typing. """