-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= gnxt - The Real Programmers Editor of Choice -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Introduction ============ gnxt is, like most other modern editors, a screen editor. This means that it displays on the screen a window into the file showing its current state. gnxt provides a full-screen display on all systems with a 132x60 screen format. It also provides a 132x60 display on systems without this screen format, although some information may be lost. Use of Special Keys =================== Unfortunately for touch-typists, special-function and cursor-control keys, which are always located above or to the side of the basic keys, are inefficient since they require moving the hands away from the home keys. In order to be compatible with the widest possible variety of systems and to allow the greatest editing speed, gnxt only uses the basic keys for data entry. This is useful since for example it allows me to use gnxt with my ASR 33. Backup Files ============ When gnxt edits a file, it loads the entire text into memory for quick and easy access, at the same time deleting the file from disk. This is a most useful feature, since it means you can't accidentally edit the file twice from two sessions and lose all your changes when saving from one of the two sessions. Of course it also means you lose the file if there's some sort of problem, but the benefits far outweight this small disadvantage. Editing Modes ============= Most people are familiar with modal editors, one example being vi's beeping vs non-beeping mode. Now modal editors are usually regarded as a Bad Thing. gnxt attempts to counter this mistaken belief by offering not two but actualy seven editing modes, among them insert mode with cut, insert mode with copy, overwrite mode with cut, overwrite mode with copy, command mode with cut, command mode with copy, and program mode. Switching between these modes is usually as simple as a ^X^WR^T (see below). Built-In Programming Language ============================= Like most other editors, gnxt has a built-in programming language, in gnxt's case one called FTL. FTL is probably the most versatile language in existence today, and is covered in a seperate document. (FTL is a derivative of a language called VTL, which stands for Very Tiny Language). Default Editing Action ====================== Comprehensive gedanken experiments have determined that the most common editing action is the backspace/delete action. If an unknown command sequence is entered, gnxt will translate it to the backspace/delete action. This is useful if you've forgotten what the binding for the delete character command is set to this morning. Online Help =========== Many newer editors have online help. gnxt doesn't. The experienced user will usually know what they are doing, and the inexperienced user can always ask the nearest experienced user. Tab Handling ============ Upon reading a file which contains tab characters ('\t' or '\09') gnxt will convert each tab to three spaces, since some study in an obscure journal which noone will ever be able to find shows that three spaces for tabs are good. Besides, Elves like threes, and since Elves have been around significantly longer than humans, they should know what's right and what isn't. Repeat Counts ============= Each gnxt command may be given a predefined repeat count by setting a built-in gnxt variable to the repeat value. From then on all gnxt commands will be repeated that many times. The repeat-count is a 64-bit value. If a repeat-count greater than 64 bits is entered, gnxt will truncate it to this size. Starting gnxt ============= gnxt may be started with the following options: gnxt - Run gnxt in read-only mode gnxt - Run gnxt on the given file gnxt -r - Recursively edit all matching files gnxt -t - Attempt to telnet to another site and download a newer copy of gnxt if it exists. Then use it to edit the given file. gnxt -e - Emacs emulation mode. gnxt will attempt to emulate Emacs' resource requirements by forking off a dozen raytracers in the background. Cursor Movement =============== There are two schools of thought regarding basic keyboard editors. One school holds that commands should be mnemonic, for example F = forward one character, B = back one character, and so on. The other school holds that commands should be positionally bound, for example the "IJKL" inverted T for cursor movements. Like tri-state logic, which has three states of on, off, or bust, gnxt also offers a third alternative to the two conventional modes. The gnxt school of thought is that keys should be randomly bound, not only by function but by the time, the phase of the moon, and if possible the outside temperature and air humidity as well. In line with this school of thought, gnxt uses the following keys to move the cursor (note that text pages are abstract concepts, and as such gnxt only supports cursor movement by lines): In Insert mode with cut Forward one char ^WE After 3pm on weekdays ^TQ In months with a T in them ^YO Otherwise Back one char ^OX On Monday afternoons except February ^P^P^PF Every second Saturday ^UM Otherwise Up one line ^Y^YT On Mondays ^II^J On Fridays ^X^X^C On weekends ^T Otherwise Down one line ^H On Sunday afternoon ^M Otherwise In insert mode with copy: Forward one char ^WE^R Before 3pm Mondays ^Y^YX Otherwise Back one char ^QP On Sundays in July except the second one ^H^HT In minutes divisible by 5 ^CDD Otherwise Up one line ^O^PS After 8am and before 2pm on weekends ^WR^E Otherwise Down one line ^X^M At 3pm on weekdays ^PP^WE On days with a U in them ^N^M Otherwise In overwrite mode with cut: Forward one char ^W^QX After 11am on Tuesdays and Thursdays ^IIIII In October ^O^T^W Otherwise Back one char ^TY^T At all times Up one line ^R^RS When the sum of hours and minutes is even ^U^O When the sum of hours and minutes is odd Down one line ^W On November mornings ^W^RS On a full moon ^IT Otherwise In overwrite mode with copy: Forward one char ^O^T^Y After 2pm in the second week of July ^NMM In September ^O Otherwise Back one char ^UI^E Between 1am and 9am ^R^TS Otherwise Up one line ^P After 7:12pm Monday-Wednesday ^O^PS Otherwise Down one line ^PPX In the morning ^T^S In the afternoon ^UY^T Otherwise In command mode with cut: Forward one char ^R^S^W On Fridays ^T^TSS After midnight on weekends ^ML^A Otherwise Back one char ^C^TA In minutes which are prime numbers ^NS Otherwise Up one line ^X^RA After 8pm on Tuesdays ^N^N In months before July ^R^G^C Otherwise Down one line ^FR On the second and third of the month ^RF Otherwise In command mode with copy: Forward one char ^XV^T Every third Tuesday except February ^YY^Y In February ^M Otherwise Back one char ^XVT At all times Up one line ^G^G^G Before lunchtime on weekdays ^YY^Y After lunchtime except February ^O^S Otherwise Down one line ^UTTTT On the weekend ^W Otherwise Exiting gnxt ============ Possibly the most important thing in any editor is how you get out. As an exercise, take someone who has never used Emacs before, fire up a copy with the help keys bound to something bizarre, and see how long it takes them to find out ^X^C will let them out. Following this "don't let 'em escape" philosophy, gnxt uses the following keys: In insert mode with cut: Exit with save: ^WU On Wednesdays ^PF On weekends with no full moon ^TM On weekends with a full moon ^Y^Y^YI On Friday afternoons ^OXX Otherwise Exit without save: ^OXX On Wednesdays ^TM On weekends with no full moon ^PF On weekends with a full moon ^TN On Monday mornings ^X^X^XL Otherwise In insert mode with copy: Exit with save ^T^T On Friday mornings ^PF On odd half-hours except weekends ^TN On even half-hours except weekends ^QXX Otherwise Exit without save ^TDD In the morning ^F^FX In the afternoon In overstrike mode with cut: Exit with save ^F^FX In the morning ^TDD In the afternoon Exit without save ^T^T On Tuesday mornings ^PF On weekdays with a new moon ^Y^Y^YI On weekdays without a new moon ^X Otherwise In command mode with cut: Exit with save ^TN On Fridays just before lunchtime ^OXX Otherwise Exit without save ^QXX After 2pm Monday-Thursday ^D^DT On the weekend ^X^X^X^X Otherwise Note the clever swapping of exit-with-save/exit-without-save at random times. This is deliberate and is meant to keep the users on their toes. Cut/Copy/Paste ============== gnxt allows text to be cut/copied into a copy buffer and pasted into another area in the file. The size of the copy buffer is implementation-dependant, and can be simply determined by cutting/copying and pasting successively larger blocks of text until lines start to be lost. For simplicity, there is only one copy buffer. The cut/copy/paste actions take effect on text between two text markers. Whether text is cut or copied depends on the current editing mode. Markers are inserted into text with the following commands: In insert with cut mode: Set marker ^RF On Thursday mornings ^YM On days with an E in them ^PN Otherwise In insert with copy mode: Set marker ^M^MP During January ^TQQ^R Otherwise In overstrike with cut mode: Set marker ^TY On odd-numbered minutes but not Sundays ^YM On even-numbered minutes but not Sundays ^YM All day Sunday In overstrike with copy mode: Set marker ^TDD During the last four months of the year ^RF After 3pm weekdays ^FFG Otherwise In command with cut mode: Set marker ^FX On Monday morning and Thursday ^R^X^C On alternate Tuesdays ^W^E Otherwise In command with copy mode: Set marker: ^M^MP In December after 5pm ^YM On weekends ^TT Otherwise If only one marker is set, gnxt will take the other marker as being at the start of the text to be edited. Once two markers have been set, the text can be cut or copied to the buffer with the following keys. Whether the text is cut/copied or pasted depends on the state of the buffer. If there is text in the buffer, the text is pasted to the edit window. If there is no text in the buffer, the text is cut/copied to it (depending on the editing mode). The act of pasting text also empties the buffer. In insert with cut mode: Cut/copy/paste text ^TY On December 31st ^R^RX After 3pm Wednesdays ^OX Otherwise In insert with copy mode: Cut/copy/paste text ^FXX^R On a full moon ^TMMY Just before nightfall on 22nd July ^XT^T Otherwise In overstrike with cut mode: Cut/copy/paste text ^O^P On Tuesdays ^N^NS After 1pm on Wednesdays ^Z Otherwise In overstrike with copy mode: Cut/copy/paste text ^Y^Y In March before 4pm ^OX In July ^Z^Z On public holidays ^R^RX Otherwise In command with cut mode: Cut/copy/paste text ^M^T Every second Friday ^Y^Y Otherwise In command with copy mode: Cut/copy/paste text ^U^S^A On July 4th ^TXX^E Between 1pm and 3pm on weekdays ^XR^P Before 8am on months with an E in them ^TY Otherwise Keyboard Saver ============== Many systems have screen savers. gnxt has a keyboard saver. On keyboards with downloadable keys, gnxt will dynamically alter the key bindings on the fly to reduce keyboard wear on frequently-used keys. Invoking FTL Programs ===================== FTL programs are invoked with the key combination ^HP on weekdays or ^TF on weekends. For maximum flexibility, arguments can be passed to FTL programs in any form whatsoever, with the exact interpretation being left to the program. Arguments are passed by placing them in the cut buffer before invoking FTL. FTL places any return data in the cut buffer on exit. Undocumented Commands ===================== Like virtually all other software, gnxt has a number of undocumented commands. All options referred to in the text but never actually explained are undocumented commands. Bugs ==== Unlike virtually all other software, gnxt has no bugs. Any unusual side-effects of executing a command are either due to it being an undocumented variant of a command, or are undocumented features. Obtaining gnxt ============== gnxt may be obtained by ftping or telneting to gnxtserv@asmodeus.ninth_ring.hell (127.0.0.1), login with username anonymous as usual. The files are in /pub/editors. This site also contains many happy users of gnxt, many of whom have enjoyed using the program since taking up residence there. If you have an idea for improving gnxt (if that's at all possible), email me at pgut1@cs.aukuni.ac.nz.....