Function Signature
Parameters
Configuration options for the Vim extension.
When
true, displays a status bar showing the current Vim mode (NORMAL, INSERT, VISUAL, etc.). Defaults to false.Returns
A CodeMirror 6 extension that includes:
- Vim keybindings and modal editing
- Visual block cursor styling
- Native selection hiding in normal/visual modes
- Optional status bar panel
Description
Thevim() function returns a CodeMirror 6 extension that enables Vim-style modal editing with support for normal, insert, visual, and command modes. It provides a comprehensive Vim experience including:
- All standard Vim motions and operators
- Visual mode (character, line, and block)
- Ex commands
- Registers and marks
- Search with highlighting
- Custom block cursor rendering
Usage
Important Notes
If you are not using
basicSetup, make sure to include the drawSelection plugin from @codemirror/view to correctly render selections in visual mode.Extension Ordering
Correct extension ordering is crucial for proper Vim functionality:See Also
- getCM() - Access the CM5 compatibility API
- Vim object - Configure Vim behavior

