Gemini Code Assist 功能的键盘快捷键
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Gemini Code Assist 提供 AI 赋能的辅助功能,可在整个软件开发生命周期中帮助您的开发团队使用 Gemini 2.5 模型构建、部署和运营应用。
本页面概述了 Windows、Linux 和 macOS 用户可在 VS Code、IntelliJ 和其他受支持的 JetBrains IDE 中使用的键盘快捷键。
代码生成快捷键
IntelliJ
操作 |
键盘快捷键 (Windows/Linux) |
键盘快捷键 (macOS) |
生成代码文件的内嵌代码 |
Control+G |
Option+G |
打开编辑器内提示 |
Ctrl+\ |
Command+\ |
终端快捷键
IntelliJ
目前,Gemini Code Assist for IntelliJ 和其他受支持的 JetBrains IDE 没有任何默认的终端快捷键。
聊天快捷方式
VS Code
操作 |
键盘快捷键 (Windows/Linux) |
键盘快捷键 (macOS) |
循环浏览之前的聊天提示 |
向上/向下箭头 |
向上/向下箭头 |
IntelliJ
操作 |
键盘快捷键 (Windows/Linux) |
键盘快捷键 (macOS) |
循环浏览之前的聊天提示 |
向上/向下箭头 |
向上/向下箭头 |
修改键盘快捷键
如果您想更改任何默认的 Gemini Code Assist 快捷键,可以按照以下步骤操作:
VS Code
在 IDE 中,点击文件(Windows 和 Linux)或代码 (macOS),然后依次前往设置 > 键盘快捷键。
在键盘快捷键列表中,滚动到要更改的快捷键。例如:Gemini Code Assist:生成代码。
点击要更改的快捷键(例如 Gemini Code Assist:生成代码),然后点击 edit 更改键绑定。
在随即显示的对话框中,输入您自己的快捷键。
按 Enter 键(Windows 和 Linux)或 Return 键 (macOS)。
您现在可以在 IDE 中使用新分配的键盘快捷键。
如需详细了解如何更改 IDE 中的快捷键,请参阅适用于 Visual Studio Code 的按键绑定。
IntelliJ
依次前往 settings
IDE 和项目设置 > 设置 > 按键映射 > 插件 > Gemini Code Assist。
右键点击要更改的快捷键(例如生成代码),然后选择添加键盘快捷键。
输入您偏好的键盘快捷键,然后点击确定。
再次右键点击该快捷键,然后移除该快捷方式。例如,右键点击生成代码,然后选择移除 Alt+G(适用于 Windows 和 Linux)或移除 Option+G(适用于 macOS)。
您现在可以在 IDE 中使用新的键盘快捷键。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[],[],null,["Gemini Code Assist provides AI-powered assistance to help your\ndevelopment team build, deploy, and operate applications throughout the software\ndevelopment lifecycle, using the Gemini 2.5 model.\n\nThis page provides an overview of the keyboard shortcuts you can use in VS Code,\nIntelliJ, and\n\n[other supported JetBrains IDEs](/gemini-code-assist/docs/supported-languages#supported_ides),\nfor Windows, Linux, and macOS users.\n\nCode generation shortcuts \n\nVS Code\n\n| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |\n|-------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|---------------------------|\n| Navigate to chat interface | \u003ckbd\u003eAlt+G\u003c/kbd\u003e | \u003ckbd\u003eOption+G\u003c/kbd\u003e |\n| [Add the current highlighted code to the Gemini Chat context](/gemini-code-assist/docs/chat-gemini#add_selected_code_snippets_to_context) | \u003ckbd\u003eControl+Alt+X\u003c/kbd\u003e | \u003ckbd\u003eCommand+Alt+X\u003c/kbd\u003e |\n\nIntelliJ\n\n| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |\n|-------------------------------------|-----------------------------------|---------------------------|\n| Generate code inline of a code file | \u003ckbd\u003eControl+G\u003c/kbd\u003e | Option+G |\n| Open In-Editor prompt | \u003ckbd\u003eControl+\\\u003c/kbd\u003e | \u003ckbd\u003eCommand+\\\u003c/kbd\u003e |\n\nTerminal shortcuts \n\nVS Code\n\n| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------|---------------------------|\n| [Add the current highlighted terminal content to the Gemini Chat context](/gemini-code-assist/docs/chat-gemini#prompt_with_selected_terminal_output_using_chat) | \u003ckbd\u003eControl+Alt+X\u003c/kbd\u003e | \u003ckbd\u003eCommand+Alt+X\u003c/kbd\u003e |\n\nIntelliJ\n\nThere aren't any default terminal shortcuts for\nGemini Code Assist for IntelliJ and other supported JetBrains\nIDEs at this time.\n\nChat shortcuts \n\nVS Code\n\n| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |\n|----------------------------------|-----------------------------------|---------------------------|\n| Cycle through prior chat prompts | \u003ckbd\u003eUp/down arrows\u003c/kbd\u003e | \u003ckbd\u003eUp/down arrows\u003c/kbd\u003e |\n\nIntelliJ\n\n| Action | Keyboard shortcut (Windows/Linux) | Keyboard shortcut (macOS) |\n|----------------------------------|-----------------------------------|-----------------------------------|\n| Cycle through prior chat prompts | \u003ckbd\u003eUp/down arrows\u003c/kbd\u003e | \u003ckbd\u003eUp/down arrows\u003c/kbd\u003e |\n| New chat | \u003ckbd\u003eControl+Alt+Windows+Up\u003c/kbd\u003e | \u003ckbd\u003eControl+Alt+Command+Up\u003c/kbd\u003e |\n\nEdit keyboard shortcuts\n\nIf you prefer to change any of the default Gemini Code Assist\nshortcuts, you can do so by following these steps: \n\nVS Code\n\n1. In your IDE, click **File** (for Windows and Linux) or **Code** (for\n macOS), and then navigate to **Settings** \\\u003e **Keyboard\n Shortcuts**.\n\n2. In the list of keyboard shortcuts, scroll until you find the shortcut that\n you want to change. For example: **Gemini Code Assist: Generate code**.\n\n3. Click the shortcut that you want to change (for example, **Gemini Code\n Assist: Generate Code** ), and then click\n edit **Change\n Keybinding**.\n\n4. In the dialog that appears, enter your own shortcut.\n\n5. Press \u003ckbd\u003eEnter\u003c/kbd\u003e (for Windows and Linux) or \u003ckbd\u003eReturn\u003c/kbd\u003e (for\n macOS).\n\n You can now use your newly assigned keyboard shortcut in your IDE.\n\nTo learn more about changing shortcuts in your IDE, see\n[Keybindings for Visual Studio Code](https://code.visualstudio.com/docs/getstarted/keybindings).\n\nIntelliJ\n\n1. Navigate to settings\n **IDE and Project Settings** \\\u003e **Settings** \\\u003e\n **Keymap** \\\u003e **Plugins** \\\u003e **Gemini Code Assist**.\n\n2. Right-click the shortcut you want to change (for example, **Generate\n Code** ) and select **Add Keyboard Shortcut**.\n\n3. Enter your preferred keyboard shortcut and then click **OK**.\n\n4. Right-click the shortcut again and remove the shortcut. For example,\n right-click **Generate code** and select **Remove \u003ckbd\u003eAlt+G\u003c/kbd\u003e** (for\n Windows and Linux), or **Remove \u003ckbd\u003eOption+G\u003c/kbd\u003e** (for macOS).\n\nYou can now use your new keyboard shortcut in your IDE."]]