Merge pull request #2 from lazarust/debugger

Debugger
This commit is contained in:
Thomas Lazarus 2025-11-12 21:28:18 -06:00 committed by GitHub
commit 1d54f732a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 36 deletions

View File

@ -1,15 +1,5 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return { return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = { dependencies = {
-- Creates a beautiful debugger UI -- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui', 'rcarriga/nvim-dap-ui',
@ -22,33 +12,33 @@ return {
'jay-babu/mason-nvim-dap.nvim', 'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here -- Add your own debuggers here
'leoluz/nvim-dap-go', 'mfussenegger/nvim-dap-python',
}, },
keys = { keys = {
-- Basic debugging keymaps, feel free to change to your liking! -- Basic debugging keymaps, feel free to change to your liking!
{ {
'<F5>', '<Up>',
function() function()
require('dap').continue() require('dap').continue()
end, end,
desc = 'Debug: Start/Continue', desc = 'Debug: Start/Continue',
}, },
{ {
'<F1>', '<Right>',
function() function()
require('dap').step_into() require('dap').step_into()
end, end,
desc = 'Debug: Step Into', desc = 'Debug: Step Into',
}, },
{ {
'<F2>', '<Down>',
function() function()
require('dap').step_over() require('dap').step_over()
end, end,
desc = 'Debug: Step Over', desc = 'Debug: Step Over',
}, },
{ {
'<F3>', '<Left>',
function() function()
require('dap').step_out() require('dap').step_out()
end, end,
@ -70,7 +60,7 @@ return {
}, },
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
{ {
'<F7>', '<C-Down>',
function() function()
require('dapui').toggle() require('dapui').toggle()
end, end,
@ -82,22 +72,16 @@ return {
local dapui = require 'dapui' local dapui = require 'dapui'
require('mason-nvim-dap').setup { require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true, automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {}, handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = { ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want 'python',
'delve',
}, },
} }
require('dap-python').setup 'uv'
require('dap-python').test_runner = 'pytest'
-- Dap UI setup -- Dap UI setup
-- For more information, see |:help nvim-dap-ui| -- For more information, see |:help nvim-dap-ui|
dapui.setup { dapui.setup {
@ -135,14 +119,5 @@ return {
dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.listeners.before.event_exited['dapui_config'] = dapui.close
-- Install golang specific config
require('dap-go').setup {
delve = {
-- On Windows delve must be run attached or it crashes.
-- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring
detached = vim.fn.has 'win32' == 0,
},
}
end, end,
} }

View File

@ -16,6 +16,8 @@ return { -- Collection of various small independent plugins/modules
-- - sr)' - [S]urround [R]eplace [)] ['] -- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup() require('mini.surround').setup()
require('mini.comment').setup()
-- Simple and easy statusline. -- Simple and easy statusline.
-- You could remove this setup call if you don't like it, -- You could remove this setup call if you don't like it,
-- and try some other statusline plugin -- and try some other statusline plugin

View File

@ -1,3 +1,3 @@
return { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } } return { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = {} }
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et

View File

@ -26,6 +26,8 @@ require('lazy').setup({
require 'kickstart.plugins.indent_line', require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
require 'kickstart.plugins.debug',
}, { }, {
ui = { ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the -- If you are using a Nerd Font: set icons to an empty table which will use the