Vim: ZZ example on the main page does not save in 1.10.2

Created on 13 Mar 2017  路  8Comments  路  Source: VSCodeVim/Vim

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.


What did you do?

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": []
                }
            ]
        },

What did you expect to happen?

Saves and closes file.

What happened instead?

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)

Technical details:

  • VSCode Version: 1.10.2
  • VsCodeVim Version: 0.6.5 latest
  • OS: Linux (Fedora latest)

Most helpful comment

I found it here: https://github.com/VSCodeVim/Vim/#key-remapping

All 8 comments

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.

Technical details:

  • VSCode Version: 1.15.1
  • VSCodeVim Version: 0.10.0
  • OS: macOS Sierra 10.12.6

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:

  • VSCode Version: 1.15.1
  • VSCodeVim Version: 0.10.0
  • OS: Linux Fedora 26

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajinder-yadav picture rajinder-yadav  路  3Comments

WangRongda picture WangRongda  路  3Comments

cckowin picture cckowin  路  3Comments

ghost picture ghost  路  3Comments

typeoneerror picture typeoneerror  路  3Comments