various debug keymap changes

This commit is contained in:
Markus Dieckmann 2023-04-15 15:36:44 +02:00
parent 16e2ddfe94
commit f5378b619b
2 changed files with 29 additions and 24 deletions

View File

@ -1,4 +1,3 @@
function map(mode, shortcut, command) function map(mode, shortcut, command)
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true }) vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
end end
@ -14,6 +13,7 @@ end
function vmap(shortcut, command) function vmap(shortcut, command)
map('v', shortcut, command) map('v', shortcut, command)
end end
function xmap(shortcut, command) function xmap(shortcut, command)
map('x', shortcut, command) map('x', shortcut, command)
end end
@ -51,4 +51,8 @@ nmap("<F12>",":lua require'dap'.step_out()<CR>")
nmap("<leader>B", ":lua require'dap'.toggle_breakpoint()<CR>") nmap("<leader>B", ":lua require'dap'.toggle_breakpoint()<CR>")
nmap("<leader>Bc", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>") nmap("<leader>Bc", ":lua require'dap'.set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>")
nmap("<leader>lp", ":lua require'dap'.set_breakpoint(nil,nil,vim.fn.input('Log point message: '))<CR>") nmap("<leader>lp", ":lua require'dap'.set_breakpoint(nil,nil,vim.fn.input('Log point message: '))<CR>")
nmap("<leader>lp",":lua require'dap'.repl.open()<CR>") nmap("<leader>lR", ":lua require'dap'.repl.open()<CR>")
nmap("<leader>dK", ":lua require'dap.ui.widgets'.hover()<CR>")
nmap("<leader>dh", ":lua require'dap.ui.variables'.visual_hover()<CR>")
nmap("<leader>d?", ":lua require'dap.ui.variables'.scopes()<CR>")
nmap("<leader>da", ":lua require'debugHelper'.attach()<CR>")

View File

@ -1,9 +1,10 @@
-- Mappings. -- Mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
local goErrorOpts = { severity = vim.diagnostic.severity.ERROR, noremap = true, silent = true }
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', 'gE', ':lua vim.diagnostic.goto_prev({severity = vim.diagnostic.severity.ERROR})<cr>', opts)
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) vim.keymap.set('n', 'ge', ':lua vim.diagnostic.goto_next({severity = vim.diagnostic.severity.ERROR})<cr>', opts)
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys