Gemini Code Assist 功能的鍵盤快速鍵
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Gemini Code Assist 採用 Gemini 2.5 模型,提供 AI 輔助功能,協助開發團隊在整個軟體開發生命週期中建構、部署及操作應用程式。
本頁面提供 Windows、Linux 和 macOS 使用者適用的鍵盤快速鍵總覽,這些快速鍵可在 VS Code、IntelliJ 和其他支援的 JetBrains IDE 中使用。
程式碼生成快速鍵
IntelliJ
動作 |
鍵盤快速鍵 (Windows/Linux) |
鍵盤快速鍵 (macOS) |
在程式碼檔案中生成程式碼 |
Control + G 鍵 |
Option+G |
開啟編輯器內提示 |
Control+\ |
Command+\ |
終端機快速鍵
IntelliJ
目前 Gemini Code Assist for IntelliJ 和其他支援的 JetBrains IDE 沒有預設的終端機快速鍵。
Chat 快速鍵
VS Code
動作 |
鍵盤快速鍵 (Windows/Linux) |
鍵盤快速鍵 (macOS) |
循環切換先前的聊天提示 |
向上/向下鍵 |
向上/向下鍵 |
IntelliJ
動作 |
鍵盤快速鍵 (Windows/Linux) |
鍵盤快速鍵 (macOS) |
循環切換先前的聊天提示 |
向上/向下鍵 |
向上/向下鍵 |
編輯鍵盤快速鍵
如要變更任何預設的 Gemini Code Assist 快速鍵,請按照下列步驟操作:
VS Code
在 IDE 中,按一下「File」(Windows 和 Linux) 或「Code」(macOS),然後依序前往「Settings」>「Keyboard Shortcuts」。
在鍵盤快速鍵清單中捲動,找到要變更的快速鍵。例如:Gemini Code Assist:生成程式碼。
點選要變更的快速鍵 (例如「Gemini Code Assist: Generate Code」),然後點選 edit「Change Keybinding」。
在隨即顯示的對話方塊中,輸入自訂快速鍵。
按下 Enter 鍵 (Windows 和 Linux) 或 Return 鍵 (macOS)。
現在可以在 IDE 中使用新指派的鍵盤快速鍵。
如要進一步瞭解如何在 IDE 中變更快速鍵,請參閱「Visual Studio Code 的按鍵繫結」。
IntelliJ
依序前往「IDE and Project Settings」 >「Settings」 >「Keymap」 >「Plugins」 >「Gemini Code Assist」。settings
在要變更的快速鍵上按一下滑鼠右鍵 (例如「產生程式碼」),然後選取「新增鍵盤快速鍵」。
輸入偏好的鍵盤快速鍵,然後按一下「確定」。
再次按一下滑鼠右鍵,然後移除捷徑。舉例來說,在「生成程式碼」上按一下滑鼠右鍵,然後選取「移除 Alt+G」(適用於 Windows 和 Linux),或「移除 Option+G」(適用於 macOS)。
現在可以在 IDE 中使用新的鍵盤快速鍵。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-31 (世界標準時間)。
[null,null,["上次更新時間: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."]]