editor 0.2 and liner 0.5 ====================== Two small, single-file text editors with no ncurses dependency. editor is a full-screen C program. Move around the text with the arrow keys and type directly. Esc opens its command prompt. It uses the C library and Unix terminal interfaces, without curses or terminfo. liner is a shell script for editing numbered lines with typed commands. It needs /bin/sh, awk, and ordinary Linux/OpenBSD base utilities. No compiler, curses, readline, Python, Bash, or external editor is needed. Its optional page command provides an immediate-key scrolling view. Both edit one file at a time, support undo and redo, and limit the file to 8 MiB (8,388,608 bytes). NUL-containing input files are refused. QUICK START Build editor by naming its source file explicitly: cc -std=c99 -O2 -Wall -Wextra -pedantic editor.c -o editor ./editor notes.txt Use a VT/xterm-compatible terminal. Type to insert text. To save, press Esc, type write, then press Enter. To leave, press Esc, type quit, then press Enter. An unnamed buffer needs write followed by a filename. Run liner directly with the shell: sh liner.sh notes.txt At liner>, type show to see the file. Use change 3 to replace line 3, insert 1 to add a line at the beginning, or delete 3 to remove line 3. change and insert ask for one complete line at Text>. Then use write and quit. Line numbers start at 1; insert with the line count plus one appends a line. An empty file starts with insert 1. In either editor, write new name.txt saves to that literal filename. Do not put shell quotes around filenames inside the editor. At the shell prompt, quote filenames normally: ./editor 'my notes.txt' sh liner.sh 'my notes.txt' READING THE DOCUMENTATION ./editor --help ./editor --manual ./editor --about sh liner.sh --manual sh liner.sh --about In editor, Esc then help gives quick command help. The manual and about commands open read-only views. Up/Down scroll; Page Up/Page Down move by a screen; Home/End go to the beginning/end; q or Esc returns to text. In liner, help prints the command names on one line. manual prints the full instructions, and about prints the credits and warning. A partial command followed by Enter suggests matching names without running them. For example, ch suggests change. Type the complete command to use it. Plain-text manuals: docs/editor.txt and docs/liner.txt. Manpage sources: docs/editor.1 and docs/liner.1. liner --help and -h also print its full manual. CHOOSING BETWEEN THEM Use editor for direct typing, cursor movement, and horizontal scrolling through long lines. Its undo history is held in memory. There is no automatic recovery file; an abnormal exit can lose unsaved edits. Use liner for deliberate, numbered-line changes and operation without a compiler. show prints the requested text; page scrolls longer output and displays progress. Undo uses complete snapshots in a private temporary directory. A handled exit with unsaved edits retains them and prints the current snapshot's path. Temporary files are not a guarantee against power loss or later cleanup. Both preserve unchanged bytes and existing LF/CRLF line endings. editor does not add a final newline automatically. liner preserves a missing final newline except when a blank final line needs one to remain a line. editor moves through UTF-8 by code point, not grapheme cluster. liner displays non-ASCII bytes as escapes. Read the manuals for these limits. Both stage writes beside the destination and refuse to overwrite an unrelated existing file. External changes and multiple hard links need a new save path. editor resolves symbolic links to their targets when opening; liner requires a new save path for a symbolic link. Neither editor locks out another process that writes the same file. OPTIONAL LOCAL INSTALLATION These commands use a local prefix for Linux or OpenBSD. Build editor first. mkdir -p "$HOME/.local/bin" "$HOME/.local/share/man/man1" install -m 755 editor "$HOME/.local/bin/editor" install -m 755 liner.sh "$HOME/.local/bin/liner" install -m 644 docs/editor.1 docs/liner.1 "$HOME/.local/share/man/man1/" export PATH="$HOME/.local/bin:$PATH" Then run editor FILE or liner FILE. Read the installed manual pages with: man -M "$HOME/.local/share/man" editor man -M "$HOME/.local/share/man" liner On Linux, man -l docs/editor.1 and man -l docs/liner.1 can read the source pages without installing them. On OpenBSD, use mandoc docs/editor.1 or mandoc docs/liner.1. If neither tool is available, read the .txt manuals. CREDITS design by remfan1994 published by ThatIAm.vip BLOODGUILT CURSE Cows aren't killers, and beef is the bloodshed of the innocent. www.bloodguiltcurse.net has the Bible study