setup dap for lldb/zig, change lualine theme, edit ts config

This commit is contained in:
2024-12-12 14:32:13 +01:00
parent 5ec6ca4070
commit 4217f3f6bc
6 changed files with 61 additions and 104 deletions
@@ -23,6 +23,12 @@ dap.adapters.gdb = {
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
}
dap.adapters.lldb = {
type = 'executable',
command = 'lldb-dap',
name = 'lldb'
}
dap.configurations.c = {
{
name = "Launch",
@@ -32,8 +38,7 @@ dap.configurations.c = {
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = "${workspaceFolder}",
stopOnEntry = true,
-- stopAtBeginningOfMainSubprogram = false,
stopOnEntry = false,
},
{
name = "Select and attach to process",
@@ -69,3 +74,32 @@ dap.configurations.c = {
},
}
dap.configurations.zig = {
{
name = "Debug Zig Executable",
type = "lldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file')
end,
cwd = "${workspaceFolder}",
args = {},
stopOnEntry = false,
},
{
name = 'Attach to Zig Process',
type = 'lldb',
request = 'attach',
pid = require('dap.ui.widgets').hover,
args = {},
}
}
-- DAP Keybinds
vim.keymap.set('n', '<F5>', function() dap.continue() end)
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
vim.keymap.set('n', '<F11>', function() dap.step_into() end)
vim.keymap.set('n', '<F12>', function() dap.step_out() end)
vim.keymap.set('n', '<Leader>bp', function() dap.toggle_breakpoint() end)
vim.keymap.set('n', '<Leader>dr', function() dap.repl.open() end)