OpenAI Codex 在 VS Code 里可以通过命令面板直接控制,也可以绑定到自己的快捷键。适合想快速新建线程、把选中文本或整个文件加入上下文、让 Codex 处理 TODO,或打开 Codex 侧边栏的用户;命令 ID 以 chatgpt.* 开头,快捷键可在 Keyboard Shortcuts 里搜索 Codex 或具体命令名后修改。
OpenAI Codex IDE 快捷键与命令
Use these commands to control Codex from the VS Code Command Palette. You can also bind them to keyboard shortcuts.
怎么给 Codex 命令设置快捷键
要给某个 Codex 命令分配或修改快捷键:
- 打开 Command Palette(macOS 上按 Cmd+Shift+P,Windows/Linux 上按 Ctrl+Shift+P)。
- 运行 Preferences: Open Keyboard Shortcuts。
- 搜索
Codex,或者直接搜命令 ID,比如chatgpt.newChat。 - 选择铅笔图标,然后输入你想要的快捷键。
Codex 扩展命令
| Command | Default key binding | Description |
|---|---|---|
chatgpt.addToThread |
- | Add selected text range as context for the current thread |
chatgpt.addFileToThread |
- | Add the entire file as context for the current thread |
chatgpt.newChat |
macOS: Cmd+NWindows/Linux: Ctrl+N |
Create a new thread |
chatgpt.implementTodo |
- | Ask Codex to address the selected TODO comment |
chatgpt.newCodexPanel |
- | Create a new Codex panel |
chatgpt.openSidebar |
- | Opens the Codex sidebar panel |
chatgpt.addToThread
把当前选中的文本范围作为上下文加入当前 thread。
chatgpt.addFileToThread
把整个文件作为上下文加入当前 thread。
chatgpt.newChat
新建一个 thread。默认快捷键是 macOS 的 Cmd+N,Windows/Linux 的 Ctrl+N。
chatgpt.implementTodo
让 Codex 处理当前选中的 TODO 注释。
chatgpt.newCodexPanel
新建一个 Codex panel。
chatgpt.openSidebar
打开 Codex sidebar panel。
常见问题
OpenAI Codex 怎么给命令绑定快捷键
打开 VS Code 的 Command Palette,进入 Preferences: Open Keyboard Shortcuts,再搜索 Codex 或具体命令 ID,比如 chatgpt.newChat。选中铅笔图标后输入新快捷键即可。
OpenAI Codex 新建线程的默认快捷键是什么
chatgpt.newChat 的默认快捷键是 macOS 的 Cmd+N,Windows/Linux 的 Ctrl+N。
OpenAI Codex 怎么把选中文本或整个文件加到当前 thread
用 chatgpt.addToThread 可以把选中的文本范围加入当前 thread;用 chatgpt.addFileToThread 可以把整个文件加入当前 thread。