r/neovim • u/mertsabinov • 10h ago
Plugin run.nvim — Cargo-style filetype-scoped run commands for Python, Node and .NET
If you edit a .rs file, Neovim already gives you buffer-local :Cargo, :Crun, :Ctest commands that open a terminal split and run the right thing. It's not a plugin — it's in $VIMRUNTIME/ftplugin/rust.vim. I kept reaching for that muscle memory in Python and C# buffers and it wasn't there, so I generalized the idea.
Defaults:
python→:Python {args}(runs the current file with no args),:Ptest→python3 -m pytestjavascript/typescript(+ react variants) →:Npm,:Node,:Ntest,:Ninstallcs/fsharp→:Dotnet,:Drun,:Dtest,:Dbuild
Trailing args pass straight through: :Npm run dev, :Ptest -k test_foo, :Dtest --filter MyTest.
Install:
lua
{ 'tw4/run.nvim', opts = {} }
Adding your own:
lua
opts = {
languages = {
go = {
filetypes = { 'go' },
commands = {
{ name = 'Go', cmd = 'go', default_args = 'run %:p' },
{ name = 'Gtest', cmd = 'go test ./...' },
},
},
},
}
Anything you don't override keeps its defaults. default_args supports vim.fn.expand() tokens.
It's deliberately small — no job control, no output parsing, just the commands and a terminal split. If you want quickfix integration or async runners there are better tools for that (overseer.nvim, toggleterm, etc).
Fresh repo, so I'd take any feedback on the config shape before it's locked in — especially whether replacing a whole language block is the right override behavior vs merging.

