mirror of
https://github.com/openai/codex.git
synced 2026-09-08 15:50:34 +00:00
Expose Vim bindings through the TUI keymap config and add a startup toggle so Vim mode can be enabled by default. Wire runtime keymap handling for Vim actions, add `tui.vim_mode_default` to config parsing/runtime config, apply the default in ChatWidget startup paths, and update docs/default keymap/schema accordingly.
4.9 KiB
4.9 KiB
TUI Keymap Action Matrix
This file defines the supported keymap actions and their default v1 bindings.
For runtime behavior, safety invariants, and testing guidance, see
docs/tui-keymap.md.
Preset behavior
latestis an alias to the newest shipped preset.- Today,
latest -> v1. - To keep stable behavior over time, pin
preset = "v1".
Precedence
tui.keymap.<context>.<action>tui.keymap.global.<action>(chat/composer fallback actions only)- Preset default (
v1today)
Default v1 Compatibility Notes
- Some actions intentionally ship with multiple bindings for the same logical shortcut because terminals differ in modifier reporting.
- Today this includes:
composer.toggle_shortcuts:?andshift-?approval.open_fullscreen:ctrl-aandctrl-shift-aonboarding.toggle_animation:ctrl-.andctrl-shift-.
- Keep these paired defaults unless/until key-event normalization is made platform-consistent at a lower layer.
Action Definitions
global
open_transcript: open transcript overlayopen_external_editor: open external editor for current draftedit_previous_message: begin/advance edit-previous flow when composer is emptyconfirm_edit_previous_message: confirm selected previous message for editingsubmit: submit current draftqueue: queue current draft while a task is runningtoggle_shortcuts: toggle composer shortcut overlaytoggle_vim_mode: toggle Vim mode for composer input
chat
edit_previous_message: chat override for edit-previous flowconfirm_edit_previous_message: chat override for edit confirmation
composer
submit: composer override for submitqueue: composer override for queuetoggle_shortcuts: composer override for shortcut overlay toggle
editor
insert_newline: insert newline in text editormove_left/move_right/move_up/move_down: cursor movementmove_word_left/move_word_right: word movementmove_line_start/move_line_end: line boundary movementdelete_backward/delete_forward: single-char deletiondelete_backward_word/delete_forward_word: word deletionkill_line_start/kill_line_end: kill to line boundaryyank: paste kill-buffer contents
vim_normal
enter_insert: switch to insert modeappend_after_cursor: move right and switch to insert modeappend_line_end: move to end of line and switch to insert modeinsert_line_start: move to beginning of line and switch to insert modeopen_line_below/open_line_above: open line and switch to insert modemove_left/move_right/move_up/move_down: cursor movementmove_word_forward/move_word_backward/move_word_end: word motionsmove_line_start/move_line_end: line boundary motionsdelete_char: delete character at cursordelete_to_line_end: delete from cursor to line endyank_line: copy current linepaste_after: paste after cursorstart_delete_operator/start_yank_operator: enter operator-pending statecancel_operator: clear pending operator
vim_operator
delete_line: apply delete operator to full lineyank_line: apply yank operator to full linemotion_left/motion_right/motion_up/motion_down: motion targetsmotion_word_forward/motion_word_backward/motion_word_end: word targetsmotion_line_start/motion_line_end: line targetscancel: cancel pending operator
pager
scroll_up/scroll_down: row scrollpage_up/page_down: page scrollhalf_page_up/half_page_down: half-page scrolljump_top/jump_bottom: jump to top/bottomclose: close pager overlayclose_transcript: close transcript via transcript toggle bindingedit_previous_message/edit_next_message: backtrack navigation in transcriptconfirm_edit_message: confirm selected backtrack message
list
move_up/move_down: list navigationaccept: select current itemcancel: close list view
approval
open_fullscreen: open full-screen approval detailsapprove: approve primary requestapprove_for_session: approve-for-session optionapprove_for_prefix: approve-for-prefix optiondecline: decline requestcancel: cancel elicitation request- MCP elicitation safety rule:
Escis always treated ascancel(neverdecline) so dismissal cannot accidentally continue execution.
onboarding
move_up/move_down: onboarding list navigationselect_first/select_second/select_third: numeric selection shortcutsconfirm: confirm highlighted onboarding selectioncancel: cancel current onboarding sub-flowquit: quit onboarding flowtoggle_animation: switch welcome animation variant- API-key entry guard: printable
quitbindings are treated as text input once the API-key field has text; control/alt quit chords are not suppressed.