VS Code Shortcuts to Deploy LWC, Apex, Triggers & Everything

Shortcuts to deploy Salesforce metadata in VS Code

Tip: Edit your keybindings.json file with JSON code given below and your shortcuts will be ready. 

Steps to Open keybindings.json:

  1. Open VS Code
  2. Press Ctrl + Shift + P
  3. Open Keyboard Shortcuts (JSON) / keybindings.json
  4. Replace the file with following JSON code
[
  {
    "key": "ctrl+d",
    // "command": "sfdx.force.source.deploy.source.path"
    // replace sf with sfdx if you have latest sfdx version
    "command": "sf.deploy.current.source.file"
  },
  {
    "key": "alt+s alt+o",
    "command": "sfdx.force.org.open"
  },
  {
    "key": "alt+r",
    "command": "sfdx.force.source.retrieve.source.path"
  },
  {
    "key": "alt+s alt+t",
    "command": "sfdx.force.apex.test.last.method.run"
  },
  {
    "key": "alt+s alt+r",
    "command": "sfdx.force.source.retrieve.in.manifest"
  },
  {
    "key": "alt+s alt+.",
    "command": "sfdx.force.source.deploy.in.manifest"
  }
]

What shortcuts we have added:

  • ctrl+d: Deploy any type of salesforce components 
  • alt+s alt+o: Open org
  • alt + r: Retrieve current open file mdt
  • alt+s alt+r: Retrieve in manifest
  • alt+s alt+.: Deploy files added in manifest

Note: If you are using latest version of sfdx then replace all sfdx with sf. 

sfdx is being deprecated, sf is the replacement.

Our recent posts

Leave a Reply