nvim/lua/plugins/dap.lua

119 lines
2.3 KiB
Lua
Raw Permalink Normal View History

2023-12-04 09:24:43 +01:00
return {
{
'mfussenegger/nvim-dap',
keys = function()
local function dap(name)
return function()
require('dap')[name]()
end
end
return {
2024-05-31 11:03:10 +02:00
{ '<leader>dc', dap 'continue', desc = 'continue' },
{ '<leader>ds', dap 'step_into', desc = 'step into' },
{ '<leader>dn', dap 'step_over', desc = 'step over (next)' },
{ '<leader>df', dap 'step_out', desc = 'step out (finish)' },
{ '<leader>db', dap 'toggle_breakpoint', desc = 'toggle breakpoint' },
{
'<leader>do',
function()
vim.ui.input({ prompt = 'Condition: ' }, function(input)
if input == nil then
return
end
require('dap').set_breakpoint(input)
end)
end,
desc = 'set conditional breakpoint',
},
{ '<leader>dl', dap 'clear_breakpoints', desc = 'clear breakpoints' },
2024-05-31 11:03:10 +02:00
{ '<leader>dq', dap 'terminate', desc = 'quit' },
}
end,
},
2023-12-04 09:24:43 +01:00
{
'rcarriga/nvim-dap-ui',
opts = {
controls = {
element = 'repl',
2023-12-04 09:24:43 +01:00
enabled = true,
icons = {
disconnect = '',
pause = '',
play = '',
run_last = '',
step_back = '',
step_into = '',
step_out = '',
step_over = '',
terminate = '',
},
2023-12-04 09:24:43 +01:00
},
element_mappings = {},
expand_lines = true,
floating = {
border = 'single',
2023-12-04 09:24:43 +01:00
mappings = {
close = { 'q', '<Esc>' },
},
2023-12-04 09:24:43 +01:00
},
force_buffers = true,
icons = {
collapsed = '',
current_frame = '',
expanded = '',
2023-12-04 09:24:43 +01:00
},
layouts = {
{
elements = {
{
id = 'scopes',
size = 0.5,
},
-- {
-- id = "breakpoints",
-- size = 0.25
-- },
{
id = 'stacks',
size = 0.25,
},
{
id = 'watches',
size = 0.25,
},
2023-12-04 09:24:43 +01:00
},
position = 'right',
size = 40,
},
{
elements = {
{
id = 'repl',
size = 0.5,
},
{
id = 'console',
size = 0.5,
},
2023-12-04 09:24:43 +01:00
},
position = 'bottom',
size = 10,
2023-12-04 09:24:43 +01:00
},
},
2023-12-04 09:24:43 +01:00
mappings = {
edit = 'e',
expand = { '<CR>', '<2-LeftMouse>' },
open = 'o',
remove = 'd',
repl = 'r',
toggle = 't',
2023-12-04 09:24:43 +01:00
},
render = {
indent = 1,
max_value_lines = 100,
},
2023-12-04 09:24:43 +01:00
},
},
}