Native RTL Editing
Real right-to-left editing for Hebrew, Arabic and Persian in the VS Code editor.
Lines that start with an RTL letter align right and behave like RTL text:
- Clicks, double-clicks and drag-selection land on the character you point at.
- Arrow keys move visually: ← goes left on screen, including word jumps (⌥/Ctrl + arrow) and line jumps (⌘ + arrow).
- Mixed lines stay readable: English words, numbers and links inside Hebrew text keep their natural order.
- Latin lines are untouched, so a Markdown file can mix English headings with Hebrew paragraphs.
By default it applies to .md, .markdown and .txt files.
Why this exists
VS Code's editor always lays out lines left-to-right. CSS tricks and existing "RTL" extensions either paint text
right-aligned while the cursor and selection still think it's left-to-right, or open the file in a separate
editor pane.
VS Code actually ships a complete per-line RTL engine for rendering, cursor movement and mouse hit-testing, but
only turns it on internally. This extension switches that engine on for lines that start with an RTL letter, so
it's the real editor doing real RTL, not an imitation.
How it works (read this)
There's no public API for this, so the extension modifies VS Code's installation files:
- It adds a one-line hook to
workbench.desktop.main.js and a small script next to workbench.html.
- It updates the matching integrity checksums in
product.json, so you won't get a "corrupt installation" warning.
- Every change sits between markers and is removed exactly. Disabling or uninstalling restores byte-identical stock files.
- VS Code updates replace those files. On the next start the extension re-applies itself and asks you to restart once.
- If a VS Code release changes the internals, the extension detects it, changes nothing and shows a warning.
After enabling or updating, quit and reopen VS Code. A window reload is not enough.
Commands
| Command |
|
Native RTL: Enable |
Apply now (runs automatically on startup) |
Native RTL: Disable (restore stock VS Code) |
Remove all changes |
Uninstalling also restores stock VS Code; VS Code runs the cleanup on its next restart. For an immediate
clean removal, run Native RTL: Disable first, then uninstall.
Settings
| Setting |
Default |
|
nativeRtl.fileExtensions |
["md", "markdown", "txt"] |
Files where RTL lines become RTL. ["*"] = all files. Restart after changing. |
nativeRtl.autoEnable |
true |
Enable on startup and re-enable after VS Code updates. |
Requirements & notes
- VS Code 1.136+ (desktop). Forks like Cursor that are based on older VS Code builds don't have the RTL engine yet, so the extension reports them as unsupported.
- VS Code must be able to write to its own install folder:
- macOS: works out of the box for apps in
/Applications. If it's blocked, allow VS Code under System Settings → Privacy & Security → App Management.
- Windows: use the User installer (the System installer in Program Files is read-only).
- Linux: package installs under
/usr/share are root-owned, so use a user-writable install.
- A line's direction comes from its first letter, the same rule as HTML's
dir="auto".