nvim-config/lua/plugins/config/debug/keymaps.lua
dlond f81cab2da3 refactor: Complete modular migration from kickstart.nvim
Major architectural overhaul to transform the flat kickstart.nvim structure
  into a maintainable, modular configuration while preserving upstream sync capability.

  ## Structure Changes
  - Migrated from flat `lua/custom/` to organized `lua/core/` and `lua/plugins/`
  - Separated plugin specs from configs: `lua/plugins/spec/` and `lua/plugins/config/`
  - Complex configs (LSP, Debug) now use directory structure with sub-modules:
    - `lsp/init.lua`, `lsp/servers.lua`, `lsp/keymaps.lua`
    - `debug/init.lua`, `debug/adapters.lua`, `debug/keymaps.lua`

  ## Core Improvements
  - Created dedicated core modules: options, keymaps, autocmds, bootstrap, health
  - Added comprehensive health check (`lua/core/health.lua`) for diagnostics
  - Simplified init.lua to just orchestrate module loading
  - Better separation of concerns throughout

  ## Plugin Updates
  - Fixed Blink.cmp configuration (removed invalid fuzzy options)
  - Integrated Copilot with Blink.cmp for unified completion experience
  - Added autopairs and indent-line from kickstart examples
  - Optimized for Nix development environments (removed venv assumptions)

  ## Documentation
  - Updated README with modular structure and kickstart sync instructions
  - Created comprehensive KEYBIND_ANALYSIS.md with all mappings
  - Added modular.txt help documentation
  - Created TODO_TEST.md checklist for testing

  ## Benefits
  - Easier to maintain and extend
  - Clean separation allows upstream kickstart merges without conflicts
  - Scalable architecture for adding new languages/tools
  - Better code organization and discoverability

  All kickstart functionality preserved while gaining modularity and maintainability.
2025-09-02 13:23:53 +12:00

59 lines
No EOL
2.7 KiB
Lua

-- Debug Keymaps Configuration
local M = {}
function M.setup()
local dap = require('dap')
local dapui = require('dapui')
-- Function key mappings for common debug operations
vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' })
vim.keymap.set('n', '<F10>', dap.step_over, { desc = 'Debug: Step Over' })
vim.keymap.set('n', '<F11>', dap.step_into, { desc = 'Debug: Step Into' })
vim.keymap.set('n', '<F12>', dap.step_out, { desc = 'Debug: Step Out' })
-- Breakpoint management
vim.keymap.set('n', '<leader>db', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' })
vim.keymap.set('n', '<leader>dB', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end, { desc = 'Debug: Set Conditional Breakpoint' })
vim.keymap.set('n', '<leader>lp', function()
dap.set_breakpoint(nil, nil, vim.fn.input('Log point message: '))
end, { desc = 'Debug: Set Log Point' })
-- DAP UI controls
vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: Toggle UI' })
vim.keymap.set('n', '<leader>de', dapui.eval, { desc = 'Debug: Eval under cursor' })
vim.keymap.set('v', '<leader>de', dapui.eval, { desc = 'Debug: Eval selection' })
-- REPL and additional features
vim.keymap.set('n', '<leader>dr', dap.repl.open, { desc = 'Debug: Open REPL' })
vim.keymap.set('n', '<leader>dl', dap.run_last, { desc = 'Debug: Run Last' })
-- Widget-based inspections
vim.keymap.set('n', '<leader>dh', function()
require('dap.ui.widgets').hover()
end, { desc = 'Debug: Hover Variables' })
vim.keymap.set('n', '<leader>ds', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.scopes)
end, { desc = 'Debug: View Scopes' })
vim.keymap.set('n', '<leader>df', function()
local widgets = require('dap.ui.widgets')
widgets.centered_float(widgets.frames)
end, { desc = 'Debug: View Frames' })
-- Session management
vim.keymap.set('n', '<leader>dt', dap.terminate, { desc = 'Debug: Terminate Session' })
vim.keymap.set('n', '<leader>dc', dap.run_to_cursor, { desc = 'Debug: Continue to Cursor' })
-- Create visual indicators for breakpoints
vim.fn.sign_define('DapBreakpoint', { text = '🔴', texthl = 'DapBreakpoint', linehl = '', numhl = '' })
vim.fn.sign_define('DapBreakpointCondition', { text = '🟡', texthl = 'DapBreakpoint', linehl = '', numhl = '' })
vim.fn.sign_define('DapBreakpointRejected', { text = '', texthl = 'DapBreakpoint', linehl = '', numhl = '' })
vim.fn.sign_define('DapLogPoint', { text = '📝', texthl = 'DapLogPoint', linehl = '', numhl = '' })
vim.fn.sign_define('DapStopped', { text = '▶️', texthl = 'DapStopped', linehl = 'DapStopped', numhl = 'DapStopped' })
end
return M