[FEATURE] Vim Mode Cursor Style Adaptation - Different cursor shapes for Normal/Insert/Visual modes
Thanks for suggesting a feature!
We love hearing ideas from our community. Please help us understand your use case by filling out the sections below.
Before submitting, please check if this feature has already been requested.
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Currently, Claude Code's Vim mode does not adapt the cursor style based on the current Vim mode (Normal, Insert, Visual, etc.). This is a key quality-of-life feature in terminal-based Vim that provides essential visual feedback about the current editing mode. Without it, users lose important contextual information about their editing state, which reduces the Vim muscle memory and efficiency.
Proposed Solution
Implement automatic cursor style switching when entering different Vim modes. The cursor should change its shape to reflect the current mode:
- Normal mode: Block cursor (■) - Default state for navigation and commands
- Insert mode: Bar/Beam cursor (│ or ▮) - Indicates text input state
- Visual mode: Underline cursor (━) - Indicates selection state
Configuration Schema
Add new configuration options under vimMode.cursorStyle:
{
"vimMode": {
"enabled": true,
"cursorStyle": {
"normal": "block",
"insert": "bar",
"visual": "underline"
}
}
}
Supported Cursor Styles
| Style | Visual | DECSCUSR Code |
|-------|--------|---------------|
| block | ■ | 0 |
| underline | ━ | 2 |
| bar | │ | 1 |
| beam | ▮ | 6 |
Alternative Solutions
Currently, users must manually change terminal profiles or use workarounds. Some users configure their terminal emulator globally, but this affects all applications and doesn't adapt to Claude Code's internal Vim mode state.
Priority
- High - Significant impact on productivity
Feature Category
- Interactive mode (TUI)
Use Case Example
Example scenario:
- I'm editing code in Claude Code's Vim mode
- I press
ito enter Insert mode - cursor changes to bar () - I press
Escto return│ to Normal mode - cursor changes to block (■) - I press
vto enter Visual mode - cursor changes to underline (━) - This visual feedback helps me instantly know my current mode without looking at the mode indicator
Additional Context
Technical Implementation
The feature can be implemented using ANSI escape sequences:
- DECSCUSR (Change Cursor Style):
ESC [ Ps q - Ps = 0 → Block cursor
- Ps = 1 → Blinking block
- Ps = 2 → Underline cursor
- Ps = 3 → Blinking underline
- Ps = 4 → Bar cursor (vertical line)
- Ps = 5 → Blinking bar
- Ps = 6 → Beam cursor (vertical line)
Terminal compatibility:
- iTerm2: Full support
- Windows Terminal: Full support
- GNOME Terminal: Partial support (may need fallback)
- macOS Terminal.app: Full support
Reference:
- Settings Schema: https://json.schemastore.org/claude-code-settings.json
- Terminal escape sequences: CSI Ps q (DECSCUSR)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗