Files
wen/README.org
T

45 lines
1.7 KiB
Org Mode
Raw Normal View History

2026-10-26 03:01:40 +00:00
* 文 (wen)
[[file:wen.jpg]]
~wen~ is an experimental terminal text editor, written during the Winter 2022 batch at the [[https://www.recurse.com/][Recurse Center]]. It was an exploration of terminal raw mode, ANSI escape sequences, and UTF-8 / wide-character glyph rendering. It works only as a very simple text editor.
A motivating idea behind ~wen~ was to keep the editor itself minimal. Text manipulation would be delegated to external programs and saved shell snippets. Selected regions would be piped through standard input and output; for example:
- Convert case: ~tr '[:lower:]' '[:upper:]'~
- Sort and deduplicate lines: ~sort -u~
- Reflow paragraphs or align columns: ~fmt -w 72~, ~column -t~
- Search and replace: ~sed 's/foo/bar/g'~
This piping mechanism was left unimplemented, along with undo/redo, line numbers, jumping to characters, Unicode combining marks, and bidirectional text support.
** Usage
#+begin_src shell
wen [file]
#+end_src
If no file is specified, ~wen~ opens a scratch buffer in ~$XDG_CACHE_HOME/wen/scratch~.
Logs are written to ~$XDG_CACHE_HOME/wen/log~.
** Controls
|-------------------+-------------------------|
| Key | Action |
|-------------------+-------------------------|
| Arrow keys | Move cursor |
| =Home= / =End= | Start / end of line |
| =PageUp= / =PageDown= | Scroll up / down a page |
| =Ctrl-s= | Save buffer |
| =Ctrl-x= | Save buffer as |
| =Ctrl-q= | Quit |
| =Escape= | Cancel prompt |
|-------------------+-------------------------|
** Installation
#+begin_src shell
go install code.chimeric.al/dwrz/wen/cmd/wen@latest
#+end_src