1

I start using the VSCodeVim plugin in VS Code.

I regularly save my file with Cmd-S (in Mac).

Following the philosophy of Practical Vim book, I consider this save point moment as a break in my thinking process. It would be cool if when I type Cmd-S, Vim returns in Normal mode.

Is there a way ?

romainl
  • 186,200
  • 21
  • 280
  • 313
pom421
  • 1,731
  • 19
  • 38

1 Answers1

1

I found a solution.

In keybindings.json, add :

  {
    "key": "cmd+s",
    "command": "extension.multiCommand.execute",
    "args": {
      "sequence": [
        "workbench.action.files.save",
        "extension.vim_escape"
      ]
    },
    "when": "editorTextFocus && vim.active && vim.mode != 'Normal'"
  }

We need to add an extra extension, because VS Code doesn't handle internally to trigger multiple commands. So add multi-command extension.

pom421
  • 1,731
  • 19
  • 38