|
5 | 5 | """ |
6 | 6 | from __future__ import unicode_literals |
7 | 7 | from prompt_toolkit.filters import ViInsertMode |
8 | | -from prompt_toolkit.key_binding.input_processor import KeyPress |
| 8 | +from prompt_toolkit.key_binding.key_processor import KeyPress |
9 | 9 | from prompt_toolkit.keys import Keys |
10 | 10 | from pygments.token import Token |
11 | 11 |
|
@@ -40,7 +40,7 @@ def configure(repl): |
40 | 40 | repl.completion_menu_scroll_offset = 0 |
41 | 41 |
|
42 | 42 | # Show line numbers (when the input contains multiple lines.) |
43 | | - repl.show_line_numbers = True |
| 43 | + repl.show_line_numbers = False |
44 | 44 |
|
45 | 45 | # Show status bar. |
46 | 46 | repl.show_status_bar = True |
@@ -117,29 +117,35 @@ def configure(repl): |
117 | 117 | """ |
118 | 118 |
|
119 | 119 | # Add custom key binding for PDB. |
| 120 | + """ |
120 | 121 | @repl.add_key_binding(Keys.ControlB) |
121 | 122 | def _(event): |
122 | 123 | ' Pressing Control-B will insert "pdb.set_trace()" ' |
123 | 124 | event.cli.current_buffer.insert_text('\nimport pdb; pdb.set_trace()\n') |
| 125 | + """ |
124 | 126 |
|
125 | 127 | # Typing ControlE twice should also execute the current command. |
126 | 128 | # (Alternative for Meta-Enter.) |
| 129 | + """ |
127 | 130 | @repl.add_key_binding(Keys.ControlE, Keys.ControlE) |
128 | 131 | def _(event): |
129 | 132 | b = event.current_buffer |
130 | 133 | if b.accept_action.is_returnable: |
131 | 134 | b.accept_action.validate_and_handle(event.cli, b) |
| 135 | + """ |
132 | 136 |
|
133 | 137 |
|
134 | 138 | # Typing 'jj' in Vi Insert mode, should send escape. (Go back to navigation |
135 | 139 | # mode.) |
| 140 | + """ |
136 | 141 | @repl.add_key_binding('j', 'j', filter=ViInsertMode()) |
137 | 142 | def _(event): |
138 | 143 | " Map 'jj' to Escape. " |
139 | 144 | event.cli.input_processor.feed(KeyPress(Keys.Escape)) |
140 | | - |
141 | 145 | """ |
| 146 | + |
142 | 147 | # Custom key binding for some simple autocorrection while typing. |
| 148 | + """ |
143 | 149 | corrections = { |
144 | 150 | 'impotr': 'import', |
145 | 151 | 'pritn': 'print', |
|
0 commit comments