I've used vscode with the vim plugin for years. All of a sudden I can no longer open files using CTRL+P. Looks like the plug-in intercepts this combination and moves the cursor up instead.
5 Answers
In the settings.json
you can also tweak the vim plugin to ignore some keys:
Set to true
or false
the key combination you would like the vim plugin to react to:
"vim.handleKeys": {
"<C-p>": false
}
It looks like this issue was introduced in v1.26.0 a few days ago. If you don't use Ctrl+P to navigate in the filepicker, you can disable or change the vim shortcut back to the default VSCode behavior, as noted in the issue:
// keybindings.json
{
"key": "ctrl+p",
"command": "workbench.action.quickOpen"
}
-
5This seems to be the preferred solution in the issue thread: github.com/VSCodeVim/Vim/issues/8574#issuecomment-1715573738 Adding the referenced code to my 'settings.json' (Shift-Ctrl-P --> Preferences: Open User Settings (JSON)) fixes the issue for me. Commented Sep 14, 2023 at 8:15
The easier thing to do is to use ctrl+shift+p
(which still works) and then delete the '>
' that appears in the search box. This turns the box into the file picker.
I used this way
ctrl + shift + e // switch to explorer
ctrl + p // find something
ctrl + shift + e // back to workspace
In the latest version you can search for vim ctrl
in the settings menu ctrl + ,
to toggle this sort of overriding on/off:
"Vim: Use Ctrl Keys Enable some Vim Ctrl key commands that override otherwise common operations, like Ctrl+C."
:help nvim-from-vim
. What made me switch was all the inconsistencies with the emulator and using vim-surround with functions :)