# Vim compatibility

Canonical HTML: [Vim compatibility](https://getred.dev/docs/reference/vim). Website source: `b212874eefaf200143affa21c770fbb8855a4f5c`. Documented Red release: v0.9.1. Installer source: `b86a2ca4b92e9547d3b174910c82db8a259f5171`.

See which Vim-style editing behaviors Red supports and where its defaults or command language intentionally differ.

<a id="supported-editing-model"></a>

## Supported editing model

| Area         | Red behavior                                                                                             |
| ------------ | -------------------------------------------------------------------------------------------------------- |
| Modes        | Normal, Insert, Visual, Visual Line, Visual Block, and Command                                           |
| Motions      | Basic, word, line, paragraph, sentence, find/till, screen-line, matching-bracket, and structural motions |
| Operators    | Delete, change, and yank with supported motions and text objects                                         |
| Text objects | Words, sentences, paragraphs, delimiters, quotes, calls, functions, classes, and comments                |
| Repeat       | Counts, dot-repeat, macro recording and playback, undo branches, and jump lists                          |
| Selections   | Character, line, block, mouse, and multi-cursor editing with Unicode grapheme boundaries                 |
| Search       | Forward and backward search, history, substitution ranges, flags, and confirmation                       |
| Windows      | Split navigation, movement, resizing, balancing, zoom, and docked-pane focus                             |

<a id="important-differences"></a>

## Important differences

- Search and substitution use Rust regular-expression syntax rather than Vim's regex dialect.
- Red implements a documented Ex subset and doesn't run Vimscript.
- `Ctrl-e` opens the file tree, and `gW` toggles wrapping.
- Interactive named text-register selection such as `"a` isn't implemented, though named registers work for macros.
- A confirmed substitute is one undoable transaction but doesn't become a dot-repeat recipe.
- Shell commands are non-interactive. `:read !`, `:write !`, and Normal-mode filter operators aren't supported.

<a id="look-up-exact-behavior"></a>

## Look up exact behavior

The versioned compatibility matrix records supported behavior, intentional differences, and items not yet supported.

[Open the complete compatibility matrix](https://github.com/codersauce/red/blob/main/docs/VIM_COMPATIBILITY.md)
