Skip to content

Neovim commands reference

Commands and default mappings

Command Default mapping Description
:DebugStart [profile] <leader>dS start a session; completes profile names with Tab, the mapping always uses the default profile
:DebugTest <leader>dT debug the test under the cursor
:DebugContinue <leader>dc run until the next breakpoint
:DebugStepInto <leader>di enter the call on this line
:DebugStepOver <leader>do run this line, stop on the next
:DebugStepOut <leader>dO run until the current function returns
:DebugPause <leader>dp interrupt a running program
:DebugStop <leader>dt terminate the session
:DebugFocus <leader>du bring the debugger window forward
:ToggleBreakpoint [condition] <leader>db add or remove a breakpoint on this line

Watch the case: <leader>do is step over and <leader>dO is step out; <leader>dt is stop, <leader>dT is debug-test, <leader>dS is start.

setup() options

require("bugsaur").setup({  })
Option Type Default When it is read
binary string at setup()
gui boolean at setup()
gui_focus_on_stop boolean false when the GUI process starts
auto_attach boolean false at every setup()
gui_theme string nil when the GUI process starts
gui_width integer nil when the GUI process starts
gui_height integer nil when the GUI process starts
gui_layout table nil when the GUI process starts
gui_keymaps table nil when the GUI process starts
execution_line boolean true at setup()
execution_line_hl string CursorLine at setup()

gui_theme, gui_width, gui_height and gui_layout apply only when the project's [ui] section says nothing on the subject.

gui_keymaps accepts continue, step_into, step_over, step_out, pause, terminate, restart; vim.NIL disables one.

Lua API

local bugsaur = require("bugsaur")

bugsaur.list(opts)              -- entries; opts.root or opts.path narrow the selection
bugsaur.set(path, line, cond)   -- set or replace a condition; true if the set changed
bugsaur.remove(path, line)      -- remove one; true if there was one
bugsaur.remove_file(path)       -- remove all in a file; returns how many
bugsaur.clear(opts)             -- remove everything, or everything under opts.root

An entry from list(), sorted by path then line:

{
  path = "/abs/src/main.rs",
  relative = "src/main.rs",   -- nil if outside any root
  root = "/abs",              -- nil likewise
  line = 42,
  condition = nil,
  state = "verified",         -- "verified" | "rejected" | "pending"
}

Autocommand

vim.api.nvim_create_autocmd("User", {
  pattern = "BugsaurBreakpointsChanged",
  callback = function(event)
    -- event.data.paths — the affected files
  end,
})

Fires on any change to the breakpoint set: from these functions, from :ToggleBreakpoint, or from reading a file's set off disk.

Signs and highlight groups

Sign Meaning
runnable test or test group; on a highlighted line, current execution position
breakpoint verified
breakpoint pending
breakpoint rejected
Group Default
BugsaurExecutionLine links to CursorLine

Paths

Path What it is
/tmp/rust-debugger-nvim-<pid>.sock the source frontend socket
<root>/.bugsaur/breakpoints.json the saved breakpoint set

Not a contract

bugsaur.state is the plugin's internal state. Do not rely on it — the fields are free to change.