You've already forked dotfiles
feat: Starting the cleanup on DAP plugins and adding a basic statusline
to futz around with potential replacement of more external plugins.
This commit is contained in:
@@ -5,6 +5,8 @@ vim.pack.add({
|
||||
'https://github.com/theHamsta/nvim-dap-virtual-text',
|
||||
})
|
||||
|
||||
-- TODO: Needs a pass to remove hardcoding, potentially cut out mason completely and general cleanup
|
||||
|
||||
require('dapui').setup({
|
||||
mappings = {
|
||||
open = 'o',
|
||||
@@ -49,90 +51,90 @@ require('dapui').setup({
|
||||
})
|
||||
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
-- local mason_dap = require('mason-nvim-dap')
|
||||
local dap, dapui = require('dap'), require('dapui')
|
||||
-- local mason_dap = require('mason-nvim-dap')
|
||||
local dap, dapui = require('dap'), require('dapui')
|
||||
|
||||
-- mason_dap.setup({
|
||||
-- ensure_installed = {
|
||||
-- 'codelldb',
|
||||
-- 'debugpy',
|
||||
-- },
|
||||
-- automatic_installation = true,
|
||||
-- handlers = {
|
||||
-- function(config)
|
||||
-- require('mason-nvim-dap').default_setup(config)
|
||||
-- end,
|
||||
-- }
|
||||
-- })
|
||||
-- mason_dap.setup({
|
||||
-- ensure_installed = {
|
||||
-- 'codelldb',
|
||||
-- 'debugpy',
|
||||
-- },
|
||||
-- automatic_installation = true,
|
||||
-- handlers = {
|
||||
-- function(config)
|
||||
-- require('mason-nvim-dap').default_setup(config)
|
||||
-- end,
|
||||
-- }
|
||||
-- })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapStopped', { text = '▶️' })
|
||||
-- vim.fn.sign_define('DapBreakpoint', { text = 'ᛒ', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🟥', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapBreakpointCondition', { text = '🝌', texthl = '', lineh = '', numhl = '' })
|
||||
vim.fn.sign_define('DapStopped', { text = '▶️' })
|
||||
|
||||
dap.adapters.gdb = {
|
||||
type = 'executable',
|
||||
command = 'gdb',
|
||||
args = { '-i', 'dap' },
|
||||
dap.adapters.gdb = {
|
||||
type = 'executable',
|
||||
command = 'gdb',
|
||||
args = { '-i', 'dap' },
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
command = 'lldb',
|
||||
type = 'executable',
|
||||
}
|
||||
|
||||
dap.adapters.debugpy = {
|
||||
command = 'debugpy',
|
||||
type = 'executable',
|
||||
}
|
||||
|
||||
dap.configurations = {
|
||||
rust = {
|
||||
{
|
||||
type = 'lldb',
|
||||
name = 'Debug',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. '/target/debug/faultybranches' -- TODO: remove the testing hardcoded path
|
||||
end,
|
||||
stopAtBeginningOfMainSubprogram = true,
|
||||
},
|
||||
},
|
||||
python = {
|
||||
{
|
||||
type = 'python',
|
||||
name = 'Launch current file',
|
||||
request = 'launch',
|
||||
program = '${file}',
|
||||
pythonPath = function()
|
||||
if vim.env.VIRTUAL_ENV then
|
||||
return vim.env.VIRTUAL_ENV .. '/bin/python'
|
||||
end
|
||||
|
||||
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
command = 'lldb',
|
||||
type = 'executable',
|
||||
}
|
||||
|
||||
dap.adapters.debugpy = {
|
||||
command = 'debugpy',
|
||||
type = 'executable',
|
||||
}
|
||||
|
||||
dap.configurations = {
|
||||
rust = {
|
||||
{
|
||||
type = 'lldb',
|
||||
name = 'Debug',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. '/target/debug/faultybranches'
|
||||
end,
|
||||
stopAtBeginningOfMainSubprogram = true,
|
||||
},
|
||||
},
|
||||
python = {
|
||||
{
|
||||
type = 'python',
|
||||
name = 'Launch current file',
|
||||
request = 'launch',
|
||||
program = '${file}',
|
||||
pythonPath = function()
|
||||
if vim.env.VIRTUAL_ENV then
|
||||
return vim.env.VIRTUAL_ENV .. '/bin/python'
|
||||
end
|
||||
|
||||
return vim.fn.exepath('python3') or vim.fn.exepath('python') or 'python'
|
||||
end
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>b', function ()
|
||||
vim.keymap.set('n', '<leader>b', function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
|
||||
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>dh', function() require('dap.ui.widgets').hover() end)
|
||||
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
||||
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
|
||||
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)
|
||||
|
||||
Reference in New Issue
Block a user