Volyglot -- Vim + polyglot (Speaking, writing, written in, or composed of several languages)
Features:
- Executes Python files, individual lines, or blocks (via visual mode) within the Vim/Neovim editor
- Displays the output in a separate buffer/window
- Can inspect variable/expression values
- Set breakpoints within functions etc. and inspect local variables
- Completions (via IPython if available, else rlcompleter)
- Supports Python language extensions Coconut and SageMath, as well as Hy
- Other languages supported: Vimscript, Lua, Ruby, Julia, R, JavaScript (via js2py), Octave, and Wolfram Language
Install via your favorite plug-in manager (vim-plug, pathogen.vim, Vundle, etc.)
Requirements:
-Vim (gVim, neovim) with Python3 build; ' :echo has("python3") ' must return 1 (Python required for all languages)
Others:
- Vimscript -- works if the above works
- Lua -- automatic for neovim, :echo has("lua") must return 1 for vim, requires lua...so or lua...dll to be present/installed
- Coconut -- coconut python module
- SageMath -- must have SageMath installed; neovim only, Windows requires WSL/Docker or some kind of virtualization
- Hy -- hy python module
- Ruby -- :echo has("ruby") must return 1, must have ruby installed/in execution path, gem install neovim for neovim
- Julia -- must have julia installed and in-path and juliacall python module
- JavaScript -- js2py python module must be installed
- R -- R installed/in-path and rpy2 python module
- Octave -- Octave + oct2py python module
- Wolfram Language -- Wolfram Engine installed/in-path and wolframclient module
:Volyglot ---initialize Volyglot, create new pane/buffer for outputs
<F10> ---same as above
For python (or sage or coconut):
<F5> ---execute entire file
<s-enter> ---execute current line (normal, insert modes) )or selected region (if in visual mode)
<c-\> ---same as above, friendlier for terminals
<c-]> hy
<m-]> javascript
<m-\> julia
<m-/> lua
<m-,> ruby
<m-;> octave
<m-'> R
<m-enter> vimscript
<m-w> wolfram
<c-u> ---get completions (if in insert mode)
<c-b> ---try to evaluate expression in line, or stuff before = (i.e., if the line has x = 2, will output the CURRENT value of x, which may or may not be defined)
Demo/tutorial is in the works.