Please _thumbs-up_ 馃憤 this issue if it personally affects you! You can do this by clicking on the emoji-face on the top right of this post. Issues with more thumbs-up will be prioritized.
I type something that opens the autocomplete dropdown (typing the beginning of the name of a known symbol for example). After I stop typing, I press Escape to go back to normal mode.
The editor should change to normal mode.
The escape key closed the autocomplete dropdown, without changing the vim mode. If I want to change to normal mode, I have to press escape twice.
I am not completetely sure if this also happened with 0.2.0, but I don't think so. Because right now many times when I'm trying to change to normal mode and save the file, it types in :w
This is actually on purpose: https://github.com/VSCodeVim/Vim/issues/804
Is there a setting to turn this off?
Or rather: Could you add one?
Yes, that could be done. PRs welcome... 馃槈
I see what I can do once I have time.
Regarding that: Is there a way to use settings from settings.json in conditions in the when part of keybindings?
The current way to set this setting is by putting the following in keybindings.json:
{ "key": "escape", "command": "extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl" }
I've come around. You were right, this is incredibly annoying. If anyone wants the old behavior, they can add the setting. :P
Not working. I've checked the default keybindings.json. The solution above has been set default.
I also checked VSCode documentation. I didn't find inDebugRepl option. Instead, I saw inDebugMode. Tried. Still not working.
I also tried suggestWidgetVisible. Still.
you can try to add this to keybindings.json
{
"key": "escape",
"command": "-extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl"
},
{
"command": "extension.vim_escape",
"key": "escape",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible"
},
@zyujs It works! Thank you! I didn't know that I could put this - in "command".
I believe the API has changed a bit, so what @zyujs suggested didn't work for me. I modified the snippet slightly to get this:
{
"key": "escape",
"command": "-extension.vim_escape",
"when": "editorTextFocus && vim.active && !inDebugRepl"
},
{
"key": "escape",
"command": "extension.vim_escape",
"when": "editorTextFocus && !inDebugRepl && !suggestWidgetVisible"
}
The only slight difference is that you need to include a vim.active in the keybinding removal clause, since the default keybinding file for extension.vim_escape now contains vim.active.
Thank you @mxchai! I had been looking for a way to still exit the search dialog box with escape while using vim.
Most helpful comment
I believe the API has changed a bit, so what @zyujs suggested didn't work for me. I modified the snippet slightly to get this:
The only slight difference is that you need to include a
vim.activein the keybinding removal clause, since the default keybinding file forextension.vim_escapenow containsvim.active.