GitHub Copilot Shortcuts #
Description #
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.
Example #
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:
TABkey - Reject suggestion:
Esckey - Show combined suggestions:
Ctrl+Enterkey - Accept at word level:
Ctrl+Right Arrowkey - See next suggestion:
Alt+]key - See previous suggestion:
Alt+[key - Trigger inline suggestion:
Alt+/key - Show Labs feature list:
Ctrl+Shift+Alt+ekey - Toggle sidebar:
Ctrl+Shift+akey
Exercise #
- 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
Ctrl+Enterkey to see combined suggestions. Explore them and identify a useful one. - Exercise 4: Navigate through the suggestions using
Alt+]andAlt+[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?