svicc(1) [Hosted by Floodgap Systems] svicc(1)
[Screenshot]

NAME
svicc - text editor for Commodore computers (currently the C64)

SYNOPSIS
LOAD"SVICC",D
RUN

where D is the device number of your disk drive. Download it in .prg format.

LICENSE
svicc is freeware and is freely redistributable, as long as the copyright message is kept intact, and the svicc copyright message (see AUTHORS) and the URL to the svicc home page appears on all works derived from it. No warranty, express or implied, is given concerning this program or its resemblance to specification. YOU USE THIS SOFTWARE AT YOUR OWN RISK.

DESCRIPTION
svicc is a small-scale clone of the (in)famous vi text editor, in the style of the popular nvi/nex variant. It is written for the Commodore 64, with support for other Commodore systems planned in the future.

When first run, svicc automatically unpacks a built-in tutorial on the basic use of svicc, and by extension, vi. Beginners should read through the built-in tutorial using the CRSR keys to scroll, as it explains basic ideas about how the editors both operate. The remainder of this page, however, is intended for those who are already familiar with vi. Please read svicc's built-in documentation beforehand if you are not proficient in vi.

svicc was originally based on Chris Miller's "Mr. Ed" screen editor package, as published in Transactor September 1987. While some of the original code is still present in some form, I (Cameron Kaiser) have since done significant optimization and cleanup, as well as adding in vi/ex commands, filesystem operations, editor improvements, primitive cut-and-paste, and vi-style editing behaviour.

COMMANDS SUPPORTED
svicc supports an extended subset of nvi/nex. In visual mode, only commands of a single keystroke (except 1G and dd) are supported; thus, there is no object motion, and no real counting. There is no true ex mode.

With regard to editing, svicc is a scrolling editor, and every physical screen row corresponds to exactly one logical screen row. You must scroll using the motion keys to view lines longer than the screen is wide. svicc enforces a maximum line length of 249 characters. There is only one 255-byte yank buffer, which may hold up to one complete line of text, from the most recent delete operation (either x, X, or dd). The document buffer is 38,652 bytes (the size of the entire BASIC text space, minus 259 bytes for the BASIC execution stub and housekeeping).

svicc remaps certain keys for convenience. The CRSR keys are synonymous with the h j k l motion keys. RUN/STOP doubles as both ^C (interrupt) and escape key, acting as interrupt when entering an ex command, and escape at all other times. Use F7 for a true escape key.

On the Commodore 128 in 64 mode, the C128's ESC key is mapped to escape for insert and command mode only. (Yes, you can read the 128's special keys in 64 mode.)

Other than those conditions noted above, these single keystroke commands function identically in svicc:

a A i I o O p P x X 0 $ G J h j k l ^G ^L

These double keystroke commands function identically in svicc:

dd 1G

They are the only valid multi-key sequences. No other methods of specifying a count or a motion sequence are accepted. If you enter non-zero digits other than 1, they are treated as 1, and the count can never be greater than 1 (effectively thus only salient for G).

^ (caret, or up-arrow) is considered synonymous with 0, and svicc will warn you about the behaviour difference.

During complex or slow operations, a spinning "busy" cursor may appear in the bottom right corner to soothe your anxieties.

When in insert mode, you can insert characters other than standard alphanumerics and punctuation, and even some control characters. This shall be considered a feature, but do note that control and graphic characters will incorrectly appear as ordinary text on screen (though they will be saved in their true form), and inserting certain control characters may make your document difficult to edit.

COMMODORE-SPECIFIC EXTENSIONS
Since Commodore BASIC isn't a typical CLI environment, svicc has different ways of dealing with files and arguments.

As stated previously, svicc comes with a default document. To start with a clean document buffer, use :new and svicc will reset to an empty file.

To specify and load a file to edit, use :e filename to load a file from the default device (the most recently accessed disk drive). If the load fails, the document buffer will be rendered blank. The error channel is reported at the end of the load.

:q quits svicc and returns you to BASIC, but an important difference from standard vi is that providing you do not change BASIC text, enter program lines, etc., your document can usually be resumed fully intact if you return to svicc. svicc will tell you how to return, usually by entering RUN (again, assuming no changes made to the BASIC text area). Think of this as the Commodore version of a "shell escape."

If the current document buffer has been modified, all of the previous commands will refuse to function unless they are followed with ! (e.g., :new! must be used).

As in regular vi, to write a file to disk, use :w filename and the document buffer will be saved to the default device. Keep in mind that you must specify a filename, even if you are already editing a file (considered a feature thanks to DOS error #63). The error channel is reported at the end of the write.

A primitive DOS wedge is included in svicc using :@command (if command is blank, the error channel is displayed). The wedge operates on the default device. If $ is used as the command (e.g., :@$), the disk directory is displayed (press any key to return to editing); otherwise, the command is sent and the drive response displayed.

You may not group commands (e.g., :wq! is not allowed).

ERROR MESSAGES
INVALID KEY COMMAND: unsupported or illegal keystroke in command mode.
BACKSPACE PAST INSERT POINT DISALLOWED: you may not backspace past where you began insert mode. Exit using escape, and use the x and X keys to remove characters instead.
BUFFER IS EMPTY: you tried to put or Put, but you hadn't cut or deleted something before.
ASSERTERR xxxx: indicates a consistency error. Please report the bug (see AUTHORS).
LINE WOULD BECOME TOO LONG: you cannot join two lines together if the resulting line would exceed the 249-byte limit.
DISALLOWED AS MOTION COMMAND: you cannot enter any delete command other than dd.
INVALID EX COMMAND: unsupported or illegal ex command entered.
CHANGES MADE, xxx! TO FORCE: the document buffer may be affected by this operation and hasn't yet been saved. You must add an exclamation point to signal your acknowledgement.
NEEDS FILENAME: :e and :w require a filename argument.
CAN'T GROUP COMMANDS: one ex command at a time, e.g., no constructions like :wq! allowed.

Fans of Rumiko Takahashi should look for the Easter egg.

SPEED NOTES, or, HOW TO EDIT QUICKLY
Unfortunately, vi-style editing can be very computationally expensive for a little 1MHz CPU, even with oodles of optimization tricks.

The larger a document is and the closer you are to the top of it, the more work svicc has to do to insert characters (since it has to move almost the entire document for each character you type as you get closer to the beginning of the document).

Thus, editing within svicc is at its fastest at or near the end of a document, and faster still if the document is smaller.

You can also scroll up and down through documents slightly faster if you put the cursor at the beginning of lines (use the 0 command).

MAKING SELF-DISPLAYING DOCUMENTS
You can embed your own documents in svicc and use it to create self-displaying documents. To do this, you will need a machine language monitor and a BASIC-ML linker, such as ModLink by Robert Stoerrle.

  1. Enter or load your document into the document buffer.
  2. Exit to BASIC with :q and then save it to disk using SAVE"FILE",D where D is your disk drive. This will save your document, along with a short BASIC stub, to a regular executable PRG file.
  3. Using a machine language monitor, save the area from $c000 to $ced7, where svicc's main logic occupies.
  4. Use your linker to link the ML portion with your saved stub-and-document file to create the final executable.

As this constitutes a derivative work, you must credit svicc in your document -- see the license.

BUGS AND WISH LIST
Please send all bug reports to ckaiser@floodgap.com. The following issues are known:

  • Faster, faster, faster!
  • It would be nice if at least graphic characters were displayed properly, although the logic is a bit expensive.
  • G is not implemented very efficiently, mostly for reasons of code size.

AUTHORS
These author credits must appear on any derivative work, including self-displaying documents, along with a link to the svicc home page.

Original works and editor code, copyright 1987, Chris Miller. All rights reserved. Use of original "Mr. Ed" source code in accordance with the Transactor licensing policy.

svicc vi enhancements package and optimization/bug fixes, copyright 2003, Cameron Kaiser. All rights reserved.

I, Cameron Kaiser, am the author of the current release package and its primary maintainer, and all bug reports should go to me at ckaiser@floodgap.com.

DOWNLOAD
Current version, in .prg format, approximately 8K in size. Includes built-in tutorial document.

Your use of this program indicates your binding acceptance of all license terms.

CHANGELOG AND HISTORY
15 February 2003: Released version 0.1.0 for the 64.

SEE ALSO
Floodgap Retrobits

C64 February 15, 2003 svicc(1)

Cameron Kaiser