> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Wins for Immediate Productivity Gains

> Tips to improve GitHub Copilot productivity through repository instructions, editor versus chat usage, Completions panel, keyboard shortcuts, and model and context selection

Boost your GitHub Copilot productivity with a few focused configurations and workflows you can apply immediately. This guide covers repository-level instructions, comparing editor vs. chat behavior, using the Completions panel, keyboard shortcuts, and choosing models and context for better suggestions.

Quick reference

| Tip                                   | Why it helps                                                 | Example / Link                                                                                                        |
| ------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| Repository-level Copilot instructions | Ensures project-specific style and constraints are respected | Add `.github/copilot-instructions.md`                                                                                 |
| Editor vs. Copilot Chat               | Chat often produces fuller, annotated implementations        | [Copilot Chat docs](https://docs.github.com/en/copilot/getting-started-with-github-copilot/about-github-copilot-chat) |
| Completions panel                     | Compare multiple variants before accepting                   | Use the Completions panel in the Copilot UI                                                                           |
| Keyboard shortcuts                    | Accept suggestions faster and stay in flow                   | Configure in VS Code Keybindings                                                                                      |
| Model & context selection             | Different models & focused files give better results         | Switch models inside Copilot Chat and close irrelevant files                                                          |

## 1) Add a repository-level Copilot instruction file

Place project-specific guidance where Copilot will read it automatically: create a Markdown file in the repository's `.github/` folder named `copilot-instructions.md` (or create a Markdown file titled "Copilot Instructions" inside `.github`). Use this file to state coding standards, preferred patterns, and generation preferences so Copilot generates code aligned with your project.

Example: create the `.github` directory

```bash theme={null}
(venv) jeremy@Jeremys-Mac-Studio FakeDataGenerator % mkdir .github
(venv) jeremy@Jeremys-Mac-Studio FakeDataGenerator %
```

Then add `.github/copilot-instructions.md` with your project's conventions — formatting, naming, import ordering, docstring expectations, and any edge-case guidance.

<Callout icon="lightbulb" color="#1CB2FE">
  Name the file `.github/copilot-instructions.md` and commit it to the repository so Copilot can discover and apply it automatically.
</Callout>

Example PEP 8-focused `copilot-instructions.md` (practical starting point)

```markdown theme={null}
## Purpose
Provide instructions for GitHub Copilot to generate PEP8-compliant Python code: readable, documented, and consistent.

## General Guidelines
1. Follow the [PEP 8](https://peps.python.org/pep-0008/) style guide.
2. Use 4 spaces per indentation level.
3. Keep lines <= 79 characters when possible.
4. Include docstrings for classes, methods, and public functions.
5. Avoid trailing whitespace.

## Naming Conventions
- Use `snake_case` for variables and functions.
- Use `PascalCase` for class names.
- Constants in `ALL_CAPS`.

## Imports
- Place imports at the top of the file.
- Group imports: standard library, third-party, local.
- One import per line; avoid wildcards.
```

You can make this stricter (for CI or linters) or lighter (for rapid prototyping) depending on team needs.

## 2) Test how Copilot responds: editor inline suggestions vs. Copilot Chat

Copilot behaves differently depending on how you prompt it:

* Inline (editor) suggestions often aim for brevity and fast completion. They are great for small, routine edits.
* Copilot Chat usually produces more thorough results — typed signatures, docstrings, and explanatory comments — especially when you provide a detailed prompt or reference the repository instruction file.

Example: minimal inline suggestion (editor)

```python theme={null}
# function to calculate the sum of two integers
def add(a, b):
    return a + b  # return the sum of a and b

# function to calculate the difference of two integers
def subtract(a, b):
    return a - b  # return the difference of a and b
```

Example: Chat-generated, PEP 8-aligned implementation

```python theme={null}
def calculate_sum(a: int, b: int) -> int:
    """
    Calculate the sum of two integers.

    Args:
        a (int): First number.
        b (int): Second number.

    Returns:
        int: Sum of the two numbers.
    """
    return a + b
```

If inline suggestions remain minimal even with an instruction file in place:

* Try the same prompt in Copilot Chat — it often respects repository-level guidance more fully.
* Make inline prompts slightly more explicit (add a short comment specifying style or types).

Resources:

* [Copilot Chat overview](https://docs.github.com/en/copilot/getting-started-with-github-copilot/about-github-copilot-chat)

## 3) Use the Completions panel to compare suggestions

The Completions panel displays multiple alternative implementations. Use it to compare different approaches (concise vs. documented, typed vs. untyped), then accept the variant that best matches your codebase.

Workflow:

1. Open the Completions panel in the Copilot UI.
2. Page through suggestions to review variations.
3. Accept the suggestion that fits style, performance, or readability goals — you can also edit the accepted suggestion afterward.

Example prompt: "Create square of a number"

One suggested completion:

```python theme={null}
def square_number(num: int) -> int:
    """
    Calculate the square of a number.

    Args:
        num (int): Number to find the square of.

    Returns:
        int: Square of the number.
    """
    return num * num
```

Comparing several of these helps you pick the best fit without losing context.

## 4) Keyboard shortcuts and keybindings

Speed up acceptance and navigation by learning or customizing a few keybindings. VS Code lets you view and remap Copilot-related shortcuts from the Keyboard Shortcuts panel.

Common actions you may want shortcuts for:

* Open Copilot Chat
* Toggle Copilot inline suggestions
* Open the Completions panel
* Accept the current suggestion
* Cycle through alternative suggestions

Open and customize shortcuts:

* In VS Code: File > Preferences > Keyboard Shortcuts (or press `Ctrl+K Ctrl+S` / `Cmd+K Cmd+S`)
* See Copilot command names in the Keyboard Shortcuts UI

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/DEYrDKSldd3lYPoS/images/GitHub-Copilot-in-Action/Core-Features/Quick-Wins-for-Immediate-Productivity-Gains/vscode-keyboard-shortcuts-copilot-edits.jpg?fit=max&auto=format&n=DEYrDKSldd3lYPoS&q=85&s=41f66b4c883ef89e891f196412f79166" alt="A screenshot of Visual Studio Code's Keyboard Shortcuts panel filtered for &#x22;copilot,&#x22; showing a list of GitHub Copilot commands, keybindings, conditions and sources. The &#x22;Chat: Open Copilot Edits&#x22; entry is highlighted with a mouse cursor over a keybinding." width="1920" height="1080" data-path="images/GitHub-Copilot-in-Action/Core-Features/Quick-Wins-for-Immediate-Productivity-Gains/vscode-keyboard-shortcuts-copilot-edits.jpg" />
</Frame>

Memorize or remap the few shortcuts you use most; this reduces context switching and speeds up acceptance.

## 5) Model selection and context windows

Model choice and the editor context you expose both affect suggestion quality:

* Inside Copilot Chat you can select different underlying models (e.g., GPT-4o or other code-optimized models). Test models on representative tasks and keep the one that balances accuracy, conciseness, and code quality for your workflows.
* Limit the number of open files/tabs to the modules relevant to the task. Copilot's context window is finite — opening too many unrelated files can dilute suggestion relevance.

<Callout icon="warning" color="#FF6B6B">
  Avoid opening too many files at once: Copilot has a limited context window. Close unrelated tabs to improve suggestion relevance for the code you're actively editing.
</Callout>

Practical tips:

* Focus on the directory or package you are editing (e.g., database layers and config when making DB changes).
* If suggestions degrade, close non-essential tabs and re-run generation.

## Next steps: comment-driven development and a sample project

With a repository-level instruction file and familiarity with Completions and Chat, you can scale from small edits to larger features using comment-driven development:

1. Start a small sample project (for example, a fake data generator).
2. Use inline comments to scaffold small functions and use Copilot to complete them.
3. Switch to Copilot Chat for larger tasks or when you want full docstrings and typed signatures.
4. Iterate: accept a suggestion, refactor, re-prompt with clearer constraints, and repeat.

Further reading and resources

* [GitHub Copilot documentation](https://docs.github.com/en/copilot)
* [Copilot Chat overview](https://docs.github.com/en/copilot/getting-started-with-github-copilot/about-github-copilot-chat)
* [Visual Studio Code keybindings](https://code.visualstudio.com/docs/getstarted/keybindings)

Apply these quick wins to make Copilot more consistent with your project's style and to speed up development cycles.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/github-copilot-in-action/module/192b5dd0-981d-43ef-80e9-b4189b3877af/lesson/54127571-05ca-48d7-bc66-269b94873930" />
</CardGroup>
