Writing & reading text

KooperEdit ke

A terminal text editor modelled on QEdit, the classic DOS editor, with JavaScript scripting built in.

Runs
In a terminal
Platforms
Linux, macOS, Windows, FreeBSD
Built with
Go, tcell, goja (JavaScript)
Latest release
v1.0.0, 4 December 2026
Licence
Apache 2.0

Overview

QEdit, from SemWare, was the editor a lot of us lived in under DOS: instant to start, white text on a blue screen, and every command a keystroke away. KooperEdit (ke) brings that editor to the modern terminal. It keeps the look, the pull-down menus, the QEdit and WordStar keys, line, column and character blocks, keyboard macros and split windows.

It also adds what a modern editor should have:

  • an optional VS Code keyboard layout, with Shift+arrow selection and Ctrl-C/X/V/Z;
  • mouse support, including a right-click menu;
  • a built-in file explorer;
  • JavaScript scripting for automation and customisation;
  • a script workspace: a split screen where you write JavaScript that cleans up or converts the document beside it, with an output pane.
Starting the editor
ke notes.txt        # edit a file (a new one if it doesn't exist)
ke '*.go'           # quoted: open the file explorer showing Go files
ke src/             # open the file explorer in src/
ke +120 main.go     # start at line 120
ke --keys vscode    # use the VS Code layout (remembered)
ke -s fix.js data   # run a JavaScript file after loading

Press Esc (QEdit layout) or F10 (VS Code layout) for the menus, and F1 for help (in the VS Code layout F1 is the command palette). The version is on the opening screen and in Help → About, and Help → What's new lists the changes in each release.

Download

KooperEdit 1.0.0 — First Release · v1.0.0 · released 4 December 2026 · release notes · all releases

Unpack the archive and put ke (ke.exe on Windows) somewhere on your PATH. SHA256SUMS has the checksum of every file: sha256sum -c SHA256SUMS --ignore-missing (shasum -a 256 -c on macOS).

The binaries aren't signed, so macOS may refuse to open one downloaded with a browser: allow it under System Settings → Privacy & Security, or run xattr -d com.apple.quarantine ke. On Windows, SmartScreen may ask you to choose More info → Run anyway.

With Go
go install github.com/colboycolinmeeks/kooperedit/cmd/ke@latest

Screenshots

The pull-down menus

Two keyboard layouts

There are two complete layouts. QEdit (the default) has QEdit's Alt keys plus the WordStar Ctrl keys and the Ctrl-K, Ctrl-Q and Ctrl-O two-key commands. VS Code has the keys most people know today. Switch with Misc → VS Code keys, in Settings, or with ke --keys vscode; the choice is remembered.

QEdit layout (default)VS Code layout
MenusEscF10, Esc, Alt+menu letter
Open file / explorerAlt-E (Enter on the empty prompt browses)Ctrl-O, Ctrl-P
Save / quitCtrl-K S / Alt-XCtrl-S / Ctrl-Q
SelectAlt-A / Alt-L / Alt-K (char/line/column), Shift+arrowsShift+arrows, Ctrl-A, Ctrl-L, Ctrl-D
Copy / cut / pasteCtrl-Ins / Shift-Del / Shift-InsCtrl-C / Ctrl-X / Ctrl-V
Undo / redoAlt-Backspace / Ctrl-Q O, plus Ctrl-U unkillCtrl-Z / Ctrl-Y
Find / replace / againCtrl-Q F / Ctrl-Q A / Ctrl-LCtrl-F / Ctrl-R / F3
Script workspaceAlt-Y, then F5 to runsame
Line numbersF12, Ctrl-K NF12
Help / What's new / AboutF1, Help menuCtrl-K H, Help menu (Alt-H)

Some keys work in both: Shift+arrow selection, Alt-Up/Down to move lines (add Shift to copy them), Ctrl-/ to comment or uncomment using the right prefix for the file type, and F12 for line numbers. Misc → List commands shows every command, and you can run one straight from the list.

Blocks, the QEdit way

KooperEdit has QEdit's three kinds of block. Only one exists at a time, and in the QEdit layout it stays marked while you move around, so you can mark something, go somewhere else and copy or move it there.

TypeMark withCovers
CharacterAlt-A … Alt-A, or Ctrl-K B … Ctrl-K KText from one character to another
LineAlt-L … Alt-LWhole lines
ColumnAlt-K … Alt-KA rectangle of columns, which is ideal for tables
KeyBlock command
Alt-CCopy the block to the cursor
Alt-MMove the block to the cursor, even between files
Alt-GDelete the block (bring it back with Ctrl-U, unkill)
Alt-FFill the block with a character
Alt-W / Alt-RWrite the block to a file / read a file in as a block
Block → SortSort the lines; with a column block, sort by those columns
F7 / F8Shift the block's lines left or right

Copy and cut with nothing selected act on the current line, the way both QEdit and VS Code behave. Copies also go to your system clipboard through the terminal (OSC 52) where the terminal allows it. Unkill keeps the last 50 deletions, and Restore line (Ctrl-Q L) puts the cursor line back the way it was when you arrived on it.

Files, windows and macros

Open files with Alt-E (or Ctrl-O). Pressing Enter on the empty prompt, or typing a folder or a wildcard such as src/*.go, opens the file explorer: Enter opens, Backspace goes up, ~ goes home, . shows hidden files, and typing jumps to a name.

  • Saving is safe: the file is written to a temporary file and then renamed, so a failed save can't truncate it. Optional .bak backups keep the previous version.
  • Line endings: Windows (CRLF) files are detected and kept that way.
  • Windows: split the screen into up to eight windows. Windows on the same file share the text, and you can zoom, grow and shrink them.
  • Placemarks: Ctrl-K 0–9 set one and Ctrl-Q 0–9 jump back to it, across files.
  • Keyboard macros: Ctrl-K M records your keystrokes onto any key you choose; macros can answer prompts too, and can be saved and loaded.
  • Shell: F9 drops you into your shell, and Alt-F9 runs one command and shows its output.
  • Printing: pipes the file or block into lpr, or any command you set.

The mouse

Click to place the cursor, drag to select, double- and triple-click for words and lines, middle-click to paste. Right-click opens a menu with cut, copy, paste, select, undo, find the word under the pointer, comment, indent and sort, and Open file when the text under the pointer names a file that exists, including forms like path/to/file.go:42.

JavaScript scripting

KooperEdit has a JavaScript engine (goja) built in, with an editor object that can read and change text, run any command, bind keys, add commands and menu items, show prompts and lists, and react to events. Modern JavaScript works: let/const, arrow functions, classes, destructuring, Map and Set, optional chaining, regex named groups and lookbehind.

Where scripts runHow
At start-up~/.config/kooperedit/init.js, then every scripts/*.js in name order
In the script workspaceWrite a script beside a document and press F5
One-offCtrl-K J evaluates a line; ke -s file.js runs a file at start-up
Keys, menus and hooksFunctions given to bindKey, addCommand, addMenuItem and on
init.js
// Wrap the selection in quotes, on Alt-'
editor.addCommand("Quote", "Wrap selection in double quotes", () =>
  editor.replaceBlock(t => '"' + t + '"'));
editor.bindKey("Alt-'", "Quote");

// Makefiles need real tabs
editor.on("open", name => {
  editor.option("expandTabs", !/(^|\/)(GNU)?[Mm]akefile$|\.mk$/.test(name));
});

// Count words in the selection or the file
editor.addCommand("WordCount", "Count words", () => {
  const b = editor.block();
  const n = (b ? b.text : editor.text()).split(/\s+/).filter(Boolean).length;
  editor.message(n + " words");
});

Every command in the editor can be bound to a key, run by name or called with editor.exec("Command"). A whole script run is a single undo step.

The script workspace

The script workspace is for small programs that work on the document you're editing: cleaning up messy text, applying a batch of regex fixes, converting one format to another, or pulling information out of a file. Press Alt-Y and the screen splits in three:

┌──────────────────────┬──────────────────────┐
│ document             │ script (JavaScript)  │
│ (what the script     │                      │
│  works on)           ├──────────────────────┤
│                      │ output               │
└──────────────────────┴──────────────────────┘
  • F5 runs the script against the document, and a whole run is one undo step.
  • print() and console.log() write to the output pane, along with how long the run took and whether the document changed.
  • If the script fails, the cursor jumps to the line with the error.
  • editor.newDocument() puts the result in a new document and leaves the original untouched, which is ideal for conversions.
A workspace script
// Convert "key=value" lines to JSON in a new document
const obj = {};
for (const l of editor.lines()) {
  const m = l.match(/^\s*([^=#]+?)\s*=\s*(.*)$/);
  if (m) obj[m[1]] = m[2];
}
editor.newDocument(JSON.stringify(obj, null, 2), "config.json");
print(Object.keys(obj).length + " keys");

Script → Examples has ready-made scripts to start from: tidy whitespace; CSV → JSON, JSON → CSV and CSV → Markdown table; pretty-print JSON; sort and remove duplicate lines; several regex rules in one pass; extract matches; INI → JSON; lines → SQL; number lines; and statistics.

Settings and configuration

Misc → Settings lists the options. They're saved when you close the list and when you exit, to ~/.config/kooperedit/settings.json (or $KOOPEREDIT_HOME, or $XDG_CONFIG_HOME/kooperedit).

SettingDefault
Keyboard layoutqedit
Mouse, line numbers, insert mode, auto indentOn
Word wrapOff
Right / left margin72 / 0
Tab width / expand tabs8 / On
Show end-of-file markerOn
Make .bak backupsOff

Colours come from the fixed 256-colour palette, so the classic white-on-blue look isn't changed by your terminal's colour scheme.

Building from source

KooperEdit builds with Go 1.24 or newer (the module asks for a newer toolchain, which Go downloads for you) and runs in any modern terminal: xterm, GNOME Terminal, iTerm2, Windows Terminal, kitty and so on. The repository's SCRIPTING.md and docs/ folder have the full user guide, scripting reference and command list.

make                 # builds ./bin/ke
./bin/ke notes.txt
make install         # copies ke to /usr/local/bin (PREFIX=~/.local for your home dir)
make release         # builds for Linux, macOS, Windows and FreeBSD