I use VSCode with the VSCodeVim extension. When in Insert Mode, I can press "CMD-S" to save. When I do, I would also like to exit Insert Mode automatically instead of pressing "ESC" as well.
Is this possible?
I was looking for a solution similar to this issue as well.
It appears that multiple commands cannot be mapped to key bindings in vscode; however, I've found an extension, macros, that let's you do this.
If you use the below steps with the macros extension, I believe that you'll have the solution you're looking for, until vscode implements something to address this feature request.
Step one, edit user settings with the below:
"macros": {
"saveAndExitVimInsertMode": [
"workbench.action.files.save",
"extension.vim_escape"
]
}
Step two, edit keyboard bindings:
{
"key": "cmd+s",
"command": "macros.saveAndExitVimInsertMode"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With