File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,6 +33,27 @@ First launch of IPython may be slow.
3333* IPython (7.0 or above is recommended)
3434
3535
36+ ## Configuration
37+
38+ ### Julia-mode like prompt
39+
40+ If you want IPython prompt to look like a part of Julia prompt, then add
41+ the following snippet in ` ~/.ipython/profile_default/ipython_config.py ` :
42+
43+ ``` python
44+ try :
45+ from ipython_jl.tools import JuliaModePrompt
46+ except ImportError :
47+ pass
48+ else :
49+ c.TerminalInteractiveShell.prompts_class = JuliaModePrompt
50+ ```
51+
52+ Then the prompt would then look like ` ipy 1> ` instead of ` In [1]: ` .
53+ It also removes ` Out[1] ` . Note that above setting does not change
54+ your normal IPython prompts.
55+
56+
3657[ travis-img ] : https://travis-ci.org/tkf/IPython.jl.svg?branch=master
3758[ travis-url ] : https://travis-ci.org/tkf/IPython.jl
3859[ coveralls-img ] : https://coveralls.io/repos/tkf/IPython.jl/badge.svg?branch=master&service=github
Original file line number Diff line number Diff line change 1+ from IPython .terminal .prompts import Prompts , Token
2+
3+
4+ class JuliaModePrompt (Prompts ):
5+
6+ def in_prompt_tokens (self ):
7+ return [
8+ (Token .Prompt , "ipy " ),
9+ (Token .PromptNum , str (self .shell .execution_count )),
10+ (Token .Prompt , "> " ),
11+ ]
12+
13+ def out_prompt_tokens (self ):
14+ return []
You can’t perform that action at this time.
0 commit comments