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
Ctrl+Shift+Enter, Cmd+Shift+EnterRun File Live, where the terminal tells them apart from Enter: write changed buffers, then evaluate the whole entry file into the running session, without RESET or setup()Normal, select, insert
<LocalLeader>fThe sameNormal
F5, <LocalLeader>pPlay / PauseNormal (F5 also select and insert)
Shift+F5, <LocalLeader>sStopNormal (Shift+F5 also select and insert)
Ctrl+Shift+F5Reset the server (RESET)Normal, select, insert

Reset Project has no default key; use :Resonon reset, or give reset_project a key in keymaps.

Ctrl+E reaches Neovim in every terminal. Ctrl+Enter and Cmd+Enter, the VSCode keys, and their Shift forms 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 runRun File Live: writes changed buffers, then evaluates the whole entry file into the running session, without RESET or setup().
:Resonon resetReset Project: writes changed buffers, then opens the project again from its files: teardown(), RESET, the saved session, then the entry file with setup(). Asks first when the session has changes since the last save, and when tracks were renamed since the code named them. See The entry file’s lifecycle.
:Resonon play, stopTransport. play pauses when playing.
:Resonon outputShows or hides the output buffer.
:Resonon view {name}Opens console, routing, scope or midi_monitor in a terminal split; omit the name to open the main window. See Terminal Views and Use the Mixer.
: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,
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 },
plugins = { auto_scan = true },
show_all_output = false, -- also show what other clients print
flash_ms = 150, -- 0 turns the flash off
keymaps = {
run_selection_live = { "<C-e>", "<C-CR>", "<D-CR>", "<LocalLeader>e" },
run_file_live = { "<C-S-CR>", "<D-S-CR>", "<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. reset_project has no default key; set it in keymaps to give Reset Project one. 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.

From the repository root, run the headless regression tests:

Terminal window
nvim --headless -u NONE -l editors/nvim/tests/view.lua

The tests control the connection and process boundaries. They require no server, project, audio device or desktop. Unnamed :Resonon view connects to the configured server before requesting its main window. It does not start a server, even when server.autostart is enabled. Named terminal views keep their existing commands.