.config/nvim/after/plugin/dap.lua

31 lines
792 B
Lua
Raw Normal View History

vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end)
2023-03-13 19:58:45 +00:00
require('dap').adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed
name = 'lldb',
2023-03-13 19:58:45 +00:00
}
local lldb = {
name = 'Launch lldb',
type = 'lldb', -- matches the adapter
request = 'launch', -- could also attach to a currently running process
2023-03-13 19:58:45 +00:00
program = function()
return vim.fn.input(
'Path to executable: ',
vim.fn.getcwd() .. '/target/debug/',
'file'
2023-03-13 19:58:45 +00:00
)
end,
cwd = '${workspaceFolder}',
2023-03-13 19:58:45 +00:00
stopOnEntry = false,
args = {},
runInTerminal = false,
}
require('dap').configurations.rust = {
lldb -- different debuggers or more configurations can be used here
}
require('dap-ui').setup{}