Show More
@@ -0,0 +1,5 b'' | |||||
|
1 | Added shortcut for accepting auto suggestion | |||
|
2 | ============================================ | |||
|
3 | ||||
|
4 | Added End key shortcut for accepting auto-suggestion | |||
|
5 |
@@ -267,8 +267,7 b' def create_ipython_shortcuts(shell):' | |||||
267 | focused_insert_vi = has_focus(DEFAULT_BUFFER) & vi_insert_mode |
|
267 | focused_insert_vi = has_focus(DEFAULT_BUFFER) & vi_insert_mode | |
268 |
|
268 | |||
269 | # Needed for to accept autosuggestions in vi insert mode |
|
269 | # Needed for to accept autosuggestions in vi insert mode | |
270 | @kb.add("c-e", filter=focused_insert_vi & ebivim) |
|
270 | def _apply_autosuggest(event): | |
271 | def _(event): |
|
|||
272 | b = event.current_buffer |
|
271 | b = event.current_buffer | |
273 | suggestion = b.suggestion |
|
272 | suggestion = b.suggestion | |
274 | if suggestion: |
|
273 | if suggestion: | |
@@ -276,6 +275,14 b' def create_ipython_shortcuts(shell):' | |||||
276 | else: |
|
275 | else: | |
277 | nc.end_of_line(event) |
|
276 | nc.end_of_line(event) | |
278 |
|
277 | |||
|
278 | @kb.add("end", filter=has_focus(DEFAULT_BUFFER) & ebivim) | |||
|
279 | def _(event): | |||
|
280 | _apply_autosuggest(event) | |||
|
281 | ||||
|
282 | @kb.add("c-e", filter=focused_insert_vi & ebivim) | |||
|
283 | def _(event): | |||
|
284 | _apply_autosuggest(event) | |||
|
285 | ||||
279 | @kb.add("c-f", filter=focused_insert_vi) |
|
286 | @kb.add("c-f", filter=focused_insert_vi) | |
280 | def _(event): |
|
287 | def _(event): | |
281 | b = event.current_buffer |
|
288 | b = event.current_buffer |
General Comments 0
You need to be logged in to leave comments.
Login now