make jk nav smoother in lazygit

This commit is contained in:
andrzej 2024-05-23 13:21:53 +02:00
parent 8134cf81d5
commit ad078209b6
1 changed files with 18 additions and 0 deletions

View File

@ -12,4 +12,22 @@ return -- nvim v0.8.0
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
}, },
init = function()
--Terminal opt changes (so lazygit is a bit smoother)
local function setTerminalModeVars(on)
vim.opt.timeoutlen = on and 50 or TimeoutlenBeforeTermOpen
end
vim.api.nvim_create_autocmd({ "TermOpen" }, {
callback = function()
--set a global (feels naughty but wth)
TimeoutlenBeforeTermOpen = vim.opt.timeoutlen
setTerminalModeVars(true)
end,
})
vim.api.nvim_create_autocmd({ "TermClose" }, {
callback = function()
setTerminalModeVars(false)
end,
})
end,
} }