timeouts better

This commit is contained in:
Christoph J. Scherr 2024-03-13 12:27:36 +01:00
parent 069751a488
commit 9c176e33cf
Signed by: cscherrNT
GPG Key ID: 8E2B45BC51A27EA7
2 changed files with 29 additions and 2 deletions

View File

@ -30,10 +30,16 @@ opt.shiftround = true -- Round indent to multiple of 'shiftwidth'
-- Timing -- Timing
-- === -- ===
-- NOTE: the which-key plugin makes this a little different. Instead of going
-- to a newline after "o", the which-key panel opens. Only when we input
-- something other than "o" it will go to the line and write that. I don't
-- really like this behavior. We can disable this for specific triggers.
-- See https://github.com/folke/which-key.nvim
opt.timeout = true
opt.ttimeout = true opt.ttimeout = true
opt.timeoutlen = 500 -- Time out on mappings opt.timeoutlen = 250 -- Time out on mappings
opt.ttimeoutlen = 10 -- Time out on key codes opt.ttimeoutlen = 10 -- Time out on key codes
opt.updatetime = 500 -- Idle time to write swap and trigger CursorHold opt.updatetime = 300 -- Idle time to write swap and trigger CursorHold
-- Searching -- Searching
-- === -- ===

View File

@ -101,6 +101,27 @@ local plugins = {
["<leader>w"] = { name = "+window/which" }, ["<leader>w"] = { name = "+window/which" },
["<leader>f"] = { name = "+formatting" }, ["<leader>f"] = { name = "+formatting" },
}, },
opts = {
triggers_nowait = {
-- marks
"`",
"'",
"g`",
"g'",
-- registers
'"',
"<c-r>",
-- spelling
"z=",
},
triggers_blacklist = {
-- list of mode / prefixes that should never be hooked by WhichKey
-- this is mostly relevant for keymaps that start with a native binding
i = { "j", "k" },
v = { "j", "k" },
n = { "o", "O" },
},
},
}, },
{ {
"echasnovski/mini.trailspace", "echasnovski/mini.trailspace",