F4 edits. That is the orthodox verb — Total Commander, Far, Midnight Commander — and in cwdio it means one of two things: the built-in quick editor, which is Quick Look’s edit mode, or the external editor you already use. You pick the default once; the other is always one chord away.
What it does
- Built-in quick editor. A CodeMirror 6 editor inside the Quick Look overlay: syntax highlighting per language, line numbers, bracket matching, multi-cursor, find/replace (Ctrl+F), go to line (Ctrl+G), history, optional word wrap. F4 flips a preview into editing, F3 flips back, Ctrl+S or F2 saves. Loaded lazily, so it costs nothing until you use it.
- External editor. Detected installs, or a custom command. A known editor opens at the right line and
column — VS Code family, Notepad++, Sublime, Zed — and a folder opens as a project in editors that take
one. A terminal editor (
nvim,nano,micro,hx…) runs in the embedded terminal, in the panel’s folder, with+linewhere the editor understands it. - Byte-faithful, in-place saves. The file’s encoding, BOM, line endings and trailing newline are kept; the file is written in place. Before the write, the previous bytes are copied into the overwrite stash, so Ctrl+Z after a save restores the earlier version through the same undo as a move.
- Refuses to clobber. A save checks that the file has not changed since it was read and that it is writable; a conflict, a vanished file or a read-only attribute each raise a banner with explicit actions rather than failing silently or overwriting.
- From a search hit. F4 on a content-search result opens the file at its first matching line.
How to use it
- Put the cursor on a text file and press F4. By default the built-in editor opens for a local text file up to 8 MiB; larger or binary files go to the external editor, and the notice offers it.
- Edit, then Ctrl+S. The status line confirms Saved, with the encoding and EOL it kept.
- Change your mind? Ctrl+Z in the panel restores the previous bytes.
- Shift+F4 asks for a name, creates the file and drops you straight into the editor.
- Force the choice for one file: Ctrl+E is always the external editor, Ctrl+Shift+F4 always the built-in one (Far’s “force internal”).
Preferences ▸ Editor holds the two decisions: F4 opens (built-in or external) and External editor (default, each detected editor, or a custom command with arguments and an option to run it in the embedded terminal).
Where it works
| Target | Built-in (default) | External |
|---|---|---|
| Local text file ≤ 8 MiB | Quick Look edit mode | Your editor, at the line |
| Larger or binary file | External editor (offered) | External editor |
| Folder | External editor opens the folder | same |
sftp:// / ftp:// text | Edited in place through the provider | Terminal editor in the SSH shell |
| Inside an archive | Opens read-only | same |
The built-in editor also watches the file: an external change while the buffer is clean reloads silently, like the file list does; with unsaved edits you get a Reload / Keep editing banner.
What it deliberately does not do
- It does not run editors through a shell string. An external launch is argv-only, a
.cmdshim is refused, and a bare command name is resolved onPATH— so a file name can never be interpreted as arguments. - It does not silently reformat, re-encode or normalise. If a file has mixed line endings, the status line says so and the save keeps the dominant style.
- It does not save into archives, and it does not (yet) round-trip a remote file through a GUI editor via a temp copy; remote text goes to the built-in editor or a terminal editor instead.
Related
- Quick Look and preview — the same overlay in view mode.
- Undo and the safety net — the stash a save’s previous bytes go to.
- Terminal sync — where a terminal editor runs.