GitHub Copilot - Patterns & Exercises
GitHub 🌟
en 🇬🇧
en 🇬🇧
  • Introduction
  • Contributing to the Project
  • General
    • Code completion
    • Comment to code
    • Code to comment
    • Quick Q&A
    • Regular expression
    • Language translation
    • Type hinting
    • Code to document
    • Object generation from structured data
    • Showing examples
  • Client Side Tips
    • Copilot snnipet handling
    • GitHub Copilot Shortcuts
    • Go to definition
    • Pin the files you need
  • Design Patterns
    • AI readable naming convention
    • Consistent coding style
    • High-level architecture first
    • Working on small chunks
    • Context-less Architecture
    • Eliminating a tiny OSS dependency
  • Collaboration
    • AI friendly documentation
    • Coaching on prompts
  • Test
    • Creating unit tests
    • Specify how to generate test code
    • Writing failure case first
    • Writing test cases in natural language first
    • Test only what is necessary
  • Refactoring
    • Writing test code before refactoring
    • Making the calculation part independent
    • Asking with open-ended questions
  • Archived
    • GitHub Copilot Patterns & Exercises Guide
    • Translations
      • German 🇩🇪
      • Spanish 🇪🇸
      • French 🇫🇷
      • Italy 🇮🇹
      • Japanese 🇯🇵
      • Portuguese 🇵🇹
      • Chinese 🇨🇳
Powered by GitBook
On this page
  • Description
  • Example
  • Exercise
  • Checklist for Further Learning
Edit on GitHub
  1. Client Side Tips

GitHub Copilot Shortcuts

Learning Shortcuts to rapidly develop your code

Last updated 1 year ago

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: TAB key

  • Reject suggestion: Esc key

  • Show combined suggestions: Ctrl + Enter key

  • Accept at word level: Ctrl + Right Arrow key

  • See next suggestion: Alt + ] key

  • See previous suggestion: Alt + [ key

  • Trigger inline suggestion: Alt + / key

  • Show Labs feature list: Ctrl + Shift + Alt + e key

  • Toggle sidebar: Ctrl + Shift+a key

Exercise

  • Exercise 1: Try using the TAB key to accept a Copilot suggestion in your current project. How does it feel?

  • Exercise 2: Press Esc key to reject a suggestion. What happens?

  • Exercise 3: Use Ctrl + Enter key to see combined suggestions. Explore them and identify a useful one.

  • Exercise 4: Navigate through the suggestions using Alt + ] and Alt + [ 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?