Rename from tiny-debugger to turbo-debug — inspired by Turbo Pascal, the first IDE with a real visual debugger. This thing isn't tiny, it's turbo charged. CHANGELOG for 0.1.0: Features: - Zero-config debugging — one line install, everything works - Modal keybindings (c/s/d/r/q/x/X/D/W/K/E/R/?), active only during debug mode, cleanly removed on exit - Persistent breakpoints via persistent-breakpoints.nvim - Inline virtual text — variable values in source code - Hover (K), watch (W), REPL eval (E) from the code window - Help splash (3s auto-dismiss) + manual help (?) - Debug mode chrome — winbar indicator, cursor highlight - dapui integration — controls toolbar, labeled panels - which-key support — <leader>d debug group auto-registered - quit_exits_mode option Adapters (12 languages): - Python (debugpy + venv detection) - Rust (codelldb + cargo build + vim.ui.select picker) - Go (delve), C/C++/Swift (codelldb) - JavaScript/TypeScript (js-debug-adapter) - C# (netcoredbg), Java, Kotlin, PHP, Ruby, Lua (osv) Keybindings: - <leader>dd — toggle debug mode - <leader>dx / <leader>dX / <leader>dD — breakpoints (always) - c s d r C x X D W K E q R ? — modal (debug mode only)
90 lines
2.0 KiB
Lua
90 lines
2.0 KiB
Lua
local M = {}
|
|
|
|
M.defaults = {
|
|
help_on_enter = true,
|
|
builtin_adapters = true,
|
|
quit_exits_mode = true, -- q terminates AND exits debug mode (false = terminate only)
|
|
|
|
-- modal keys (active only during debug mode, single-key)
|
|
keys = {
|
|
continue = "c",
|
|
step_over = "s",
|
|
step_into = "d",
|
|
step_out = "r",
|
|
run_to_cursor = "C",
|
|
breakpoint = "x",
|
|
cond_breakpoint = "X",
|
|
clear_breakpoints = "D",
|
|
watch = "W",
|
|
hover = "K",
|
|
eval = "E",
|
|
terminate = "q",
|
|
restart = "R",
|
|
help = "?",
|
|
},
|
|
|
|
-- global keys (always available, <leader>d prefix)
|
|
global_keys = {
|
|
toggle = "<leader>dd",
|
|
breakpoint = "<leader>dx",
|
|
cond_breakpoint = "<leader>dX",
|
|
clear_breakpoints = "<leader>dD",
|
|
},
|
|
|
|
dapui = {
|
|
icons = { expanded = "▼", collapsed = "▶", current_frame = "➤" },
|
|
controls = {
|
|
enabled = true,
|
|
element = "repl",
|
|
},
|
|
floating = { border = "rounded" },
|
|
render = { indent = 2, max_type_length = 20 },
|
|
layouts = {
|
|
{
|
|
position = "right",
|
|
size = 40,
|
|
elements = {
|
|
{ id = "scopes", size = 0.50 },
|
|
{ id = "watches", size = 0.25 },
|
|
{ id = "stacks", size = 0.25 },
|
|
},
|
|
},
|
|
{
|
|
position = "bottom",
|
|
size = 12,
|
|
elements = {
|
|
{ id = "repl", size = 0.50 },
|
|
{ id = "console", size = 0.50 },
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
virtual_text = {
|
|
commented = true,
|
|
highlight_changed_variables = true,
|
|
only_first_definition = false,
|
|
all_frames = false,
|
|
},
|
|
|
|
adapters = {},
|
|
}
|
|
|
|
M.opts = M.defaults
|
|
|
|
function M.merge(user_opts)
|
|
M.opts = vim.tbl_deep_extend("force", vim.deepcopy(M.defaults), user_opts or {})
|
|
if user_opts then
|
|
for _, tbl_name in ipairs({ "keys", "global_keys" }) do
|
|
if user_opts[tbl_name] then
|
|
for k, v in pairs(user_opts[tbl_name]) do
|
|
if v == false then M.opts[tbl_name][k] = false end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
return M.opts
|
|
end
|
|
|
|
return M
|