Skip to content

Instantly share code, notes, and snippets.

@edtsech
Created July 3, 2019 20:02
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edtsech/17e3a10bf18a32e800dfe5429de13188 to your computer and use it in GitHub Desktop.
Save edtsech/17e3a10bf18a32e800dfe5429de13188 to your computer and use it in GitHub Desktop.
VSCode: Exit Vim Insert Mode on File Save

VSCode: Exit Vim Insert Mode on File Save

Tips are borrowed from https://stackoverflow.com/questions/49050087/in-vscode-exit-vim-insert-mode-on-save

  1. I assume you're already using VSCodeVim package right? https://github.com/VSCodeVim/Vim
  2. Install macros package https://github.com/geddski/macros
  3. Modify settings.json by opening "Preferences: Open settings (JSON)" check settings.json file in this gist
  4. Modify keybindings.json by opening "Preferences: Open Keyboard Shortcuts (JSON)" check keybindings.json file in this gist
[
{
"key": "cmd+s",
"command": "macros.saveAndExitVimInsertMode"
}
]
{
"macros": {
"saveAndExitVimInsertMode": [
"workbench.action.files.save",
"extension.vim_escape"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment