Dynamic line highlight indicator for ModalEdit extension in VS Code. Provides instant visual feedback for all 4 ModalEdit modes with theme-aware styling.
Required: ModalEdit extension
This extension provides visual feedback for ModalEdit modes. Without ModalEdit, the extension will show a warning and display insert mode styling only.
-
Install from Marketplace:
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "ModalEdit"
- Click Install on "ModalEdit" by johtela
- Or click here to install
-
Verify ModalEdit is working:
- Open any file
- Press
Esc(enter Normal mode) - Press
i(enter Insert mode) - Expected: Cursor style changes between modes
- If cursor doesn't change: Check ModalEdit configuration (see ModalEdit docs)
-
Configure ModalEdit cursor styles (recommended):
Add to your
settings.json:{ "modaledit.normal.cursorStyle": "block", "modaledit.insert.cursorStyle": "line", "modaledit.visual.cursorStyle": "underline" }
✅ ModalEdit working? Continue to Quick Start below ❌ ModalEdit not working? See ModalEdit troubleshooting
Note: VS Code will automatically prompt to install ModalEdit when you install this extension.
- Install ModalEdit (if not already installed - see Prerequisites)
- Test ModalEdit modes:
- Press
Esc→ Cursor should become a block (Normal mode) - Press
i→ Cursor should become a line (Insert mode) - Press
v→ Cursor should become an underline (Visual mode)
- Press
✅ Cursor changes? Proceed to Stage 2 ❌ Cursor doesn't change? Fix ModalEdit first - see Prerequisites
- Install this extension: VS Code Marketplace → "ModalEdit Line Indicator"
- Test mode indicators:
- Press
Esc→ See green dotted border on current line (Normal mode) - Press
i→ See red solid border (Insert mode) - Press
v→ See blue dashed border (Visual mode) - Press
/→ See yellow solid border (Search mode)
- Press
✅ Borders appear and change colors? Success! Extension is working ❌ No borders or wrong colors? See Troubleshooting
Settings → Search "modaledit-line-indicator" → Customize colors, borders, and theme-specific styling
Next steps:
- 🎨 Configuration - Customize colors and styles
- 🐛 Troubleshooting - Fix common issues
- 📖 Features - Learn about theme-aware styling
- 4-Mode Support: Automatically changes line highlight for NORMAL, INSERT, VISUAL, and SEARCH modes
- Theme-Aware Configuration: Different colors for dark, light, and high contrast themes
- Real-time Theme Switching: Instantly adapts when you change VS Code themes
- Per-Mode Customization: Independent styling for each mode
- Minimal Overhead: Only highlights the current line
- Zero Configuration: Works out-of-the-box with sensible defaults
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "ModalEdit Line Indicator"
- Click Install
Or install from VSIX:
# Download the .vsix file from releases, then:
code --install-extension modaledit-line-indicator-*.vsixThe extension works automatically once installed and ModalEdit is active.
Default Appearance (Border-Only):
- Normal Mode: Green dotted border (
#00aa00) - Insert Mode: Red solid border (
#aa0000) - Visual Mode: Blue dashed border (
#0000aa) - Search Mode: Yellow solid border (
#aaaa00)
All modes have transparent backgrounds by default for a clean, minimalist look.
How to run: Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → Type command name
| Command | When to Use | What It Does |
|---|---|---|
| Toggle Enabled/Disabled | Temporarily disable (e.g., screen sharing, presentation) | Turns extension on/off without changing settings |
| Query Current Mode (Debug) | Colors don't match expected mode | Shows detected mode + ModalEdit status in popup |
| Show Log File | Troubleshooting bugs or unexpected behavior | Opens detailed diagnostic logs with timestamps |
| Clear Log File | Before filing bug report | Resets log for clean reproduction of issue |
Edit your settings.json to customize colors and styles per mode:
{
"modaledit-line-indicator.enabled": true,
"modaledit-line-indicator.normalMode": {
"backgroundColor": "rgba(0, 0, 0, 0)",
"border": "2px dotted #00aa00"
},
"modaledit-line-indicator.insertMode": {
"backgroundColor": "rgba(0, 0, 0, 0)",
"border": "2px solid #aa0000"
},
"modaledit-line-indicator.visualMode": {
"backgroundColor": "rgba(0, 0, 0, 0)",
"border": "2px dashed #0000aa"
},
"modaledit-line-indicator.searchMode": {
"backgroundColor": "rgba(0, 0, 0, 0)",
"border": "2px solid #aaaa00"
}
}You can specify different colors for dark, light, and high contrast themes (both dark and light variants):
{
"modaledit-line-indicator.normalMode": {
// Common properties (apply to all themes unless overridden)
"backgroundColor": "rgba(0, 0, 0, 0)",
"border": "2px dotted #00aa00",
// Dark theme override (also used as fallback for high contrast dark)
"dark": {
"border": "2px dotted #00ffff" // Cyan border in dark themes
},
// Light theme override (also used as fallback for high contrast light)
"light": {
"border": "2px dotted #0000ff" // Blue border in light themes
},
// High contrast dark theme override
"darkHC": {
"border": "4px dotted #ffffff" // Thicker white border for better visibility
},
// High contrast light theme override
"lightHC": {
"border": "4px dotted #000000" // Thicker black border for better visibility
}
}
}How It Works:
- Common properties (background, border, borderStyle, borderWidth) apply to all themes
- Theme-specific overrides (
dark,light,darkHC,lightHC) selectively override properties - Cascading fallback hierarchy for high contrast themes:
- High Contrast Dark:
darkHC→dark→ common → defaults - High Contrast Light:
lightHC→light→ common → defaults
- High Contrast Dark:
- Extension automatically detects your current theme and applies the appropriate styling
- When you switch themes, the extension instantly updates the decorations
Change border color and style:
{
"modaledit-line-indicator.normalMode": {
"border": "3px solid #00ff00"
}
}Theme-specific colors:
{
"modaledit-line-indicator.normalMode": {
"dark": { "border": "2px dotted #00ffff" },
"light": { "border": "2px dotted #0000ff" }
}
}More examples: See docs/CONFIGURATION-EXAMPLES.md for detailed configuration examples including subtle indicators, high visibility with backgrounds, and advanced theme-adaptive configurations.
| Setting | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
Enable/disable the indicator |
Each mode (normalMode, insertMode, visualMode, searchMode) supports the following properties:
| Property | Type | Default | Valid Values | Examples |
|---|---|---|---|---|
backgroundColor |
CSS color | rgba(0,0,0,0) |
Any CSS color | #00ff00, rgba(0,255,0,0.1), transparent |
border |
CSS shorthand | Varies by mode* | CSS border shorthand | 2px dotted #00aa00, 3px solid cyan |
borderColor |
CSS color | Varies by mode* | Any CSS color | #00aa00, rgb(0,170,0), cyan |
borderStyle |
CSS keyword | Varies by mode** | solid | dashed | dotted | double | groove | ridge | inset | outset |
dotted, solid |
borderWidth |
CSS length | 2px |
Positive length | 1px, 0.5em, 3px |
borderRadius |
CSS length | 0px |
Positive length | 4px, 0.5em, 8px |
dark |
object | (none) | Any property overrides | { "border": "2px dotted #00ffff" } |
light |
object | (none) | Any property overrides | { "border": "2px dotted #0000ff" } |
darkHC |
object | (none) | Any property overrides | { "border": "4px dotted #ffffff" } |
lightHC |
object | (none) | Any property overrides | { "border": "4px dotted #000000" } |
Default borders by mode:
- Normal:
2px dotted #00aa00(green), Insert:2px solid #aa0000(red), Visual:2px dashed #0000aa(blue), Search:2px solid #aaaa00(yellow)
Border Property Options:
- CSS Shorthand (recommended):
"border": "2px dotted #00aa00"- concise, single property - Individual Properties:
"borderColor": "#00aa00","borderStyle": "dotted","borderWidth": "2px"- fine-grained control - Both formats supported; shorthand takes precedence if both specified
Theme Override Objects can contain any combination of the above properties.
Cascading Fallback: Each property is resolved independently through the fallback chain:
- HC Dark:
darkHC→dark→ common → defaults - HC Light:
lightHC→light→ common → defaults - Regular Dark/Light:
dark/light→ common → defaults
This allows selective overrides (e.g., only override border for high contrast, inherit other properties from the base theme).
All VS Code DecorationRenderOptions properties are supported. Properties are passed directly to the VS Code API.
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| backgroundColor | CSS color | Background color of the current line | "rgba(0, 255, 0, 0.1)", "#00ff00" |
✅ Tested |
| color | CSS color | Text color | "#ffffff", "rgb(255, 255, 255)" |
|
| opacity | Number (0-1) | Overall opacity | "0.8", "1.0" |
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| border | CSS shorthand | Border style (recommended) | "2px dotted #00aa00" |
✅ Tested |
| borderColor | CSS color | Border color (if not using shorthand) | "#00aa00", "cyan" |
|
| borderRadius | CSS length | Rounded corners | "4px", "0.5em" |
✅ Tested |
| borderSpacing | CSS length | Border spacing | "2px" |
|
| borderStyle | Keyword | Border line style | "solid", "dotted", "dashed", "double" |
|
| borderWidth | CSS length | Border thickness (if not using shorthand) | "2px", "3px" |
Border Style Options: solid | dotted | dashed | double | groove | ridge | inset | outset
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| outline | CSS shorthand | Outline style (like border but doesn't affect layout) | "1px solid #00ff00" |
|
| outlineColor | CSS color | Outline color | "#00ff00" |
|
| outlineStyle | Keyword | Outline line style | "solid", "dashed" |
|
| outlineWidth | CSS length | Outline thickness | "1px", "2px" |
Outline Style Options: Same as border styles
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| fontStyle | Keyword | Font style | "italic", "normal", "oblique" |
|
| fontWeight | Keyword/Number | Font weight | "bold", "normal", "600" |
|
| letterSpacing | CSS length | Space between letters | "1px", "0.1em" |
|
| textDecoration | Keyword | Text decoration | "underline", "line-through" |
|
| cursor | Keyword | Mouse cursor style | "pointer", "default", "text" |
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| overviewRulerColor | CSS color | Color marker in scrollbar | "#00ff00", "rgba(0,255,0,0.5)" |
|
| overviewRulerLane | Keyword | Position in scrollbar | "Left", "Center", "Right", "Full" |
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| gutterIconPath | URI/Path | Icon to display in gutter | "/path/to/icon.svg" |
|
| gutterIconSize | Keyword | Icon size | "auto", "contain", "cover", "50%" |
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| rangeBehavior | Keyword | How decoration grows when text is inserted at edges | "OpenOpen", "ClosedClosed" |
Range Behavior Options: OpenOpen | ClosedClosed | OpenClosed | ClosedOpen
| Property | Type | Description | Example | Status |
|---|---|---|---|---|
| dark | Object | Dark theme overrides | { "border": "2px dotted #00ffff" } |
✅ Tested |
| light | Object | Light theme overrides | { "border": "2px dotted #0000ff" } |
✅ Tested |
| darkHC | Object | High contrast dark overrides (fallback: dark → common) | { "border": "4px dotted #ffffff" } |
✅ Tested |
| lightHC | Object | High contrast light overrides (fallback: light → common) | { "border": "4px dotted #000000" } |
✅ Tested |
Legend:
- ✅ Tested: Property has automated test coverage and is verified working
⚠️ Supported: Property is passed through to VS Code API but not yet tested in this extension
Note: All properties are passed directly to VS Code's createTextEditorDecorationType() API. Untested properties should work but haven't been verified in test suite.
Border Configuration:
- ✅ Recommended: Use CSS shorthand
"border": "2px dotted #00aa00"for concise configuration ⚠️ Alternative: Use individual propertiesborderColor,borderStyle,borderWidthseparately- Precedence: If both shorthand and individual properties are specified, behavior depends on VS Code's internal merging
- Best Practice: Choose one approach per mode configuration to avoid conflicts
Outline Configuration: Same pattern as borders - use shorthand or individual properties, not both.
Property Support:
- All properties are passed directly to
createTextEditorDecorationType()API - VS Code controls which properties are rendered and how
- Some properties may not work in all VS Code versions
- Minimum supported: VS Code 1.85.0+
High Contrast Light Theme:
- Requires VS Code 1.106.0+ for
ColorThemeKind.HighContrastLight(value 4) - Earlier versions:
lightHCwill fall back tolighttheme settings - No breaking issues, just uses light theme colors instead
Decoration Complexity:
- Simple decorations (border only): Minimal performance impact (<1% CPU)
- Complex decorations (backgrounds + borders + text styling): Slightly higher overhead
- Current line only: Minimal overhead regardless of file size
- Tested: Extension runs smoothly on files up to 10,000+ lines
Recommended for Best Performance:
- Avoid combining too many visual properties simultaneously
- Use
backgroundColorsparingly (semi-transparent only if needed) - Prefer borders over backgrounds for lower visual noise
Heavy Properties (higher rendering cost):
gutterIconPath- Requires image loadingoverviewRulerColor- Additional scrollbar rendering- Multiple font properties together - May cause layout recalculations
Theme Detection:
- Extension detects 4 theme kinds:
dark,light,darkHC,lightHC - Custom themes are mapped to one of these 4 kinds by VS Code
- If colors are not visible in your theme, add theme-specific overrides
Color Visibility:
- Default border colors may not be visible in all themes
- Solution: Configure theme-specific colors using
dark,light,darkHC,lightHCoverrides - High contrast themes: Use thicker borders (3-4px) and solid style for better visibility
Properties That Work Well Together:
border+backgroundColor- Classic highlight styleborder+borderRadius- Rounded border effectoutline+border- Double border effect (outline doesn't affect layout)overviewRulerColor+border- Visual feedback in scrollbar and editor
Properties That May Conflict:
border(shorthand) +borderColor/borderStyle/borderWidth- Use one approachoutline(shorthand) +outlineColor/outlineStyle/outlineWidth- Use one approach- Heavy text styling (
fontStyle+fontWeight+textDecoration+letterSpacing) - May cause rendering issues
Desktop vs Browser:
- Extension designed for VS Code desktop
- VS Code for Web (vscode.dev): Should work but not extensively tested
- GitHub Codespaces: Should work but not tested
Operating System:
- Tested on: macOS, Linux
- Should work on: Windows
- Font rendering may vary by OS (especially
fontWeight,letterSpacing)
Critical Requirement:
- Extension requires ModalEdit for mode detection
- Without ModalEdit: Extension shows warning and displays insert mode styling only
- Mode detection relies on cursor style changes from ModalEdit
- See Prerequisites for installation instructions
Cursor Style Detection:
- Detects mode based on cursor style (block = normal, line = insert, underline = visual/search)
- Requires ModalEdit cursor styles to be configured
- Conflicting extensions (VSCodeVim, Vim, NeoVim) will break mode detection
Screen Readers:
- ✅ Decorations are visual only, don't affect text content
- ✅ Screen readers can read code normally
Color Blindness:
- Default colors may not be distinguishable for some users
- Solution: Configure high-contrast colors or use different border styles (dotted vs solid vs dashed)
- High contrast themes (
darkHC,lightHC) provide accessibility-focused defaults
Keyboard Navigation:
- Extension does not interfere with keyboard navigation
- All functionality works without mouse
Items not currently supported but may be added in future versions:
- Animation/Transitions: VS Code API doesn't support CSS transitions
- Multi-line Highlighting: By design, only current line is highlighted
- Custom Shapes: Limited to CSS border/outline properties
- Before/After Content:
beforeandafterdecoration properties exist but are complex to configure
See DEVELOPMENT.md for development workflow and contribution guidelines.
- VS Code 1.106.0+ (High Contrast Light theme support requires this API version)
- Required: ModalEdit extension
- With ModalEdit: Full 4-mode detection (normal/insert/visual/search)
- Without ModalEdit: Extension shows warning and displays insert mode styling only
- See Prerequisites section for installation instructions
Symptoms: Extension installed but no border appears on current line.
Diagnosis & Fix:
- Verify ModalEdit installed: Extensions → Search "ModalEdit" → Check if installed
- Test mode switch: Press
Esc(Normal mode) → Should see green dotted border - Check enabled setting: Settings → "modaledit-line-indicator.enabled" should be
true - View logs: Command Palette → "ModalEdit Line Indicator: Show Log File"
- Look for "ModalEdit extension FOUND" or "NOT FOUND"
- Check for any ERROR entries
- Restart VS Code: Sometimes required after first install
Without ModalEdit: Extension works but always shows insert mode (red solid border). Install ModalEdit for full 4-mode support.
Symptoms: Colors don't match your dark/light theme, or invisible in high contrast.
Diagnosis & Fix:
- Check theme detection: View logs (Output Channel) for "Color theme changed to: X"
- Verify theme kind: VS Code uses 4 kinds (dark, light, darkHC, lightHC)
- Add theme override: Settings → Add
darkorlightconfiguration:{ "modaledit-line-indicator.normalMode": { "dark": { "border": "2px dotted #00ffff" }, "light": { "border": "2px dotted #0000ff" } } } - Test switching: Change theme → Colors should update immediately
- High contrast: Use
darkHCandlightHCwith thicker borders (e.g.,"border": "4px dotted #ffffff")
Symptoms: Cursor movement feels sluggish, high CPU usage.
Expected: Smooth performance on modern hardware (<5% CPU, <5ms decoration updates).
Diagnosis & Fix:
- Check CPU usage: Activity Monitor/Task Manager → VS Code process
- If high CPU (>10%):
- Disable other decoration extensions temporarily
- Check for conflicting extensions (other vim/modal editing tools)
- Verify no infinite loops in logs (shouldn't happen, but check)
- If consistently slow:
- Report as performance bug with system specs
- Include CPU model, RAM, VS Code version
- Attach logs showing decoration update times
Temporary disable: Command Palette → "ModalEdit Line Indicator: Toggle Enabled/Disabled"
Symptoms: Border present but hard to see against background.
Diagnosis & Fix:
- Identify theme colors: Check your theme's background color
- Add high-contrast colors: Settings → Override border for better visibility:
{ "modaledit-line-indicator.normalMode": { "border": "3px solid #00ff00" // Bright green, thicker, solid style } } - Test different styles: Try
"border": "2px solid #00aa00"instead of"2px dotted #00aa00"for better visibility - Add background: Use semi-transparent background for extra visibility:
{ "modaledit-line-indicator.normalMode": { "border": "2px solid #00ff00", "backgroundColor": "rgba(0, 255, 0, 0.1)" // Subtle green tint } }
Symptoms: Border never changes from red, regardless of mode switching attempts.
Root Cause: ModalEdit extension not installed, not active, or not properly configured.
Diagnosis (4-step):
-
Check ModalEdit installation:
- Extensions panel → Search "ModalEdit"
- Verify "ModalEdit" by johtela is installed
- If not installed → See Prerequisites
-
Check ModalEdit configuration:
- Open Settings → Search "modaledit"
- Verify cursor style settings exist:
{ "modaledit.normal.cursorStyle": "block", "modaledit.insert.cursorStyle": "line" } - If missing → Add cursor style configuration
-
Test ModalEdit independently:
- Open any file
- Press
Esc(should enter Normal mode) - Expected: Cursor changes to block
- If cursor doesn't change: ModalEdit not working - see ModalEdit docs
-
Run diagnostic command:
- Command Palette → "ModalEdit Line Indicator: Query Current Mode (Debug)"
- Check if ModalEdit is detected
- Review output for configuration issues
Resolution:
- Install and configure ModalEdit properly (see Prerequisites)
- Ensure ModalEdit cursor styles are configured
- Restart VS Code after configuration changes
Symptoms: Extension stops working after installing VSCodeVim, Vim, NeoVim, or similar extensions.
Root Cause: Multiple extensions competing for cursor style control.
Incompatible Extensions:
- ❌ VSCodeVim - Conflicts with ModalEdit cursor styles
- ❌ Vim - Conflicts with ModalEdit cursor styles
- ❌ NeoVim - Conflicts with ModalEdit cursor styles
- ❌ Dance - May conflict depending on configuration
- ✅ ModalEdit - Required and fully compatible
Resolution:
-
Choose ONE modal editing extension:
- If you want to use this extension → Use ModalEdit exclusively
- If you prefer VSCodeVim/Vim/NeoVim → Uninstall this extension
-
Remove conflicting extensions:
- Extensions panel → Search for conflicting extensions
- Uninstall all vim/modal extensions except ModalEdit
- Restart VS Code
-
Verify ModalEdit works alone:
- Test mode switching (
Esc,i,v) - Confirm cursor styles change
- Confirm line borders appear and change colors
- Test mode switching (
Why this happens: Multiple extensions trying to control cursor styles interfere with each other. This extension relies on ModalEdit's cursor style changes for mode detection. Other vim extensions override these styles, breaking detection.
Required for: Proper mode detection and visual feedback.
Quick Configuration:
Add to your settings.json:
{
"modaledit.normal.cursorStyle": "block",
"modaledit.insert.cursorStyle": "line",
"modaledit.visual.cursorStyle": "underline"
}Full ModalEdit Documentation:
Diagnostic - Verify Configuration:
-
Run diagnostic command:
- Command Palette → "ModalEdit Line Indicator: Query Current Mode (Debug)"
- Shows current mode and ModalEdit status
-
Test cursor changes:
- Press
Esc→ Cursor should become a block - Press
i→ Cursor should become a line - Press
v→ Cursor should become an underline
- Press
-
If cursor doesn't change:
- Check Settings → "modaledit" → Verify cursor style settings
- Check for conflicting extensions (see "Conflicts with other vim/modal extensions" above)
- Restart VS Code
- See ModalEdit troubleshooting
Tip: This extension uses cursor style changes to detect modes. If ModalEdit cursor styles aren't configured, mode detection won't work properly.
Access via: Command Palette (Cmd+Shift+P / Ctrl+Shift+P) → Type command name
- "Show Log File": Open detailed diagnostic logs (includes mode detection, theme changes, errors)
- "Query Current Mode (Debug)": Shows currently detected mode + ModalEdit status
- "Toggle Enabled/Disabled": Temporarily disable extension to test if it's causing issues
- "Clear Log File": Reset logs before reproducing a bug for clean log output
If issues persist after trying above solutions:
-
Collect diagnostics:
- Run "Clear Log File" command
- Reproduce the issue
- Run "Show Log File" command
- Copy relevant log entries
-
Check existing issues: GitHub Issues
-
File new issue with:
- VS Code version (
Help → About) - Extension version (Extensions panel)
- ModalEdit version (if installed)
- OS and version
- Steps to reproduce
- Relevant log entries
- Screenshots (if visual issue)
- VS Code version (
MIT
Contributions welcome! Please submit issues and pull requests on GitHub.
See CHANGELOG.md for version history and release notes.