我使用vim插件,我通常通过按住j来滚动vim。在VSCode中,按住j只做一个j命令,不管它保持了多长时间。

即使在vanilla vscode中,这也不能工作-如果你试图输入###########################的长块作为注释分隔符,这是有问题的。你知道如何启用这个功能吗?


当前回答

操作系统:Mac

要启用重复键,请在终端中执行以下命令并重新启动VS Code:

$ defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false         # For VS Code
$ defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
$ defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false    # For VS Codium
$ defaults delete -g ApplePressAndHoldEnabled                                      # If necessary, reset global default

我们还建议增加系统首选项->键盘中的键重复和延迟直到重复设置。

这都在我们的自述文件https://github.com/VSCodeVim/Vim/blob/master/README.md#mac-setup

其他回答

你在OSX上,对吗?如果是这样的话,问题可能出在苹果的“按住键”(Press&Hold)上,你可以在长按时选择其他字符。

你可以在终端中使用defaults命令禁用这个“特性”:

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

之后你必须重新启动VSCode。

要重新启用先前的行为:

defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool true

VS Code的官方vim-plugin提到了如何在macOS上设置它

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
defaults delete -g ApplePressAndHoldEnabled  # If necessary, reset global default

如果你在mac上使用VSCodium:

默认写com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false

其他针对com.microsoft.VSCode的答案不工作,因为您没有运行MS VSCode。命令default write生成/更新~/Library/Preferences/中附加了.plist的文件,您必须以正确的文件为目标。


我的软件和版本: macOS Mojave 10.14.6 VSCodium 1.41.1 - Vim (vscodevim) 1.12.4与neovim启用 Neovim 0.4.3 Vim 8.1.2250

操作系统:Mac

要启用重复键,请在终端中执行以下命令并重新启动VS Code:

$ defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false         # For VS Code
$ defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider
$ defaults write com.visualstudio.code.oss ApplePressAndHoldEnabled -bool false    # For VS Codium
$ defaults delete -g ApplePressAndHoldEnabled                                      # If necessary, reset global default

我们还建议增加系统首选项->键盘中的键重复和延迟直到重复设置。

这都在我们的自述文件https://github.com/VSCodeVim/Vim/blob/master/README.md#mac-setup

如果你在Mac M1上,我必须做的是运行@NoAppleOnHead说的:

sudo defaults write -g ApplePressAndHoldEnabled -bool false

然后重新启动你的Mac,你应该很好