|
@@
-8,55
+8,55
b' or right arrow as described below.'
|
|
8
|
|
|
8
|
|
|
9
|
1. Start ipython
|
|
9
|
1. Start ipython
|
|
10
|
|
|
10
|
|
|
11
|
|image|
|
|
11
|
.. image:: ../_images/auto_suggest_prompt_no_text.png
|
|
12
|
|
|
12
|
|
|
13
|
2. Run ``print("hello")``
|
|
13
|
2. Run ``print("hello")``
|
|
14
|
|
|
14
|
|
|
15
|
|image1|
|
|
15
|
.. image:: ../_images/auto_suggest_print_hello_suggest.png
|
|
16
|
|
|
16
|
|
|
17
|
3. Press p to see the autosuggestion
|
|
17
|
3. Press p to see the autosuggestion
|
|
18
|
|
|
18
|
|
|
19
|
|image2|
|
|
19
|
.. image:: ../_images/auto_suggest_print_hello_suggest.png
|
|
20
|
|
|
20
|
|
|
21
|
4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
|
|
21
|
4. Press ctrl f, or ctrl e, or right arrow to accept the suggestion
|
|
22
|
|
|
22
|
|
|
23
|
|image3|
|
|
23
|
.. image:: ../_images/auto_suggest_print_hello.png
|
|
24
|
|
|
24
|
|
|
25
|
You can also complete word by word:
|
|
25
|
You can also complete word by word:
|
|
26
|
|
|
26
|
|
|
27
|
1. Run ``def say_hello(): print("hello")``
|
|
27
|
1. Run ``def say_hello(): print("hello")``
|
|
28
|
|
|
28
|
|
|
29
|
|image4|
|
|
29
|
.. image:: ../_images/auto_suggest_second_prompt.png
|
|
30
|
|
|
30
|
|
|
31
|
2. Press d to see the autosuggestion
|
|
31
|
2. Press d to see the autosuggestion
|
|
32
|
|
|
32
|
|
|
33
|
|image5|
|
|
33
|
.. image:: ../_images/audo_suggest_d_phantom.png
|
|
34
|
|
|
34
|
|
|
35
|
3. Press alt f to accept to accept the first word of the suggestion
|
|
35
|
3. Press alt f to accept to accept the first word of the suggestion
|
|
36
|
|
|
36
|
|
|
37
|
|image6|
|
|
37
|
.. image:: ../_images/auto_suggest_def_phantom.png
|
|
38
|
|
|
38
|
|
|
39
|
Importantly, this feature does not interfere with tab completion:
|
|
39
|
Importantly, this feature does not interfere with tab completion:
|
|
40
|
|
|
40
|
|
|
41
|
1. After running ``def say_hello(): print("hello")``, press d
|
|
41
|
1. After running ``def say_hello(): print("hello")``, press d
|
|
42
|
|
|
42
|
|
|
43
|
|image7|
|
|
43
|
.. image:: ../_images/audo_suggest_d_phantom.png
|
|
44
|
|
|
44
|
|
|
45
|
2. Press Tab to start tab completion
|
|
45
|
2. Press Tab to start tab completion
|
|
46
|
|
|
46
|
|
|
47
|
|image8|
|
|
47
|
.. image:: ../_images/auto_suggest_d_completions.png
|
|
48
|
|
|
48
|
|
|
49
|
3A. Press Tab again to select the first option
|
|
49
|
3A. Press Tab again to select the first option
|
|
50
|
|
|
50
|
|
|
51
|
|image9|
|
|
51
|
.. image:: ../_images/auto_suggest_def_completions.png
|
|
52
|
|
|
52
|
|
|
53
|
3B. Press alt f to accept to accept the first word of the suggestion
|
|
53
|
3B. Press alt f to accept to accept the first word of the suggestion
|
|
54
|
|
|
54
|
|
|
55
|
|image10|
|
|
55
|
.. image:: ../_images/auto_suggest_def_phantom.png
|
|
56
|
|
|
56
|
|
|
57
|
3C. Press ctrl f or ctrl e to accept the entire suggestion
|
|
57
|
3C. Press ctrl f or ctrl e to accept the entire suggestion
|
|
58
|
|
|
58
|
|
|
59
|
|image11|
|
|
59
|
.. image:: ../_images/auto_suggest_match_parens.png
|
|
60
|
|
|
60
|
|
|
61
|
To install a version of ipython with autosuggestions enabled, run:
|
|
61
|
To install a version of ipython with autosuggestions enabled, run:
|
|
62
|
|
|
62
|
|
|
@@
-67,15
+67,3
b' Currently, autosuggestions are only shown in the emacs or vi insert editing mode'
|
|
67
|
- The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
|
|
67
|
- The ctrl e, ctrl f, and alt f shortcuts work by default in emacs mode.
|
|
68
|
- To use these shortcuts in vi insert mode, you will have to create `custom keybindings in your config.py <https://github.com/mskar/setup/commit/2892fcee46f9f80ef7788f0749edc99daccc52f4/>`__.
|
|
68
|
- To use these shortcuts in vi insert mode, you will have to create `custom keybindings in your config.py <https://github.com/mskar/setup/commit/2892fcee46f9f80ef7788f0749edc99daccc52f4/>`__.
|
|
69
|
|
|
69
|
|
|
70
|
.. |image| image:: https://user-images.githubusercontent.com/13444106/94700432-76580100-0309-11eb-8798-040d47d1a540.png
|
|
|
|
|
71
|
.. |image1| image:: https://user-images.githubusercontent.com/13444106/94700528-91c30c00-0309-11eb-920d-4ef8aa79d79a.png
|
|
|
|
|
72
|
.. |image2| image:: https://user-images.githubusercontent.com/13444106/94700681-bf0fba00-0309-11eb-94bd-bbddf4805da2.png
|
|
|
|
|
73
|
.. |image3| image:: https://user-images.githubusercontent.com/13444106/94700883-fd0cde00-0309-11eb-9aa8-17270951f021.png
|
|
|
|
|
74
|
.. |image4| image:: https://user-images.githubusercontent.com/13444106/94704474-f54f3880-030d-11eb-9d73-fa10ced850be.png
|
|
|
|
|
75
|
.. |image5| image:: https://user-images.githubusercontent.com/13444106/94704519-fe400a00-030d-11eb-8b73-3c35ffaf1a9d.png
|
|
|
|
|
76
|
.. |image6| image:: https://user-images.githubusercontent.com/13444106/94704602-14e66100-030e-11eb-90fc-d930463f52de.png
|
|
|
|
|
77
|
.. |image7| image:: https://user-images.githubusercontent.com/13444106/94704519-fe400a00-030d-11eb-8b73-3c35ffaf1a9d.png
|
|
|
|
|
78
|
.. |image8| image:: https://user-images.githubusercontent.com/13444106/94704969-80303300-030e-11eb-8379-6bff94582849.png
|
|
|
|
|
79
|
.. |image9| image:: https://user-images.githubusercontent.com/13444106/94705023-90481280-030e-11eb-9cf7-76170d1004b9.png
|
|
|
|
|
80
|
.. |image10| image:: https://user-images.githubusercontent.com/13444106/94704602-14e66100-030e-11eb-90fc-d930463f52de.png
|
|
|
|
|
81
|
.. |image11| image:: https://user-images.githubusercontent.com/13444106/94705115-ab1a8700-030e-11eb-9dee-da98fccca0a6.png
|
|
|
|