Neovim plugin for Gauge — wires the Gauge LSP server to
.spec and .cpt files using Neovim's native LSP client. Zero external
dependencies.
- LSP auto-attach — completion, diagnostics, go-to-definition, formatting, rename, code actions, and document/workspace symbols out of the box
:GaugeRun— run the current spec or the nearest scenario under the cursor in a split terminal:GaugeSpecs— list every spec file in the project via the quickfix list:checkhealth gauge— verify your setup at a glance- No nvim-lspconfig required — uses
vim.lspdirectly
- Neovim >= 0.10
gaugeon your$PATH
git clone https://github.com/zabil/gauge.nvim \
~/.config/nvim/pack/plugins/start/gauge.nvimThen add to your ~/.config/nvim/init.lua:
require('gauge').setup(){
'zabil/gauge.nvim',
ft = { 'gauge', 'gauge_concept' },
config = function()
require('gauge').setup()
end,
}vim.pack.add('https://github.com/zabil/gauge.nvim')
require('gauge').setup()All options are optional — setup({}) and setup() both work:
require('gauge').setup({
-- Override the LSP server command.
-- Default: { 'gauge', 'daemon', '--lsp', '--dir', <project-root> }
-- The default detects the root (manifest.json) per-project at attach time.
-- cmd = { 'gauge', 'daemon', '--lsp', '--dir', '/path/to/project' },
-- Called after the LSP client attaches to a buffer — use it for keymaps,
-- inlay hints, or any per-buffer setup.
on_attach = function(client, bufnr)
local map = function(key, cmd, desc)
vim.keymap.set('n', key, cmd, { buffer = bufnr, silent = true, desc = desc })
end
map('<leader>Gr', '<cmd>GaugeRun<cr>', 'Gauge: run spec/scenario')
map('<leader>Gs', '<cmd>GaugeSpecs<cr>', 'Gauge: list specs')
end,
-- Merge extra LSP client capabilities (e.g. from nvim-cmp or blink.cmp).
-- capabilities = require('cmp_nvim_lsp').default_capabilities(),
-- LSP workspace settings forwarded to the server.
settings = {},
-- Set true to enable built-in keymaps <leader>gr / <leader>gs in gauge buffers.
-- Prefer on_attach above if you need a different prefix.
keymaps = false,
})| Command | Description |
|---|---|
:GaugeRun |
Run the current .spec file, or the nearest ## Scenario under the cursor |
:GaugeSpecs |
List all spec files in the project (opens quickfix) |
Output from :GaugeRun appears in a reusable horizontal split terminal.
The previous run's buffer (and its process) is cleaned up automatically.
All features are provided by the Gauge language server (gauge daemon --lsp),
which ships inside the gauge binary:
| Feature | Details |
|---|---|
| Completion | Step completions; triggers on *, ", <, :, , |
| Go-to-definition | Jump from a step call to its implementation |
| Diagnostics | Inline errors and warnings as you type |
| Formatting | gq / :Format auto-formats spec files |
| Code actions | Quick-fix suggestions |
| Rename | Rename a step and all its usages across the project |
| Document symbols | Navigate scenarios and steps in the current file |
| Workspace symbols | Search across the whole project |
:checkhealth gauge
Checks Neovim version, gauge binary availability, whether setup() has been
called, and the number of currently active LSP clients.
| Extension | Filetype |
|---|---|
.spec |
gauge |
.cpt |
gauge_concept |
Filetype detection runs automatically on load — no setup() call required for
syntax highlighting alone.
plugin/gauge.luaregisters.spec→gaugeand.cpt→gauge_conceptfiletypes viavim.filetype.add()at startup.setup()registers aFileTypeautocmd that callsvim.lsp.start()for every gauge buffer, startinggauge daemon --lsp --dir <root>once per project root (detected by walking up tomanifest.json).:GaugeRunshells out togauge run <file>[:<line>];:GaugeSpecscalls the customgauge/specsLSP method and feeds the result into the quickfix list.
Apache 2.0 — same as the Gauge project itself.