From 29ed06e0007d645d7c26b22df1346150b8e28b7f Mon Sep 17 00:00:00 2001 From: mbhutton Date: Thu, 7 Mar 2024 23:39:57 +1300 Subject: [PATCH] fix(options): don't lower timeoutlen when in VS Code (#2568) 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