updates
This commit is contained in:
@@ -63,3 +63,28 @@ vim.cmd([[
|
||||
-- end
|
||||
-- end
|
||||
-- })
|
||||
|
||||
local function set_timeoutlen_for_insert_mode()
|
||||
if vim.bo.buftype == "terminal" or vim.bo.filetype == "codecompanion" then
|
||||
vim.o.timeoutlen = 0
|
||||
else
|
||||
vim.o.timeoutlen = 300 -- Default timeoutlen for other buffers
|
||||
end
|
||||
end
|
||||
|
||||
-- Create an augroup for managing the autocmds
|
||||
local augroup = vim.api.nvim_create_augroup("InsertModeTimeout", { clear = true })
|
||||
|
||||
-- Autocommand to adjust timeoutlen when entering insert mode
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
group = augroup,
|
||||
callback = set_timeoutlen_for_insert_mode,
|
||||
})
|
||||
|
||||
-- Autocommand to reset timeoutlen when leaving insert mode
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
group = augroup,
|
||||
callback = function()
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user