GitHub Copilot Shortcuts #
GitHub Copilot provides developers with a set of keyboard shortcuts to accelerate the coding process. These shortcuts make the navigation and interaction with GitHub Copilot’s AI-driven suggestions more intuitive and efficient. In this pattern, we will explore the keyboard shortcuts that are essential for rapid code development with Copilot.
For example, to accept a suggestion from Copilot, you can simply press the
TAB key. Here’s a list of some key shortcuts:
- Accept suggestion:
- Reject suggestion:
- Show combined suggestions:
- Accept at word level:
- See next suggestion:
- See previous suggestion:
- Trigger inline suggestion:
- Show Labs feature list:
- Toggle sidebar:
- Exercise 1: Try using the
TABkey to accept a Copilot suggestion in your current project. How does it feel?
- Exercise 2: Press
Esckey to reject a suggestion. What happens?
- Exercise 3: Use
Enterkey to see combined suggestions. Explore them and identify a useful one.
- Exercise 4: Navigate through the suggestions using
[keys. How does it affect your code selection process?
- Exercise 5: Experiment with the other shortcuts listed above and describe your experience with each of them.
Checklist for Further Learning #
- Have I internalized the shortcuts for accepting and rejecting Copilot suggestions?
- Am I comfortable using shortcuts to navigate through multiple suggestions?
- What other shortcuts within VSCode can enhance my coding experience with Copilot?
- How can I customize the shortcuts to suit my personal coding workflow?
- Could the use of these shortcuts help me in other coding environments or only in Visual Studio Code with Copilot?