Phím tắt cho các tính năng của Gemini Code Assist
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Gemini Code Assist cung cấp sự hỗ trợ dựa trên AI để giúp nhóm phát triển của bạn xây dựng, triển khai và vận hành các ứng dụng trong suốt vòng đời phát triển phần mềm, bằng cách sử dụng mô hình Gemini 2.5.
Trang này cung cấp thông tin tổng quan về các phím tắt mà bạn có thể sử dụng trong VS Code, IntelliJ và các IDE khác được JetBrains hỗ trợ cho người dùng Windows, Linux và macOS.
Phím tắt tạo mã
IntelliJ
Hành động |
Phím tắt (Windows/Linux) |
Phím tắt (macOS) |
Tạo mã trong dòng của tệp mã |
Ctrl+G |
Option+G |
Mở lời nhắc trong trình chỉnh sửa |
Ctrl+\ |
Command+\ |
Phím tắt trong Terminal
IntelliJ
Hiện tại, Gemini Code Assist cho IntelliJ và các IDE khác được JetBrains hỗ trợ không có phím tắt mặc định.
Phím tắt trong Chat
VS Code
Hành động |
Phím tắt (Windows/Linux) |
Phím tắt (macOS) |
Di chuyển qua các câu lệnh trò chuyện trước đó |
Mũi tên lên/xuống |
Mũi tên lên/xuống |
IntelliJ
Hành động |
Phím tắt (Windows/Linux) |
Phím tắt (macOS) |
Di chuyển qua các câu lệnh trò chuyện trước đó |
Mũi tên lên/xuống |
Mũi tên lên/xuống |
Chỉnh sửa phím tắt
Nếu muốn thay đổi bất kỳ phím tắt mặc định nào của Gemini Code Assist, bạn có thể làm theo các bước sau:
VS Code
Trong IDE, hãy nhấp vào File (Tệp) (đối với Windows và Linux) hoặc Code (Mã) (đối với macOS), rồi chuyển đến Settings (Cài đặt) > Keyboard Shortcuts (Tổ hợp phím).
Trong danh sách phím tắt, hãy di chuyển cho đến khi bạn tìm thấy phím tắt mà bạn muốn thay đổi. Ví dụ: Gemini Code Assist: Tạo mã.
Nhấp vào phím tắt mà bạn muốn thay đổi (ví dụ: Gemini Code Assist: Tạo mã), sau đó nhấp vào edit Thay đổi tổ hợp phím.
Trong hộp thoại xuất hiện, hãy nhập phím tắt của riêng bạn.
Nhấn phím Enter (đối với Windows và Linux) hoặc Return (đối với macOS).
Giờ đây, bạn có thể sử dụng phím tắt mới được chỉ định trong IDE.
Để tìm hiểu thêm về cách thay đổi phím tắt trong IDE, hãy xem bài viết Keybindings for Visual Studio Code (Các tổ hợp phím cho Visual Studio Code).
IntelliJ
Chuyển đến settings
IDE and Project Settings (IDE và Cài đặt dự án) > Settings (Cài đặt) >
Keymap (Bảng khoá) > Plugins (Trình bổ trợ) > Gemini Code Assist (Gemini Code Assist).
Nhấp chuột phải vào phím tắt bạn muốn thay đổi (ví dụ: Generate Code (Tạo mã)) rồi chọn Add Keyboard Shortcut (Thêm phím tắt).
Nhập phím tắt bạn muốn rồi nhấp vào OK.
Nhấp chuột phải vào lối tắt đó một lần nữa rồi xoá lối tắt. Ví dụ: nhấp chuột phải vào Tạo mã rồi chọn Xoá Alt+G (đối với Windows và Linux) hoặc Xoá Option+G (đối với macOS).
Giờ đây, bạn có thể sử dụng phím tắt mới trong IDE.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-31 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-31 UTC."],[],[],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."]]