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 {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
@ -22,33 +12,33 @@ return {
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
'leoluz/nvim-dap-go',
'mfussenegger/nvim-dap-python',
},
keys = {
-- Basic debugging keymaps, feel free to change to your liking!
{
'<F5>',
'<Up>',
function()
require('dap').continue()
end,
desc = 'Debug: Start/Continue',
},
{
'<F1>',
'<Right>',
function()
require('dap').step_into()
end,
desc = 'Debug: Step Into',
},
{
'<F2>',
'<Down>',
function()
require('dap').step_over()
end,
desc = 'Debug: Step Over',
},
{
'<F3>',
'<Left>',
function()
require('dap').step_out()
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.
{
'<F7>',
'<C-Down>',
function()
require('dapui').toggle()
end,
@ -82,22 +72,16 @@ return {
local dapui = require 'dapui'
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_installation = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
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 = {
-- Update this to ensure that you have the debuggers for the langs you want
'delve',
'python',
},
}
require('dap-python').setup 'uv'
require('dap-python').test_runner = 'pytest'
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
@ -135,14 +119,5 @@ return {
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['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,
}

View File

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

View File

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