Skip to content

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.

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.

KeyActionModes
Ctrl+EEvaluate the selection, or the line the cursor is onNormal, visual, select, insert
Ctrl+Enter, Cmd+EnterThe same, where the terminal tells them apart from EnterNormal, visual, select, insert
<LocalLeader>eThe sameNormal, visual
<LocalLeader>fEvaluate the fileNormal
F5, <LocalLeader>pPlay / PauseNormal (F5 also select and insert)
Shift+F5, <LocalLeader>sStopNormal (Shift+F5 also select and insert)
Ctrl+Shift+F5ResetNormal, 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.

CommandWhat it does
:Resonon evalEvaluates the line the cursor is on, or a range: :'<,'>Resonon eval.
:Resonon fileEvaluates the file in the live session. It is not a file run.
:Resonon play, stop, resetTransport. play pauses when playing.
:Resonon outputShows 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, disconnectConnects to the configured server, or drops the connection.
:Resonon server start, stopStarts or stops a server in the current project. A server the plugin started stops when Neovim exits.

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:

FeatureWhen it shows
CompletionOn a name, and after ., (, ,, " and {; not in a comment. Ctrl+N and Ctrl+P move through it, and Ctrl+Y takes an item.
Signature helpAbove the cursor while it is inside a call, with the current argument highlighted.
Inlay hintsAlways.

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.

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()%} "

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.