Skip to content

Commit a5860bb

Browse files
timholystevengj
authored andcommitted
Check for startup_ijulia.jl and load it if present (#745)
1 parent b63cae6 commit a5860bb

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ running IJulia kernel.
170170
If your code needs to detect whether it is running in an IJulia notebook
171171
(or other Jupyter client), it can check `isdefined(Main, :IJulia) && Main.IJulia.inited`.
172172

173+
### Customizing your IJulia environment
174+
175+
If you want to run code every time you start IJulia---but only when in IJulia---add a `startup_ijulia.jl` file to your Julia `config` directory, e.g., `~/.julia/config/startup_ijulia.jl`.
176+
173177
### Julia and IPython Magics
174178

175179
One difference from IPython is that the IJulia kernel does

src/kernel.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ end
88

99
IJulia.init(ARGS)
1010

11+
startupfile = abspath(homedir(), ".julia", "config", "startup_ijulia.jl")
12+
isfile(startupfile) && Base.include(Main, startupfile)
13+
1114
# import things that we want visible in IJulia but not in REPL's using IJulia
1215
import IJulia: ans, In, Out, clear_history
1316

0 commit comments

Comments
 (0)