Add nvim-dap & nvim-dap-view
Also don't enter insert mode when launching a debug session.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user