Vim Mode System
Overview
Claude Code includes a Vim mode for efficient keyboard navigation within the terminal interface. It implements core Vim concepts: motions, operators, text objects, and modal editing.
Plain text
┌─────────────────────────────────────────────────────────────────────────────┐
│ VIM MODE ARCHITECTURE │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ MODAL EDITING │ │
│ │ │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ NORMAL │─────►│ INSERT │◄────►│ REPLACE │ │ │
│ │ │ (nav) │◄─────│ (type) │ │ (type) │ │ │
│ │ └────┬─────┘ └──────────┘ └──────────┘ │ │
│ │ │ │ │
│ │ │ Visual │ │
│ │ ▼ │ │
│ │ ┌──────────┐ │ │
│ │ │ VISUAL │ (select) │ │
│ │ │ MODE │ │ │
│ │ └──────────┘ │ │
│ │ │ │
│ │ ESC: Return to NORMAL │ │
│ │ i/I/a/A/o/O: Enter INSERT │ │
│ │ v/V: Enter VISUAL │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ MOTION SYSTEM │ │
│ │ │ │
│ │ CHARACTER WORD LINE DOCUMENT │ │
│ │ h j k l w b e 0 ^ $ gg G │ │
│ │ │ │
│ │ h: left w: next word 0: start gg: top │ │
│ │ j: down b: prev word ^: first char G: bottom │ │
│ │ k: up e: end word $: end │ │
│ │ l: right │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ OPERATOR SYSTEM │ │
│ │ │ │
│ │ d: delete (cut) dd: delete line │ │
│ │ y: yank (copy) yy: yank line │ │
│ │ c: change (delete + insert) cc: change line │ │
│ │ p: paste P: paste before │ │
│ │ >: indent <: unindent │ │
│ │ │ │
│ │ OPERATOR + MOTION = ACTION: │ │
│ │ dw = delete word, d$ = delete to end, dgg = delete to top │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘