py-vterm-interaction.el/README.org

57 lines
2.9 KiB
Org Mode
Raw Normal View History

2020-10-04 14:57:18 +09:00
# -*- eval: (visual-line-mode 1) -*-
#+STARTUP: showall
2020-10-09 10:05:26 +09:00
* julia-repl-vterm.el
2020-10-04 14:57:18 +09:00
2020-10-09 10:05:26 +09:00
The julia-repl-vterm.el provides a major-mode for inferior Julia process that runs in vterm, and a minor-mode that extends julia-mode for interaction with the inferior Julia process.
2020-10-04 14:57:18 +09:00
2020-10-09 10:05:26 +09:00
** Should I use this?
2020-10-04 14:57:18 +09:00
2020-10-09 15:40:05 +09:00
There's already [[https://github.com/tpapp/julia-repl][julia-repl]]. It works well in most cases, but I sometimes encountered problems when I used very large DataFrame, which seemed to be caused by the limited performance of term.el. I wrote julia-repl-vterm.el using vterm and now REPL works as smoothly as in a native terminal.
2020-10-04 14:57:18 +09:00
2020-10-09 15:40:05 +09:00
This code has the minimum functions that suffice my use. You may want to check julia-repl if you need more features. If this simplicity fits your preference, please give it a try!
2020-10-04 14:57:18 +09:00
2020-10-07 19:26:30 +09:00
** Installation
2020-10-09 10:05:26 +09:00
Install [[https://github.com/JuliaEditorSupport/julia-emacs][julia-mode]] and [[https://github.com/akermu/emacs-libvterm][emacs-libvterm]] first. Download [[https://raw.githubusercontent.com/shg/julia-repl-vterm.el/master/julia-repl-vterm.el][julia-repl-vterm.el]] into somewhere in your local directory and install it with the following.
2020-10-07 19:26:30 +09:00
#+BEGIN_SRC emacs-lisp
2020-10-09 10:05:26 +09:00
(package-install-file "/path-to-download-dir/julia-repl-vterm.el")
#+END_SRC
2020-10-09 10:05:26 +09:00
Next, evaluate the following add-hook line to turn on julia-with-repl-vterm-mode in newly opened julia-mode buffers. A symbol "⁂" in the mode line indicates that the julia-mode buffer is ready to interact with the vterm-powered Julia REPL. Add this line to your init file to enable this in future sessions.
2020-10-09 10:05:26 +09:00
#+BEGIN_SRC emacs-lisp
(add-hook 'julia-mode-hook #'julia-with-repl-vterm-mode)
2020-10-07 19:26:30 +09:00
#+END_SRC
** How to use
2020-10-09 10:05:26 +09:00
In a julia-mode buffer, =M-x inferior-julia-repl-vterm-switch-to-script-buffer= (or =C-c C-z=) to open an inferior Julia REPL buffer associated with the julia-mode buffer.
2020-10-07 19:26:30 +09:00
** Key bindings
*** =julia-mode= with =julia-with-repl-vterm-mode= enabled
| Key | Binding |
|------------+---------------------------------------------------|
| =C-c C-z= | =julia-with-repl-vterm-switch-to-repl-buffer= |
| =C-<return>= | =julia-with-repl-vterm-send-region-or-current-line= |
| =C-c C-b= | =julia-with-repl-vterm-send-buffer= |
*** =inferior-julia-repl-vterm-mode=
| Key | Binding |
|---------+---------------------------------------------------|
| =C-c C-z= | =inferior-julia-repl-vterm-switch-to-script-buffer= |
| =M-k= | =inferior-julia-repl-vterm-clear-buffer= |
| =C-c C-t= | =inferior-julia-repl-vterm-copy-mode= |
*** =inferior-julia-repl-vterm-mode= (copy mode)
| Key | Binding |
|----------+------------------------------------------|
| =C-c C-t= | =inferior-julia-repl-vterm-copy-mode= |
| =<return>= | =inferior-julia-repl-vterm-copy-mode-done= |
| =C-c C-r= | =vterm-reset-cursor-point= |