From dec4cabb7575bf7f2a7cb2fa667a7b4def68939e Mon Sep 17 00:00:00 2001 From: Matt Hutton Date: Sun, 18 Feb 2024 18:24:15 +1300 Subject: [PATCH] fix(options): don't lower timeoutlen when in VS Code Avoid lowering timeoutlen when running in VS Code, to avoid unwanted timeouts from key mappings. The lower value of 300ms (down from Neovim's default of 1000ms) works great outside of VS Code, where it helps trigger the which-key UI quickly, and where which-key prevents timeouts from occuring. But in VS Code (where which-key isn't applicable), the lower value makes it difficult to perform some key mappings in time, such as `]p`, which requires shifting hand position. --- lua/lazyvim/config/options.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/config/options.lua b/lua/lazyvim/config/options.lua index 6d9f006b..df259d4c 100644 --- a/lua/lazyvim/config/options.lua +++ b/lua/lazyvim/config/options.lua @@ -49,7 +49,9 @@ opt.splitkeep = "screen" opt.splitright = true -- Put new windows right of current opt.tabstop = 2 -- Number of spaces tabs count for opt.termguicolors = true -- True color support -opt.timeoutlen = 300 +if not vim.g.vscode then + opt.timeoutlen = 300 -- Lower than default (1000) to quickly trigger which-key +end opt.undofile = true opt.undolevels = 10000 opt.updatetime = 200 -- Save swap file and trigger CursorHold