nixos-config/home-manager/neovim/dap.lua

35 lines
1.2 KiB
Lua

local dap, dapui = require("dap"), require("dapui")
dapui.setup()
vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" })
-- debugging keymaps
vim.keymap.set("n", "<F5>", dap.continue, { noremap = true, silent = true })
vim.keymap.set("n", "<F9>", dap.toggle_breakpoint, { noremap = true, silent = true })
vim.keymap.set("n", "<F10>", dap.step_over, { noremap = true, silent = true })
vim.keymap.set("n", "<F11>", dap.step_into, { noremap = true, silent = true })
vim.keymap.set("n", "<S-F11>", dap.step_out, { noremap = true, silent = true })
vim.keymap.set("n", "<F23>", dap.step_out, { noremap = true, silent = true }) -- <Shift-F11> in kitty
vim.keymap.set("n", "<M-k>", dapui.eval, { noremap = true, silent = true })
-- trigger auto-completion in repl
vim.cmd([[
augroup TriggerDapReplAutoCompletion
autocmd!
autocmd FileType dap-repl lua require("dap.ext.autocompl").attach()
augroup END
]])
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open()
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close()
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close()
end