With the Julia REPL open, press the right square bracket ] to drop into the πΏππ REPL where you can install packages and manage Julia environments.
There's no need to install a separate package manager. It comes with every Julia install.
The support for Julia environments is one of my favorite parts. Inside the πΏππ REPL, type:
Set the πΉππ»πΈπ°_π΄π³πΈππΎπ environment variable to the path to your favorite code editor and now you can use the built-in ππππ() function from the REPL and do one of three things:
1οΈβ£ Pass a string with a file path to ππππ() to open the file at that path in your editor.
2οΈβ£ Give ππππ() a function name to open the function definition in your editor.
3οΈβ£ Give ππππ() a module name to open the module definition in your editor.
To really take things up a notch, you can install ππππππ.ππ to bring automatic reloading on files, modules, and even packages to the REPL. This enables some truly productivity-enhancing workflows.
Write a function in a .jl file β‘ test the function in the REPL β‘οΈ make a change to the function definition in your editor β‘οΈ test the redefined function in your REPL
All without ever restarting Julia!
3/ Jump straight to code from a stack trace
You can quickly jump to any line of code that appears in a stack trace by typing the stack trace line number followed by π²πππ + π.
For example, say you see a stack trace that looks like this:
Type π· into the prompt followed by π²πππ + π and your editor opens to the right line of code:
Keep in mind that you need to have the πΉππ»πΈπ°_π΄π³πΈππΎπ environment variable set in order for this to work, just like you need to in order to use ππππ().
These are just some of the things you can do in the Julia REPL. There are so many more!
Fortunately, @miguelraz_ put together a whole bunch of Julia REPL productivity hacks in a video. I highly recommend watching it:
β’ β’ β’
Missing some Tweet in this thread? You can try to
force a refresh