visual-studio-codekeymapping

VS Code -- Is there a package that does this?


On emacs, I use an extension/package called key-chord that allows me to hit, for example, "jj" very quickly to execute a command.

Is there an extension or a way VS Code can do this? I use "jj" as a prefix to a keymap where I can than select from a set of sub commands, for exampe, hitting:

jj ss -- save file jj sa -- save all files


Solution

  • The ModalEdit extension for VSCode is what you're looking for: https://johtela.github.io/vscode-modaledit/docs/README.html

    Don't be frightened by the "modal" part in the name which may inspire a vim-only vibe approach. (In which jj is a quite famouse way to escape insert mode by the way).

    The point of this extension is to let you build your own key successions and bind them to editor actions. The documentation has a great tutorial part that will illustrate how to achieve the behavior your describe.