Skip to content

Ctrl+O : one-shot normal mode from insert #16

@zackslash

Description

@zackslash

Thanks for creating vimcode — enjoying using it so far!

Description

In Vim, Ctrl+O in insert mode executes one Normal mode command, then automatically returns to insert mode (:help i_CTRL-O). This is one of the most useful Vim features for quick edits without fully leaving insert mode.

Use cases:

  • Quick delete: Ctrl+O dw — delete a word and continue typing
  • Quick navigation: Ctrl+O b — jump back a word and continue typing
  • Quick undo: Ctrl+O u — undo and continue typing
  • Quick replace: Ctrl+O r{char} — replace a character and continue typing

Current behavior

Ctrl+O is not handled in insert mode. It either does nothing or gets swallowed.

Proposed behavior

  1. Pressing Ctrl+O in insert mode enters a transient one-shot normal mode
  2. Execute exactly one normal-mode command (motion, operator+motion, single-key command like x, u, r, etc.)
  3. Automatically return to insert mode after the command completes

Notes

  • Counts should work: Ctrl+O 3w should jump 3 words forward and return to insert
  • Operator-pending should work: Ctrl+O dw should delete a word and return to insert
  • If Escape is pressed during one-shot mode, it should cancel and return to insert (not enter normal mode permanently)
  • This is a natural complement to the existing Escape → normal mode flow for when you just need one quick command

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions