My VSCode Vim settings

  1. User Settings > Key Bindings
  2. Code command
  3. Key Repeat on Mac

User Settings > Key Bindings

Step: Find”Preferences: Open User Settings (JSON)

  • (Shift + Command + P) opens the command palette

Explanation:

  • Insert mode:
    • Map jj or fd to <Esc>
  • Normal mode:
    • Map j to gj and k to gk so moving across folds doesn’t unfold.
JSON
{   
    "vim.insertModeKeyBindings": [
        {
            "before": ["f", "d"],
            "after": ["<Esc>"]
        }
    ],
    "vim.normalModeKeyBindings": [
        {
            "before": ["j"],
            "after": ["g", "j"]
        },
        {
            "before": ["k"],
            "after": ["g", "k"]
        }
    ],
}

Code command

Do this in the command palette by typing “shell command”

Key Repeat on Mac

Different installations use different commands (github)

Bash
# For VS Code
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false