Gemini Code Assist provides AI-powered assistance to help your
development team build, deploy, and operate applications throughout the software
development lifecycle.

This page provides an overview of the keyboard shortcuts you can use in VS Code,
IntelliJ, and
[other supported JetBrains IDEs](https://docs.cloud.google.com/gemini/docs/codeassist/supported-languages.md.txt#supported_ides),
for Windows, Linux, and macOS users.

## Code generation shortcuts

### VS Code

| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |
|---|---|---|
| Navigate to chat interface | <kbd>Alt+G</kbd> | <kbd>Option+G</kbd> |
| [Add selected code snippet to Gemini Chat context](https://docs.cloud.google.com/gemini/docs/codeassist/chat-gemini.md.txt#add_selected_code_snippets_to_context) | <kbd>Control+Alt+X</kbd> | <kbd>Command+Alt+X</kbd> |
| [Finish code changes in a file](https://docs.cloud.google.com/gemini/docs/codeassist/write-code-gemini.md.txt#finish-changes) | <kbd>Alt+F</kbd> | <kbd>Option+F</kbd> |

### IntelliJ

| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |
|---|---|---|
| Generate code inline of a code file | <kbd>Control+G</kbd> | <kbd>Option+G</kbd> |
| Open In-Editor prompt | <kbd>Control+\</kbd> | <kbd>Command+\</kbd> |
| [Add selected code snippet to Gemini Chat context](https://docs.cloud.google.com/gemini/docs/codeassist/chat-gemini.md.txt#add_selected_code_snippets_to_context) | <kbd>Control+Alt+X</kbd> | <kbd>Command+Alt+X</kbd> |
| [Finish code changes in a file](https://docs.cloud.google.com/gemini/docs/codeassist/write-code-gemini.md.txt#finish-changes) | <kbd>Alt+F</kbd> | <kbd>Option+F</kbd> |

## Terminal shortcuts

### VS Code

| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |
|---|---|---|
| [Add the current highlighted terminal content to the Gemini Chat context](https://docs.cloud.google.com/gemini/docs/codeassist/chat-gemini.md.txt#prompt_with_selected_terminal_output_using_chat) | <kbd>Control+Alt+X</kbd> | <kbd>Command+Alt+X</kbd> |

### IntelliJ

There aren't any default terminal shortcuts for
Gemini Code Assist for IntelliJ and other supported JetBrains
IDEs at this time.

## Chat shortcuts

### VS Code

| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |
|---|---|---|
| Cycle through prior chat prompts | <kbd>Up/down arrows</kbd> | <kbd>Up/down arrows</kbd> |
| [Generate an outline](https://docs.cloud.google.com/gemini/docs/codeassist/chat-gemini.md.txt#outline) | <kbd>Alt+O</kbd> | <kbd>Option+O</kbd> |

### IntelliJ

| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |
|---|---|---|
| Cycle through prior chat prompts | <kbd>Up/down arrows</kbd> | <kbd>Up/down arrows</kbd> |
| New chat | <kbd>Control+Alt+Windows+Up</kbd> | <kbd>Control+Alt+Command+Up</kbd> |
| [Generate an outline](https://docs.cloud.google.com/gemini/docs/codeassist/chat-gemini.md.txt#outline) | <kbd>Alt+O</kbd> | <kbd>Option+O</kbd> |

## Edit keyboard shortcuts

If you prefer to change any of the default Gemini Code Assist
shortcuts, you can do so by following these steps:

### VS Code

1. In your IDE, click **File** (for Windows and Linux) or **Code** (for
   macOS), and then navigate to **Settings** \> **Keyboard
   Shortcuts**.

2. In the list of keyboard shortcuts, scroll until you find the shortcut that
   you want to change. For example: **Gemini Code Assist: Generate code**.

3. Click the shortcut that you want to change (for example, **Gemini Code
   Assist: Generate Code** ), and then click
   edit **Change
   Keybinding**.

4. In the dialog that appears, enter your own shortcut.

5. Press <kbd>Enter</kbd> (for Windows and Linux) or <kbd>Return</kbd> (for
   macOS).

You can now use your newly assigned keyboard shortcut in your IDE.

To learn more about changing shortcuts in your IDE, see
[Keybindings for Visual Studio Code](https://code.visualstudio.com/docs/getstarted/keybindings).

### IntelliJ

1. Navigate to settings
   **IDE and Project Settings** \> **Settings** \>
   **Keymap** \> **Plugins** \> **Gemini Code Assist**.

2. Right-click the shortcut you want to change (for example, **Generate
   Code** ) and select **Add Keyboard Shortcut**.

3. Enter your preferred keyboard shortcut and then click **OK**.

4. Right-click the shortcut again and remove the shortcut. For example,
   right-click **Generate code** and select **Remove <kbd>Alt+G</kbd>** (for
   Windows and Linux), or **Remove <kbd>Option+G</kbd>** (for macOS).

You can now use your new keyboard shortcut in your IDE.