A fast and safe script runner which outputs the result in a nicely formatted buffer.
This is still work-in-progress.
- 🌱 : Supports but still unstable.
- 🌳 : Stable.
Language | Execute | Visual | Quickfix | Debugger |
---|---|---|---|---|
Lua | 🌱 | 🌱 | 🌱 | 🌱 |
Python | 🌱 | 🌱 | ||
Fennel | 🌱 | 🌱 | ||
nodejs | 🌱 | 🌱 | ||
Vimscript | 🌱 | 🌱 | ||
C++ / Visual Studio | 🌱 | 🌱 | ||
Matlab | ||||
Kotlin, Java / Android | 🌱 | 🌱 | ||
Latex | 🌱 | |||
Go | 🌱 | |||
GLSL / glslc | 🌱 | |||
Bash | 🌱 |
Can be used in conjunction with ntangle.nvim.
Visual: Execution of a visual selection
Remark: I'm still debating if the lua debugger belongs here. But for convenience, I won't do a separate plugin for now.
A basic diff algorithm highlights all the newly inserted lines in the output buffer. This is useful to quickly see which lines changes compared to the previous execution.
The execution is done completely is a sandboxed environnement. For lua, it spawns a new Neovim instance which will execute the script. The execution is done asynchronously and in case it prints infintely, little-runner.nvim will stop the execution after a certain number of lines has been reached.
This is an interesting workaround because executing a infinite loop through luafile
will freeze the client normally. Lua plugins developer are most likely familar with it. Although little-runner.nvim sandboxed execution is interesting, it can't be applied to plugin development.
You can navigate instantly to the error line.
It supports multiple languages out of the box. More support will be added as the plugin is evolving.
Vimscript has some good debugging support but lua has only debug.debug()
which is insufficient in my opinion. This still breaks often and lacks features but offers some support for debugging. It's a prototype for more to come.
Start the debugger with :DashDebug
.
- Place breakpoint:
require"dash".toggle_breakpoint()
- Step:
require"dash".step()
- Continue:
require"dash".continue()
- Inspect variable:
require"dash".inspect()
- Inspect variable (visual):
require"dash".vinspect()
The execution can happen in a remote neovim instance. It uses the TCP port 7777
to connect to the remote process and invoke dash.nvim. For example, the host could
be Windows and the remote WSL.
Start the executing neovim instance using:
nvim --headless --listen localhost:7777
In the host environnement, open nvim and connect to the remote instance with:
:DashConnect
All the execution will happen remotely on :DashRun
.
Install using your favorite plugin manager. For example using vim-plug.
Plug 'jbyuki/dash.nvim'
:DashRun
Guidelines which should guide the development of this plugin.
- The plugin should be functionnal with minimal configuration
- If you encounter any problem, please don't hesitate to open an Issue.
- All contributions are welcome.
For the curious out there: Try to copy-paste a brainf*ck program and execute it using DashRun
. Set the filetype to bf using set ft=bf
. Admire the computation done live in front of your eyes.