In this categoryVS Code Setup ยท 25
- How to Set Up GitHub Copilot in VS CodeStart
- How to Use Copilot Chat and Inline Chat in VS Code
- How to Install and Manage Extensions in VS Code
- How to Install the Continue Extension in VS Code
- How to Install Cline, the Autonomous Coding Agent, in VS Code
- How to Configure Continue with an API Model
- How to Set Up an AI Assistant in VS Code
- How to Run Continue with a Local Model Using Ollama
- How to Run Copilot, Continue, and Cline Together Without Conflicts
- How to Add an MCP Server to Cline
- How to Fix AI Suggestions Not Appearing in VS Code
- How to Install and Trust an AI Extension in VS Code
- How to Install a VS Code Extension from the Command Line
- How to Create a launch.json to Debug a Node.js App in VS Code
- How to Initialize a Git Repository in VS Code
- How to Stage, Commit, and Push Changes from VS Code
- How to Debug a Browser App in VS Code with the Built-in Chrome Debugger
- How to Resolve Git Merge Conflicts in VS Code
- How to Run Build and Dev Commands with tasks.json in VS Code
- How to Add Environment Variables to a VS Code Debug Configuration
How to Create Custom Snippets and Keybindings for AI Workflows
Speed up AI-assisted coding with reusable code snippets and custom keyboard shortcuts for chat and edit actions.
The fastest AI workflow is one where the actions you repeat are a single keystroke away. VS Code lets you define custom code snippets and rebind any command to a shortcut. This guide creates a snippet for a common scaffold and binds the AI chat and edit commands to keys that suit you.
What you need
- VS Code installed
- At least one AI assistant set up, such as Copilot or Continue
- About 6 minutes
Step 1: Open the snippets file
Open the Command Palette with Ctrl+Shift+P or Cmd+Shift+P and run Snippets: Configure Snippets. Pick a language, such as javascript, to open that language's snippet file. Each snippet has a prefix that triggers it, a body, and a description.
Step 2: Write a snippet
Add an entry to the JSON file. The dollar-sign placeholders are tab stops your cursor jumps between. The example creates a quick test scaffold you can flesh out with help from your AI assistant.
{
"Test block": {
"prefix": "tst",
"body": [
"describe(\"$1\", () => {",
" it(\"$2\", () => {",
" $0",
" });",
"});"
],
"description": "Jest describe + it scaffold"
}
}Step 3: Open the keybindings editor
Run Preferences: Open Keyboard Shortcuts from the Command Palette to browse bindings, or Preferences: Open Keyboard Shortcuts (JSON) to edit the raw file. Search for a command like Copilot chat or Continue to find its command id.
Step 4: Bind AI commands to keys
Add bindings to keybindings.json. The example below opens Continue's chat and the Copilot inline chat on shortcuts that are easy to reach. Choose key combinations that are not already taken, or VS Code will warn you of a conflict.
[
{
"key": "ctrl+alt+c",
"command": "continue.focusContinueInput"
},
{
"key": "ctrl+alt+i",
"command": "inlineChat.start"
}
]Result
You can drop in a scaffold with a three letter prefix and open your AI chat or inline edit with one shortcut. The repeated parts of your workflow are now muscle memory, which is where most of the real time savings come from.
Watch related tutorials
19:27
16:00
20:00
1:42:18
28:14
41:09New guides in your inbox
Fresh step-by-step how-to guides as we publish them. One email a week, no more.