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.
Copy this to settings.json then press Shift+Z twice.
"vim.otherModesKeyBindingsNonRecursive": [
{
"before": ["Z", "Z"],
"after": [],
"commands": [
{
"command": "workbench.action.files.save",
"args": []
},
{
"command": "workbench.action.closeActiveEditor",
"args": []
}
]
},
Saves and closes file.
The standard vscode "Save? Yes/No/Cancel" dialog is shown. As if the first command didn't run (or maybe didn't finish?)
Note that unlike #1222, the hotkey half-works (if I then press enter, the file is saved)
Interesting, thanks for the report!
Fixed.
@eddy-geek Can you please re-open this issue? It seems that the ZZ keybinding still executes the two commands asynchronously. But the ZZ keybinding works as expected if I run the latest (96534ba4659cc0fcbde877ee012452c6d8cac23d) extension in debug mode.
I don't see any re-open button, I guess @johnfn would have to do that.
Otherwise I just tested and I can confirm the issue persists, I still see the Save dialog.
Technical details:
Since ZZ is a standard vim command, why isn't it enabled by default in VSCodeVim?
It's my question too. I'm afraid to map this, since you haven't done it yourselves. Is there a reason not to map ZZ to save quit or, even better, just save?
This works: "vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["Z", "Z"],
"commands": [
":wq"
]
}
]
I found it here: https://github.com/VSCodeVim/Vim/#key-remapping
Most helpful comment
I found it here: https://github.com/VSCodeVim/Vim/#key-remapping