py-vterm-interaction.el/README.org

63 lines
3.2 KiB
Org Mode
Raw Normal View History

2020-10-04 14:57:18 +09:00
# -*- eval: (visual-line-mode 1) -*-
#+STARTUP: showall
[[https://melpa.org/#/julia-vterm][file:https://melpa.org/packages/julia-vterm-badge.svg]] [[https://stable.melpa.org/#/julia-vterm][file:https://stable.melpa.org/packages/julia-vterm-badge.svg]]
2020-10-04 14:57:18 +09:00
* julia-vterm
Julia-vterm provides a major-mode for inferior Julia process that runs in vterm, and a minor-mode that extends julia-mode with the ability to interact 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
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 a very large DataFrame, which seemed to be caused by the limited performance of term.el. Julia-vterm is implemented using emacs-libvterm, and REPL works as smoothly as in a native terminal.
2020-10-04 14:57:18 +09:00
Currently, julia-vterm offers minimum functionalities for basic interaction with the REPL. A few more functions may be added in the future, but you may want to check julia-repl if you need more features. If the simplicity of this package 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
Just install it from MELPA. The package name is =julia-vterm=.
Then, evaluate the following add-hook line to turn on julia-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 julia-vterm-mode in future sessions.
2020-10-07 19:26:30 +09:00
#+BEGIN_SRC emacs-lisp
(add-hook 'julia-mode-hook #'julia-vterm-mode)
2020-10-09 10:05:26 +09:00
#+END_SRC
You can install the package manually if necessary. First make sure [[https://github.com/JuliaEditorSupport/julia-emacs][julia-mode]] and [[https://github.com/akermu/emacs-libvterm][emacs-libvterm]] are installed and working properly. Download =julia-vterm.el= into somewhere in your local directory and install it with the following. You also need to configure the hook described above.
2020-10-09 10:05:26 +09:00
#+BEGIN_SRC emacs-lisp
(package-install-file "/path-to-download-dir/julia-vterm.el")
2020-10-07 19:26:30 +09:00
#+END_SRC
** How to use
In a julia script buffer with =julia-vterm-mode= on, you can open an inferior Julia REPL buffer with =M-x julia-vterm-switch-to-repl-buffer= (or =C-c C-z=).
2020-10-07 19:26:30 +09:00
** Key bindings
*** =julia-mode= with =julia-vterm-mode= enabled
2020-10-07 19:26:30 +09:00
| Key | Binding |
|------------+-----------------------------------------|
| =C-c C-z= | =julia-vterm-switch-to-repl-buffer= |
| =C-<return>= | =julia-vterm-send-region-or-current-line= |
| =C-c C-b= | =julia-vterm-send-buffer= |
| =C-c C-i= | =julia-vterm-send-include-buffer-file= |
2020-10-27 15:02:12 +09:00
| =C-c C-d= | =julia-vterm-send-cd-to-buffer-directory= |
2020-10-07 19:26:30 +09:00
*** =julia-vterm-repl-mode=
2020-10-07 19:26:30 +09:00
| Key | Binding |
|---------+------------------------------------------|
| =C-c C-z= | =julia-vterm-repl-switch-to-script-buffer= |
| =M-k= | =julia-vterm-repl-clear-buffer= |
| =C-c C-t= | =julia-vterm-repl-copy-mode= |
2020-10-07 19:26:30 +09:00
*** =julia-vterm-repl-mode= (copy mode)
2020-10-07 19:26:30 +09:00
| Key | Binding |
|----------+---------------------------------|
| =C-c C-t= | =julia-vterm-repl-copy-mode= |
| =<return>= | =julia-vterm-repl-copy-mode-done= |
| =C-c C-r= | =vterm-reset-cursor-point= |