Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   nia
Date:           Mon Oct 26 07:52:40 UTC 2026

Modified Files:
        src/distrib/sets/lists/base: mi
        src/distrib/sets/lists/debug: mi
        src/distrib/sets/lists/man: mi
        src/distrib/sets/lists/manhtml: mi
        src/usr.bin: Makefile
Added Files:
        src/usr.bin/atto: CHANGE.LOG.md Makefile README.md atto.1 buffer.c
            command.c complete.c display.c gap.c header.h hilite.c key.c main.c
            replace.c search.c window.c

Log Message:
atto(1): Initial import of tiny text editor, as discussed on
tech-userlevel@.

This is Hugh Barney's atto text editor modified for inclusion in
NetBSD. Since the upstream repository is inactive and the original
author wishes to keep the code base below 2000 lines of C, this is
effectively a fork that lives in usr.bin/atto. It serves as an
alternative to vi(1) for users more accustomed to modeless text
editors.

Notable changes include reworked keyboard input code to handle a wider
range of terminals (via libcurses cursor key translation), more useful
help for unrecognized key presses, and standardized option handling
using getopt (with syntax highlighting disabled by default).

Thanks martin and other folks for feedback and testing.

ATTO(1)                 General Commands Manual                ATTO(1)

NAME
     atto - simple modeless text editor

SYNOPSIS
     atto [-C] file ...

DESCRIPTION
     atto is a screen-based text editor.  It serves as an alternative
     to vi(1) for users who are not accustomed to text editors with
     separate insertion and editing modes, and includes support for
     editing UTF-8 text.

     Perhaps all that needs to be known to use atto at a basic level
     is that holding the control key, pressing x, then pressing w will
     write the currently open file, and holding the control key,
     pressing x, then pressing c will exit the editor.

     The options are as follows:

     -C          Use colours, if available, for basic language-unaware
                 syntax highlighting.

   Cursor movement commands
     C is used as an abbreviation for the control key, commonly
     rendered as "ctrl" on English language keyboards.

     Arrow keys or the navigation cluster can also be used to move the
     cursor when the keyboard has such features.

           C-a        move cursor to beginning of current line (i.e.
                      "home")
           C-b        move cursor back one character (i.e. "left")
           C-e        move cursor to end of current line (i.e. "end")
           C-f        move cursor forward one character (i.e. "right")
           C-n        move cursor to next line (i.e. "down")
           C-p        move cursor to previous line (i.e. "up")
           C-v        move cursor to next page of text (i.e. "page
                      down")
           Esc-b      move cursor back one word
           Esc-f      move cursor forward one word
           Esc-g      jump to a specific line number in the file
           Esc-v      move cursor to previous page of text (i.e. "page
                      up")
           Esc-<      jump to the start of the file
           Esc->      jump to the end of the file

   Text editing commands
           C-d        delete character under cursor (i.e. "del")
           C-h        move cursor backwards and delete previous
                      character (i.e. "backspace")
           C-g        abort at prompts (cancel task when asked a
                      question)
           C-i        insert tab character
           C-j        insert newline character (i.e. "enter",
                      "return")
           C-k        cut text up to the end of the line (i.e. "kill
                      line")
           C-l        refresh the screen
           C-m        insert carriage return character
           C-r        search for text backwards, jump to next result
           C-s        search for text forwards, jump to next result
           C-y        paste the text in the cut buffer (i.e. "yank")
           Esc-r      search for text and replace it

   Buffer commands
     atto supports multiple editing buffers, allowing users to edit
     multiple files from a single instance of the program.

           C-x C-c    close all open buffers and exit atto, prompting
                      if changes would be discarded
           C-x C-f    open a file into a new buffer
           C-x C-k    close the current buffer, prompting if changes
                      would be discarded (i.e. "kill")
           C-x C-s    save current buffer to disk, overwriting the
                      file
           C-x C-w    save current buffer to disk, prompting for file
                      name ("write")
           C-x n      cycle to next buffer
           C-x i      read another file and insert it into the current
                      buffer
           C-x =      display cursor position in current buffer

   Region commands
     As well as cutting text on a line basis (i.e. C-k), a region can
     be selected by setting a mark at the beginning of the region, and
     then moving the cursor to the end of the region.

           C-space    set the beginning of the region at the current
                      position
           C-w        cut the marked region
           Esc-w      copy the marked region without deleting it

   Window management commands
     Simple split-screen window management is included.  For more
     advanced use cases, consider using tmux(1).

           C-x 1      delete windows except the currently active one
           C-x 2      split current window into two windows
           C-x o      switch to the next open window

SEE ALSO
     ed(1), ex(1), vi(1), xedit(1)

STANDARDS
     atto is not the standard editor.

AUTHORS
     atto was written primarily by Hugh Barney, and was originally
     based on public domain code from Anthony Howe's editor (commonly
     known as Anthony's Editor).

     It has been modified for inclusion in NetBSD, including with
     enhanced option handling.

NetBSD 11.99.9             October 15, 2026             NetBSD 11.99.9


To generate a diff of this commit:
cvs rdiff -u -r1.1394 -r1.1395 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.521 -r1.522 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1844 -r1.1845 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.61 -r1.62 src/distrib/sets/lists/manhtml/mi
cvs rdiff -u -r1.247 -r1.248 src/usr.bin/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/atto/CHANGE.LOG.md \
    src/usr.bin/atto/Makefile src/usr.bin/atto/README.md \
    src/usr.bin/atto/atto.1 src/usr.bin/atto/buffer.c \
    src/usr.bin/atto/command.c src/usr.bin/atto/complete.c \
    src/usr.bin/atto/display.c src/usr.bin/atto/gap.c \
    src/usr.bin/atto/header.h src/usr.bin/atto/hilite.c \
    src/usr.bin/atto/key.c src/usr.bin/atto/main.c src/usr.bin/atto/replace.c \
    src/usr.bin/atto/search.c src/usr.bin/atto/window.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index