You've already forked dotfiles
feat: Adding a bunch of changes to move further towards a clean and more
builtin setup rather than relying upon plugins.
This commit is contained in:
@@ -1,78 +1,69 @@
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
{ 'jay-babu/mason-nvim-dap.nvim' },
|
||||
{ 'nvim-neotest/nvim-nio' },
|
||||
vim.pack.add({
|
||||
'https://github.com/rcarriga/nvim-dap-ui',
|
||||
'https://github.com/mfussenegger/nvim-dap',
|
||||
'https://github.com/nvim-neotest/nvim-nio',
|
||||
'https://github.com/theHamsta/nvim-dap-virtual-text',
|
||||
})
|
||||
|
||||
require('dapui').setup({
|
||||
mappings = {
|
||||
open = 'o',
|
||||
remove = 'd',
|
||||
edit = 'e',
|
||||
repl = 'r',
|
||||
toggle = 't',
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
config = function()
|
||||
require('dapui').setup({
|
||||
mappings = {
|
||||
open = 'o',
|
||||
remove = 'd',
|
||||
edit = 'e',
|
||||
repl = 'r',
|
||||
toggle = 't',
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
'scopes',
|
||||
'breakpoints',
|
||||
'stacks',
|
||||
},
|
||||
size = 0.33,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
'console',
|
||||
'watches',
|
||||
},
|
||||
size = 0.2,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil,
|
||||
max_width = nil,
|
||||
border = 'single',
|
||||
mappings = {
|
||||
close = { 'q', '<Esc>' },
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
indent = 1
|
||||
},
|
||||
render = {
|
||||
max_type_length = nil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
elements = {
|
||||
'scopes',
|
||||
'breakpoints',
|
||||
'stacks',
|
||||
},
|
||||
size = 0.33,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
config = function()
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
end,
|
||||
elements = {
|
||||
'console',
|
||||
'watches',
|
||||
},
|
||||
size = 0.2,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local mason_dap = require('mason-nvim-dap')
|
||||
floating = {
|
||||
max_height = nil,
|
||||
max_width = nil,
|
||||
border = 'single',
|
||||
mappings = {
|
||||
close = { 'q', '<Esc>' },
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
indent = 1
|
||||
},
|
||||
render = {
|
||||
max_type_length = nil,
|
||||
},
|
||||
})
|
||||
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
-- 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()
|
||||
@@ -136,53 +127,15 @@ return {
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>b',
|
||||
function() require('dap').toggle_breakpoint() end,
|
||||
desc = 'DAP: Toggle Breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>B',
|
||||
function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end,
|
||||
desc = 'DAP: Set conditional breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>dh',
|
||||
function() require('dap.ui.widgets').hover() end,
|
||||
mode = { 'n', 'v' },
|
||||
desc = 'DAP: Debug hover',
|
||||
},
|
||||
{
|
||||
'<F5>',
|
||||
function() require('dap').continue() end,
|
||||
desc = 'DAP: Continue',
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function() require('dap').run_to_cursor() end,
|
||||
desc = 'DAP: Run to cursor',
|
||||
},
|
||||
{
|
||||
'<F8>',
|
||||
function() require('dap').terminate() end,
|
||||
desc = 'DAP: Terminate debug session',
|
||||
},
|
||||
{
|
||||
'<F10>',
|
||||
function() require('dap').step_over() end,
|
||||
desc = 'DAP: Step Over',
|
||||
},
|
||||
{
|
||||
'<F11>',
|
||||
function() require('dap').step_into() end,
|
||||
desc = 'DAP: Step Into',
|
||||
},
|
||||
{
|
||||
'<F12>',
|
||||
function() require('dap').step_out() end,
|
||||
desc = 'DAP: Step Out',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
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', '<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)
|
||||
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
|
||||
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
|
||||
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)
|
||||
|
||||
Reference in New Issue
Block a user