How to configure custom keyboard shortcuts on GitHub Copilot
Configure custom keyboard shortcuts for GitHub Copilot by accessing VS Code's Keyboard Shortcuts settings and modifying the Copilot-specific commands. You can customize shortcuts for accepting suggestions, cycling through options, and triggering inline completions.
Prerequisites
- GitHub Copilot extension installed in VS Code
- Active GitHub Copilot subscription
- VS Code version 1.60 or higher
- Basic knowledge of VS Code settings
Step-by-Step Instructions
Open Keyboard Shortcuts Settings
Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (Mac) to open the Keyboard Shortcuts editor. Alternatively, go to File > Preferences > Keyboard Shortcuts or use Code > Preferences > Keyboard Shortcuts on Mac.Search for Copilot Commands
copilot to filter and display all GitHub Copilot-related commands. You'll see commands like github.copilot.acceptCursorPanelSuggestion, github.copilot.generate, and editor.action.inlineSuggest.commit.Modify Accept Suggestion Shortcut
Ctrl+Space or Alt+Enter. Press Enter to confirm the new shortcut.Configure Cycle Through Suggestions
Alt+] for next suggestion and Alt+[ for previous suggestion. Confirm each assignment by pressing Enter.Set Trigger Suggestions Shortcut
Ctrl+Alt+Space. This is useful when automatic suggestions are disabled or when you want to force suggestions in specific contexts.Configure Dismiss Suggestions
Escape or Ctrl+D. Click the pencil icon, enter your preferred key combination, and press Enter to save.Test Your Custom Shortcuts
Export and Backup Settings
Common Issues & Troubleshooting
Custom shortcut not working or being ignored
Check for conflicts by searching for your key combination in the Keyboard Shortcuts editor. Remove conflicting assignments or choose a different key combination. Also ensure the GitHub Copilot extension is active and enabled.
Copilot commands not appearing in Keyboard Shortcuts list
Verify that the GitHub Copilot extension is properly installed and enabled. Restart VS Code and check if your Copilot subscription is active. Update the extension to the latest version if needed.
Shortcuts work inconsistently across different file types
Check the When column in Keyboard Shortcuts editor for context-specific bindings. Some shortcuts may be limited to specific editor contexts. Modify the context or create additional bindings for different file types.
Unable to assign certain key combinations
Some key combinations are reserved by the operating system or VS Code core functions. Try alternative combinations or check VS Code's documentation for restricted shortcuts. Use Ctrl+K Ctrl+S to see all existing assignments.