Add nvim-dap & nvim-dap-view

Also don't enter insert mode when launching a debug session.
This commit is contained in:
2025-12-04 21:05:24 +00:00
parent 44199d81b4
commit 144d2b11cf
2 changed files with 67 additions and 3 deletions

View File

@@ -25,10 +25,17 @@ vim.api.nvim_create_autocmd('BufRead', {
-- Start terminals in insert mode
vim.api.nvim_create_autocmd('TermOpen', {
group = group, pattern = 'term://*',
callback = function()
group = group,
pattern = 'term://*',
callback = function(args)
-- nvim-dap/nvim-dap-view uses terminal buffers in the background which are
-- not visible, don't start insert mode if the dap-type variable exists.
local success, dap_type = pcall(vim.api.nvim_buf_get_var, args.buf, 'dap-type')
if success and dap_type then
return
end
vim.cmd.startinsert()
end
end,
})
-- Automatically press enter when the terminal process exit successfully