Skip to content

Latest commit

 

History

History
83 lines (54 loc) · 2.98 KB

File metadata and controls

83 lines (54 loc) · 2.98 KB

K21 Features

This document summarizes the changes in k21 (fork of joe2.1), organized by function.

Identity & Branding

  • Renamed from Joe to K: The editor is now called "k" instead of "joe"
  • Binary output is k (not joe, jmacs, jstar)
  • Configuration file is krc (not joerc)
  • Crash recovery file renamed from DEADJOE to DEADK
  • Error messages reference "K" instead of "JOE"

Session Persistence / Context Saving

  • Automatic context saving: On exit, saves current file and line number to ~/.ktx
  • Session resume: When launched without arguments, automatically re-opens the last edited file at the saved line position
  • Displays "Resuming at line ." message on restore

File Locking

  • Advisory file locking:
    • Uses flock() to lock files when opened for editing
    • Prevents concurrent editing of the same file
    • New error message: "Error, file locked" when file is already locked
    • Lock released on buffer close

Enhanced Backup System

  • Timestamped backups:
    • Backup filenames include date/time stamp: file~DD-Mon-YY_HH:MM:SS~username
    • Backups organized by user in backpath: creates per-user subdirectory
  • Improved error messages show actual backup filename on failure

New Commands

  • pgfwd: Page forward (J-compatible mode) — goes to bottom of screen, then pages down
  • pgrev: Page reverse (J-compatible mode) — goes to top of screen, then pages up
  • playlast: Execute the most recently recorded/executed macro without specifying number

Macro Improvements

  • Automatic macro closing: If you try to execute a macro that's still recording, it auto-stops recording first
  • Last macro tracking: Remembers which macro was last recorded/played for playlast

Help Navigation

  • Circular help navigation: Help screens now cycle — pressing next on last help returns to first, pressing prev on first goes to last
  • Help toggle behavior: If help is off, next/prev help turns it on; cycling past end turns it off

Terminal Handling

  • Disabled terminal exit sequence (te termcap) on exit — prevents screen clearing

Yank Behavior

  • Cursor remains at start of yanked text (original joe moved to end)

Filter Behavior

  • Block marks are preserved after filter operations (original joe cleared them)

Exit Messages

  • Suppressed "not changed so no update needed" message on exit for unchanged files

File Permissions

  • Default umask set to 002 for better group collaboration

Default Configuration (krc)

  • -marking enabled by default (live block highlighting)
  • -lightoff enabled by default (highlighting clears after block operations)
  • -force enabled by default (force final newline)
  • -backpath set to /var/tmp/kback/
  • -nonotice enabled (disables copyright notice)
  • Custom keybindings using ^P, ^L, ^^ as prefix keys
  • Custom help screens adapted for K bindings

New Files in k21

  • krc — K configuration file
  • keys.tpt — Keyboard template/reference showing key bindings