diff options
author | Damjan 9000 <damjan.9000@gmail.com> | 2024-07-22 20:25:55 +0200 |
---|---|---|
committer | Damjan 9000 <damjan.9000@gmail.com> | 2024-07-22 20:25:55 +0200 |
commit | e1d6094136efb6f0c1f5a9f303fb8cbbe32b5976 (patch) | |
tree | 76ca861005d8c361e86696cd7cc0870fb5cd2178 /lua/kickstart/plugins/debug.lua | |
parent | a6442e80813b40238066676b7ac97951c1bd1822 (diff) | |
parent | 56b9114bf29cdc0c0f5de78b5deae1fe0ab65db1 (diff) |
Merge 'upstream' Neovim 0.10 updates and more
Merged commits from upstream:
Update comment about the toggle inlay hints keymap
lint: fix lsp warning in `vim.lsp.inlay_hint.is_enabled`
Update lazydev config to fix "Undefined field `fs_stat`" LSP error
Neovim 0.10 updates
Fix comment about mini.ai example
Make conform.nvim be lazy-loadable again
Update README.md | %userprofile%\appdata\local -> %localappdata%
Make debug lazy loadable
Remove redundant require
Fix neo-tree keymap description
fix: add required parsers from nvim-treesitter
Diffstat (limited to 'lua/kickstart/plugins/debug.lua')
-rw-r--r-- | lua/kickstart/plugins/debug.lua | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 31dfecf..196f2c6 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,6 +24,28 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', }, + keys = function(_, keys) + local dap = require 'dap' + local dapui = require 'dapui' + return { + -- Basic debugging keymaps, feel free to change to your liking! + { '<F5>', dap.continue, desc = 'Debug: Start/Continue' }, + { '<F1>', dap.step_into, desc = 'Debug: Step Into' }, + { '<F2>', dap.step_over, desc = 'Debug: Step Over' }, + { '<F3>', dap.step_out, desc = 'Debug: Step Out' }, + { '<leader>b', dap.toggle_breakpoint, desc = 'Debug: Toggle Breakpoint' }, + { + '<leader>B', + function() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, + desc = 'Debug: Set Breakpoint', + }, + -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. + { '<F7>', dapui.toggle, desc = 'Debug: See last session result.' }, + unpack(keys), + } + end, config = function() local dap = require 'dap' local dapui = require 'dapui' @@ -45,16 +67,6 @@ return { }, } - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '<F5>', dap.continue, { desc = 'Debug: Start/Continue' }) - vim.keymap.set('n', '<F1>', dap.step_into, { desc = 'Debug: Step Into' }) - vim.keymap.set('n', '<F2>', dap.step_over, { desc = 'Debug: Step Over' }) - vim.keymap.set('n', '<F3>', dap.step_out, { desc = 'Debug: Step Out' }) - vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) - vim.keymap.set('n', '<leader>B', function() - dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end, { desc = 'Debug: Set Breakpoint' }) - -- Dap UI setup -- For more information, see |:help nvim-dap-ui| dapui.setup { @@ -77,9 +89,6 @@ return { }, } - -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception. - vim.keymap.set('n', '<F7>', dapui.toggle, { desc = 'Debug: See last session result.' }) - 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 |