Skip to content

Script runner for quick iteration. Bring your scripting to the next level.

License

Notifications You must be signed in to change notification settings

jbyuki/dash.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dash.nvim

A fast and safe script runner which outputs the result in a nicely formatted buffer.

This is still work-in-progress.

Supported

  • 🌱 : 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.

Features

Diff Output

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.

Infinite Loop Guard

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.

Fill Quickfix

You can navigate instantly to the error line.

Multi Language Support

It supports multiple languages out of the box. More support will be added as the plugin is evolving.

Debugger

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()

Remote execution

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.

Installation

Install using your favorite plugin manager. For example using vim-plug.

Plug 'jbyuki/dash.nvim'

Usage

:DashRun

Design

Guidelines which should guide the development of this plugin.

  • The plugin should be functionnal with minimal configuration

Help

  • If you encounter any problem, please don't hesitate to open an Issue.
  • All contributions are welcome.

Extra

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.

About

Script runner for quick iteration. Bring your scripting to the next level.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published