Better integration of Julia REPL with Emacs vterm terminal.
-
In Julia prompt type:
julia> ]add EmacsVterm
-
Add the following to
~/.julia/config/startup.jl
:atreplinit() do repl @eval using EmacsVterm # Optionally set EmacsVterm.options as you like (see below) end
-
Configure julia-repl to use the
vterm
backend by putting:(julia-repl-set-terminal-backend 'vterm)
to your Emacs config.
-
You can jump between prompts in
*julia*
REPL buffers withC-c C-p
andC-c C-n
. -
Julia REPL informs Emacs about its working directory. Therefore, after changing directory in Julia, opening file in Emacs (e.g.
C-x C-f
) starts in that directory. -
Documentation (
@doc ...
invocation orC-c C-d
injulia-mode
buffers withjulia-repl
enabled) is shown in a separate Emacs buffer.To disable this functionality, run:
EmacsVterm.options.markdown = false
If you are not happy with where Emacs chooses to display the
*julia-doc*
buffer, you can configure it via a "display action". For example, the following piece of code ininit.el
ensures that if the*julia-doc*
buffer is already shown somewhere, the same buffer is reused; otherwise, a right side window with an appropriate width will be created.(add-to-list 'display-buffer-alist '("\\*julia-doc\\*" (display-buffer-reuse-window display-buffer-in-side-window) (side . right) (window-width . 80)))
-
Images can be shown in the
*julia-img*
Emacs buffer. This functionality is not enabled by default. Enable it with:EmacsVterm.options.image = true
-
In addition to
EmacsVterm.options
, the whole Emacs-based Multimedia I/O can be disabled (resp. enabled) with:EmacsVterm.display_off() EmacsVterm.display_on()