zwsh is a zsh mode that replaces the default line editor with WordStar/Zpm3-style keybindings. If you grew up with WordStar, Turbo Pascal, or Borland IDEs, you’ll feel right at home.
Features:
- Classic WordStar cursor movement (
^E~/~^X~/~^S~/~^D, words, lines, document) - Block select, copy, move, delete, write-to-file (
^KB~/~^KK~/~^KC~/~^KV~/~^KY~/~^KW) - Multiline command editing with a built-in editor mode (
^KE~/~^KS) - File import and export (
^KR~/~^KX) with sudo support - Incremental history search (
^QF,^Lrepeat,^W~/~^Zprefix search) - Paste from clipboard (
^KC~/~^KVwhen no block selected) - Unerase last deleted text (
^U) - Special folder shortcuts in prompt and on the command line
- User configuration via
~/.zwrc
- Zsh 5.0 or later
git clone <repository-url> zwsh
cd zwsh
sudo ./zwshinst.shThe installer copies files to /opt/zwsh and adds the startup line to
~/.zshrc. To update an existing installation:
sudo ./zwshupd.shTo uninstall, remove the source line from ~/.zshrc and delete
/opt/zwsh.
Once installed, open a new terminal. You are now in WordStar mode.
| Key | Action |
|---|---|
^S | character left |
^D | character right |
^E | line up / history ↑ |
^X | line down / hist ↓ |
^A | word left |
^F | word right |
^QS | beginning of line |
^QD | end of line |
^R | start of document |
^C | end of document |
| Key | Action |
|---|---|
^G | delete char right |
^H | delete char left |
^T | delete word right |
^Y | delete entire line |
^QY | delete to end of line |
^Q^H | delete to begin of line |
| Key | Action |
|---|---|
^KB | mark block begin |
^KK | mark block end |
^KC | copy block (or paste) |
^KV | move block (or paste) |
^KY | delete block |
^KW | write block to file |
^KH | hide/show block |
^QB | go to block begin |
^QK | go to block end |
| Key | Action |
|---|---|
^KR | import text from file |
^KS | save buffer to file + edit |
^KX | save buffer to file |
^KE | open file in editor mode |
^KD | exit editor, text → buffer |
^KQ | quit zsh (with confirmation) |
| Key | Action |
|---|---|
^QF | incremental history search |
^L | repeat last search |
^W | history search backward |
^Z | history search forward |
^QR | beginning of history |
^QC | end of history |
| Key | Action |
|---|---|
^R | page up |
^C | page down |
^W | scroll up one line |
^Z | scroll down one line |
^QE | go to top of screen |
^QX | go to bottom of screen |
^QR | go to start of document |
^QC | go to end of document |
^KF | toggle fullscreen |
| Key | Action |
|---|---|
^U | unerase (paste last deleted text) |
^P | insert control character |
^V | toggle insert/overwrite mode |
^N | split line (insert newline) |
^J | help (run-help) |
^I | tab completion |
^KM | execute buffer, result → buffer |
Esc | send break |
Create ~/.zwrc to define special folders and other settings.
This file is sourced after zwsh loads.
typeset -A zw_special_folders
zw_special_folders[PROJ]=~/projects
zw_special_folders[DOC]=~/Documents
zw_special_folders[TMP]=/tmpWith these defined, you can type PROJ:subdir on the command line
and it will expand to ~/projects/subdir. The prompt also shows
the short folder name.
When opening a file with ^KE or ^KR that requires root access,
zwsh will prompt for a sudo password and read/write via sudo.
- Column block mode (
^KN) is not yet implemented - Undo/redo is not available
- Find/replace within the editor is not implemented
- Tab characters in fullscreen editor are not properly handled
Detailed module documentation is in the doc/ directory:
- wskeys — key reference and binding scheme
- wsblock — block operations
- wsedit — editor mode
- wsfind — find / history search
- wsdialog — dialog framework
- wsline — single-line input
- wstext — text variable abstraction
- wstxtfun — pure text navigation functions
GPLv3 — see LICENSE.