[Feature Request] Add VimNormal/VimInsert contexts to keybindings system
Bug Description
Feature Request: Add vim mode contexts to keybindings system
Title: Feature: Add VimNormal / VimInsert contexts to keybindings.json
Body:
### Problem
When vim mode is enabled (/vim), the keybindings system has no awareness of vim's
modal states. The current 18 keybinding contexts (Chat, Global, Settings, etc.) don't
distinguish between vim NORMAL and INSERT modes.
This means users cannot:
- Bind keys in vim NORMAL mode to Claude Code actions (e.g.,
g dto toggle diff,g tto toggle todos) - Override specific vim NORMAL mode keys with custom component-level actions
- Create vim-idiomatic workflows (e.g.,
:to open command palette,Z Zto exit)
### Proposed Solution
Add new keybinding contexts for vim modal states:
VimNormal- Active when vim mode is on and in NORMAL modeVimInsert- Active when vim mode is on and in INSERT modeVimVisual- Active when vim mode is on and in VISUAL mode (if applicable)
These contexts should layer on top of existing contexts (e.g., Chat), allowing
context-specific overrides when vim mode is active.
#### Example configuration
```json
{
"bindings": [
{
"context": "VimNormal",
"bindings": {
"g t": "app:toggleTodos",
"g o": "app:toggleTranscript",
"g d": "diff:toggle",
"Z Z": "app:exit"
}
}
]
}
Context
- Vim mode (/vim) and keybindings (keybindings.json) currently operate at separate layers
- Vim handles text-level input; keybindings handle component-level actions
- Bridging these two layers via contexts would enable much richer vim-style workflows
- Related (closed): #13531, #9177, #1204
**Environment Info**
- Platform: darwin
- Terminal: iTerm.app
- Version: 2.1.39
- Feedback ID: 84a99b93-e9d8-46b6-98f1-d1c18afb51c8
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗