Neovim
The plugin plays a .non file on a resonon server, as the
VSCode extension does, and starts the language server
for it. It needs Neovim 0.12 or later, with resonon and resonon-lsp on your PATH.
Install
Section titled “Install”The plugin is editors/nvim in a checkout of the
resonon repository. With
lazy.nvim:
{ dir = "/path/to/resonon/editors/nvim", ft = "resonon", opts = {},}With any other plugin manager, add editors/nvim to the runtime path. require("resonon").setup()
is needed only to change a default.
| Key | Action | Modes |
|---|---|---|
Ctrl+E | Evaluate the selection, or the line the cursor is on | Normal, visual, select, insert |
Ctrl+Enter, Cmd+Enter | The same, where the terminal tells them apart from Enter | Normal, visual, select, insert |
<LocalLeader>e | The same | Normal, visual |
<LocalLeader>f | Evaluate the file | Normal |
F5, <LocalLeader>p | Play / Pause | Normal (F5 also select and insert) |
Shift+F5, <LocalLeader>s | Stop | Normal (Shift+F5 also select and insert) |
Ctrl+Shift+F5 | Reset | Normal, select, insert |
Ctrl+E reaches Neovim in every terminal. Ctrl+Enter and Cmd+Enter, the VSCode keys, reach it
in kitty, WezTerm, Ghostty and Neovide; in other terminals they are a plain Enter.
The selection stays after it is evaluated, so the same code can be evaluated again. The evaluated lines flash. The first evaluation connects to the server, and starts one in the project when none is listening. What the code prints goes to the output buffer, and an error is shown on the line where it happened.
What each transport action does: Transport.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
:Resonon eval | Evaluates the line the cursor is on, or a range: :'<,'>Resonon eval. |
:Resonon file | Evaluates the file in the live session. It is not a file run. |
:Resonon play, stop, reset | Transport. play pauses when playing. |
:Resonon output | Shows or hides the output buffer. |
:Resonon view {name} | Opens console, mixer, routing, scope or midi_monitor in a terminal split. See Terminal Views. |
:Resonon connect, disconnect | Connects to the configured server, or drops the connection. |
:Resonon server start, stop | Starts or stops a server in the current project. A server the plugin started stops when Neovim exits. |
While you type
Section titled “While you type”The language server starts for each project, from the project’s folder. Some of what it offers shows without being asked for, as in VSCode:
| Feature | When it shows |
|---|---|
| Completion | On a name, and after ., (, ,, " and {; not in a comment. Ctrl+N and Ctrl+P move through it, and Ctrl+Y takes an item. |
| Signature help | Above the cursor while it is inside a call, with the current argument highlighted. |
| Inlay hints | Always. |
With blink.cmp or nvim-cmp installed, completion is left to that plugin; signature help is left to
blink.cmp when its signature is enabled. Hover, go to definition, references, rename, formatting and
code actions are on Neovim’s own keys: K, Ctrl+], grr, grn, gq and gra.
Statusline
Section titled “Statusline”require("resonon").statusline() gives the connection, the CPU load and the session mode (Live or
File):
vim.o.statusline = "%f %m%=%{%v:lua.require'resonon'.statusline()%} "Settings
Section titled “Settings”The defaults:
require("resonon").setup({ cmd = "resonon", lsp = { enabled = true, cmd = "resonon-lsp", autocomplete = true, signature_help = true, inlay_hints = true, }, server = { host = "127.0.0.1", port = 5555, password = nil, autostart = true, -- start a server in the project when none is listening }, client_name = nil, -- the name other clients see; defaults to your login name audio = { multicore = false, plugin_mod_stride = 16 }, plugins = { auto_scan = true }, show_all_output = false, -- also show what other clients print flash_ms = 150, -- 0 turns the flash off keymaps = { evaluate = { "<C-e>", "<C-CR>", "<D-CR>", "<LocalLeader>e" }, evaluate_file = "<LocalLeader>f", play_pause = { "<F5>", "<LocalLeader>p" }, stop = { "<S-F5>", "<LocalLeader>s" }, reset = "<C-S-F5>", },})keymaps = false sets no keys, and an action set to false gets none. A key with Ctrl or Cmd,
or a function key, is also set in select and insert mode. The flash uses the ResononFlash
highlight group.