[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Commands

Everything ne can do is specified through a command. Commands can be manually typed on the command line, bound to a key, to a menu item, or grouped into macros for easier manipulation. If you want to fully exploit the power of ne, you will be faced sooner or later with using commands directly.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.1 General Guidelines

Every command in ne has a long and a short name. Except in a very few cases, the short name is given by two or three letters that are the initials of the words that form the long name. For instance, SearchBack has short name SB, SaveDefPrefs has the short name SDP, and AdjustView's short name is AV. There are some exceptions however. The most frequently used commands such as Exit have one-letter short names (X). Also some commands use a different short name to avoid clashes with a more common command's short name. For example, StatusBar's short name is ST rather than SB to avoid clashes with SearchBack's short name.

A command always has at most one argument. This is a chosen limitation that allows ne's parsing of commands and macros to be very fast. Moreover, it nullifies nearly all problems related to delimiters, escape characters, and the like. The unique argument can be a number, a string, or a flag modifier. You can easily distinguish these three cases even without this manual by looking at what the Help command says about the given command. Note that when a command's argument is enclosed in square brackets, it is optional.

Strings are general purpose arguments. Numbers are used to modify internal parameters, such as the size of a TAB. A flag modifier is an optional number that is interpreted as follows:

Thus, StatusBar 1 will activate that status bar, while I will toggle insert/overstrike. This design choice is due to the fact that most of the time during interactive editing you need to change a flag. For instance, you may be in insert mode and you want to overstrike, or vice versa. Absolute settings (those with a number) are useful essentially for macros. It is reasonable to use the fastest approach for the most frequent interactive event. When a number or a string is required and the argument is optional, most of the time you will be prompted to type the argument on the command line.

As for the input line, for numeric arguments you can choose between decimal, octal and hexadecimal notation in the standard way: a number starting with `0' is considered in octal, a number starting with `0x' is considered in hexadecimal, and in all other cases decimal base is assumed.

When a number represents how many times ne should repeat an action, it is always understood that the command will terminate when the conditions for applying it are no longer true. For instance, the Paragraph command accepts the number of paragraphs to format. But if not enough paragraphs exists in the text, only the available ones will be formatted.

This easily allows performing operations on an entire document by specifying preposterously huge numbers as arguments. ToUpper 200000000 will make all the words in the document upper case. (At least, one would hope so!) Note that this is much faster than recording a macro with the command ToUpper in it and playing it many times because in the former case the command has to be parsed just one time.

In any case, if a macro or a repeated operation takes too long, you can stop it using the interrupt key (Control-\).

To handle situations such as an argument string starting with a space, ne implements a simple mechanism whereby you can enclose any string argument in double quotes. If the first non-blank character after the command and last character of the command line are double quotes, the quotes will be removed and whatever is left will be used as the string argument. For example, the Find command to find a space could be entered on the command line or in a macro as Find " ". The only case needing special treatment is when a string starts and ends with double quotes. The command Find ""quote"" would locate the next occurance of the string `"quote"' (including the double quotes). However, Find onequote" wouldn't require special treatment because the command argument doesn't both start and end with a double quote.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2 File Commands

These commands allow opening and saving files. They all act in the context of the current document (i.e., the document displayed when the command is issued).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.1 Open

Syntax: Open [filename]
Abbreviation: O

loads the file specified by the filename string into the current document.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line, the default being the current document name, if available.

If the current document is marked as modified at the time the command is issued, you have to confirm the action.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.2 OpenNew

Syntax: OpenNew [filename]
Abbreviation: ON

is the same as Open, but loads the file specified by the filename string into a new document. See Open.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.3 Save

Syntax: Save
Abbreviation: S

saves the current document using its default file name.

If the current document is unnamed, the file requester will open and you will be prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.4 SaveAs

Syntax: SaveAs [filename]
Abbreviation: SA

saves the current document using the specified string as the file name.

If the optional filename argument is not specified, the file requester will open and you will be prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can enter the file name on the input line, the default being the current document name, if available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 Document Commands

These commands allow manipulation of the circular list of documents in ne.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.1 Quit

Syntax: Quit
Abbreviation: Q

closes all documents and exits. If any documents are modified, you have to confirm the action.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.2 Exit

Syntax: Exit
Abbreviation: X

saves all modified documents, closes them and exits. If any documents cannot be saved, the action is suspended and an error message is issued.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.3 NewDoc

Syntax: NewDoc
Abbreviation: N

creates a new, empty, unnamed document that becomes the current document. The position of the document in the document list is just after the current document. The preferences of the new document are a copy of the preferences of the current document.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.4 Clear

Syntax: Clear
Abbreviation: CL

destroys the contents of the current document and of its undo buffer. Moreover, the document becomes unnamed. If your current document is marked as modified, you have to confirm the action.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.5 CloseDoc

Syntax: CloseDoc
Abbreviation: CD

closes the current document. The document is removed from ne's list and, if it is the only existing document, ne exits. If the document was modified since it was last saved, you have to confirm the action.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.6 NextDoc

Syntax: NextDoc
Abbreviation: ND

sets as current document the next document in the document list.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.7 PrevDoc

Syntax: PrevDoc
Abbreviation: PD

sets as current document the previous document in the document list.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3.8 SelectDoc

Syntax: SelectDoc
Abbreviation: SD

displays a requester containing the names of all the documents in memory. You select whichever document you want to become the current document.

If you escape from the requester the requester goes away and you are returned to your original current document.

SelectDoc is especially useful if you have a large number of documents open (say, more than 10). Otherwise, NextDoc and PrevDoc should be enough. See NextDoc, and PrevDoc.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4 Clip Commands

These commands control the clipping system. A clip is a snippet of text separate from any document, which you can save to a file or insert into a document. You can select text in a document and copy it to a clip, optionally deleting it from your text. You can also load text directly from a file into a clip. ne can have any number of clips, which are distinguished by an integer. Most clip commands act on the current clip, which can be selected with ClipNumber. Clips can be copied and pasted in two ways--normally (as lines of text) or vertically (as a rectangular block of characters).

Note that by using the Through command you can automatically pass a (possibly vertical) block of text through any filter (such as sort under UN*X).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.1 Mark

Syntax: Mark [0|1]
Abbreviation: M

sets the mark at the current position or cancels the previous mark. The mark can then be used to perform clip operations. The clip commands act on the characters lying between the mark and the cursor.

If you invoke Mark with no arguments, it will toggle the mark. If you specify 0 or 1, the mark will be canceled or set to the current position, respectively. A capital `M' appears on the status bar, if the mark is active.

See Record, for the reason the mark is implemented as a flag.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.2 MarkVert

Syntax: MarkVert [0|1]
Abbreviation: MV

is the same as Mark, but the mark is interpreted as vertical by the clip handling commands. This means that the region manipulated by the cut/paste commands is the rectangle having as vertices the cursor and the mark. Moreover, a capital `V', rather than a capital `M', will appear on the status bar. Vertical cut/paste operations are useful for handling structured program indentation.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.3 Copy

Syntax: Copy [n]
Abbreviation: C

copies the contents of the characters lying between the cursor and the mark into the clip specified by the optional numeric argument, the default clip being the current clip, which can be set with the ClipNumber command; see ClipNumber. If the current mark was vertical, the rectangle of characters defined by the cursor and the mark is copied instead.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.4 Cut

Syntax: Cut [n]
Abbreviation: CU

acts just like Copy, but also deletes the block being copied.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.5 Paste

Syntax: Paste [n]
Abbreviation: P

pastes the contents of specified clip into the current document at the cursor position. If you don't specify the clip number, the current clip is used; Specify which clip is current with ClipNumber.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.6 PasteVert

Syntax: PasteVert [n]
Abbreviation: PV

vertically pastes the contents of the specified clip, the default being the current clip. Each line of the clip is inserted on consecutive lines at the horizontal cursor position.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.7 Erase

Syntax: Erase
Abbreviation: E

acts like Cut, but the block is just deleted and not copied into any clip.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.8 OpenClip

Syntax: OpenClip [filename]
Abbreviation: OC

loads the given file name as the current clip, just as if you cut or copied it from the current document; see Copy.

If the optional filename argument is not specified, the file requester will open and you will be prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can enter the file name on the input line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.9 SaveClip

Syntax: SaveClip [filename]
Abbreviation: SC

saves the current clip on the given file name.

If the optional filename argument is not specified, the file requester will open and you will be prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can enter the file name on the input line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.10 ClipNumber

Syntax: ClipNumber [n]
Abbreviation: CN

sets the current clip number. This number is used by OpenClip and SaveClip, and by Copy, Cut and Paste if they are called without any argument. Its default value is zero. n is limited only by the integer size of the machine ne is running on.

If the optional argument n is not specified, you can enter it on the input line, the default being the current clip number.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.4.11 Through

Syntax: Through [command]
Abbreviation: T

asks the shell to execute command, piping the current block in the standard input, and replacing it with the output of the command. This command is most useful with filters, such as sort. Its practical effect is to pass the block through the specified filter.

Note that by selecting an empty block (or equivalently by having the mark unset) you can use Through to insert the output of any UN*X command in your file.

If the optional argument command is not specified, you can enter it on the input line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5 Search Commands

These commands control the search system. ne offers two complementary searching techniques: a simple, fast exact matching search (optionally ignoring case), and a very flexible and powerful, but slower, regular expression search based on the GNU regex library (again, optionally case insensitive).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.1 Find

Syntax: Find [pattern]
Abbreviation: F

searches for the given pattern. The cursor is positioned on the first occurrence of the pattern, or an error message is given. The direction and the case sensitivity of the search are established by the value of the back search and case sensitive search flags. See SearchBack, and CaseSearch.

If the optional argument pattern is not specified, you can enter it on the input line, the default being the last pattern used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.2 FindRegExp

Syntax: FindRegExp [pattern]
Abbreviation: FX

searches the current document for the given extended regular expression (see section Regular Expressions) . The cursor is positioned on the first string matching the expression. The direction and the kind of search are established by the value of the back search and case sensitive search flags. See SearchBack, and CaseSearch.

If the optional argument pattern is not specified, you can enter it on the input line, the default being the last pattern used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.3 Replace

Syntax: Replace [string]
Abbreviation: R

moves to the first match of the most recent find string or regular expression and prompts you for which action to perform. You can choose among:

Replace is mainly useful for interactive editing. ReplaceOnce, ReplaceAll and RepeatLast are more suited to macros.

If no find string was ever specified, you can enter it on the input line. If the optional argument string is not specified, you can enter it on the input line, the default being the last string used. When the last search was a regular expression search, there are some special features you can use in the replace string (see section Regular Expressions) . See FindRegExp.

Note that normally a search starts just one character after the cursor. However, when Replace is invoked, the search starts at the character just under the cursor, so that you can safely Find a pattern and Replace it without having to move back.

Warning: when recording a macro with Record, there is no trace in the macro of your interaction with ne during the replacement process. When the macro is played, you will again have to choose which actions to perform. If you want to apply automatic replacement of strings for a certain number of times, you should look at ReplaceOnce, ReplaceAll, and RepeatLast.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.4 ReplaceOnce

Syntax: ReplaceOnce [string]
Abbreviation: R1

acts just like Replace, but without any interaction with you (unless there is no find string). The first string matched by the last search pattern, if it exists, is replaced by the given replacement string.

If the optional argument string is not specified, you can enter it on the input line, the default being the last string used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.5 ReplaceAll

Syntax: ReplaceAll [string]
Abbreviation: RA

is similar to ReplaceOnce, but replaces all occurrences of the last search pattern with the given replacement string.

If the optional argument string is not specified, you can enter it on the input line, the default being the last string used.

Note that Undo will restore all the occurrences of the search pattern replaced by ReplaceAll. See Undo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.6 RepeatLast

Syntax: RepeatLast [times]
Abbreviation: RL

repeats for the given number of times the last find or replace operation (with replace we mean here a single replace, even if the last Replace operation ended with a global substitution).

RepeatLast is especially useful for researching a given number of times, or replacing something a given number of times. The standard technique for accomplishing this is:

  1. Find (or FindRegExp) the string you are interested in;
  2. if you want to repeat a replace operation, ReplaceOnce with the replacement string you are interested in;
  3. now issue a RepeatLast n-1 command, where n is the number of occurrences you wanted to skip over, or replace.

The important thing about this sequence of actions is that it will work this way even in a macro. The Replace command cannot be used in a macro unless you really want to interact with ne during the macro execution. Avoiding interaction during macros is the primary reason the commands ReplaceAll and ReplaceOnce are provided.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.7 MatchBracket

Syntax: MatchBracket
Abbreviation: MB

moves the cursor to the bracket associated with the bracket the cursor is on. If the cursor is not on a bracket, or there is no bracket associated with the current one, an error message is issued. Recognized brackets are `{}', `()', `[]' and `<>'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.8 SearchBack

Syntax: SearchBack [0|1]
Abbreviation: SB

sets the back search flag. When this flag is true, every search or replacement command is performed backwards.

If you invoke SearchBack with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `b' will appear on the status bar if the flag is true.

Note that this flag also can be set through interactions with the Replace command. See Replace.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.9 CaseSearch

Syntax: CaseSearch [0|1]
Abbreviation: CS

sets the case sensitivity flag. When this flag is true, the search commands distinguish between the upper and lower case letters. By default the flag is false.

If you invoke CaseSearch with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `c' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6 Macros Commands

Macros are lists of commands. Any series of operations that has to be performed frequently is a good candidate for being a macro.

Macros can be written manually: they are just ASCII files, each command occupying a line (lines starting with `#' are considered comments; lines starting with other nonalphabetical characters are presently ignored). But the real power of macros is that they be recorded during the normal usage of ne. When the recording terminates, the operations that have been recorded can be saved for later use. Note that each document has a current macro (the last macro that has been opened or recorded).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.1 Record

Syntax: Record [0|1]
Abbreviation: Rec

sets the recording state flag. When this flag becomes true, ne starts recording your actions in a new macro. When it becomes false, the macro recording is stopped, and the macro can be played or saved via Play, or SaveMacro.

If you call invoke Record with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An upper case `R' will appear on the status bar if the flag is true.

The reason for providing a flag instead of an explicit start/stop recording command pair is that this way it is possible to bind both starting and stopping macro recording to a single key while still being able to specify "absolute" menu items (by using Record 0 and Record 1). For instance, the default key binding for Control-T is simply Record, which means that this shortcut can be used both for initiating and for terminating a macro recording.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.2 Play

Syntax: Play [times]
Abbreviation: PL

plays the current macro for the given number of times. If the optional argument times is not specified, you can enter it on the input line.

A (possibly iterated) macro execution terminates as soon as its stream of instructions is exhausted, or one of its commands returns an error. This means that, for instance, you can perform some complex operation on all the lines contaning a certain pattern by recording a macro that searches for the pattern and performs the operation, and then playing it a preposterously huge number of times.

Execution of a macro can be interrupted by Control-\.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.3 Macro

Syntax: Macro [filename]
Abbreviation: MA

executes the given file name as a macro.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line.

Note that macros whose name does not conflict with a command can be called without using Macro. Whenever ne is required to perform a command it cannot find in its internal tables, it will look for a macro by that name in the current directory. If this search also fails, ne looks in `~/.ne' and finally in the global ne directory (/usr/lib/ne by default, or in a place specified by your NE_GLOBAL_DIR environment variable) for a macro file by that name.

Warning: to improve (greatly) efficiency, the first time a macro is executed it is cached into a hash table and is kept forever in memory unless the UnloadMacros command is issued; see UnloadMacros. The next time a macro with the same file name is invoked, the cached list is searched for it before accessing the file using a case insensitive string comparison. That is, if you call `~/foobar/macro', a subsequent call for `/usr/MACRO' or even just `MaCrO' will use the cached version of `~/foobar/macro'. Note that the cache table is global to ne and not specific to any single document.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.4 OpenMacro

Syntax: OpenMacro [filename]
Abbreviation: OM

loads the given file name as the current macro just as if you Recorded it; see Record.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.5 SaveMacro

Syntax: SaveMacro [filename]
Abbreviation: SM

saves the current macro in a file with the given name.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line.

SaveMacro is of course most useful for saving macros you just recorded. The macros can then be loaded as normal text files for further editing, if necessary. Note that SaveMacro converts InsertChar commands into a possibly smaller number of InsertString commands. This makes macros easier to read and edit. See InsertChar, and InsertString.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.6.6 UnloadMacros

Syntax: UnloadMacros
Abbreviation: UM

frees the macro cache list. After this command, the Macro command will be forced to search for the file containing the macros it has to play.

UnloadMacros is especially useful if you are experimenting with a macro bound to some keystroke, and you are interactively modifying it and playing it. UnloadMacros forces ne to look for the newer version available.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7 Undo Commands

The following commands control the undo system.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7.1 Undo

Syntax: Undo [n]
Abbreviation: U

undoes the last n actions. If n is not specified, it is assumed to be one. After you undo a number of actions, you can Redo all or some of them; see Redo. However, if you take any new actions after having Undone some, you can no longer Redo those Undone actions. See Redo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7.2 Redo

Syntax: Redo [n]
Abbreviation: RE

redoes the last n actions undone by Undo (as long as you don't take any actions that change the text between the Undo and Redo commands). If n is not specified, it is assumed to be one. You can only Redo actions that have been Undone. See Undo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7.3 UndelLine

Syntax: UndelLine [n]
Abbreviation: UL

inserts at the cursor position for n times the last non-empty line that was deleted with the DeleteLine command. If n is not specified, it is assumed to be one.

UndelLine is most useful in that it allows a very fast way of moving one line around. Just delete it, and undelete it somewhere else. It is also an easy way to replicate a line without getting involved with clips.

Note that UndelLine works independently of the status of the undo flag. See DoUndo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.7.4 DoUndo

Syntax: DoUndo [0|1]
Abbreviation: DU

sets the flag that enables or disables the undo system. When you turn the undo system off, all the recorded actions are discarded, and the undo buffers are reset.

If you invoke DoUndo with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `u' will appear on the status bar if the flag is true.

The usefulness of this option relies in the fact that the undo system is a major memory eater. If you plan to do massive editing (say, cutting and pasting megabytes of text) it is a good idea to disable the undo system, both for improving (doubling) performance and for using less (half) memory. Except for this, on a virtual memory system we see no reason to not keep the undo flag always true, and this is indeed the default.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8 Formatting Commands

The following commands allow simple formatting operations on the text. Note that for ne a paragraph is delimited by an empty line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.1 Center

Syntax: Center [n]
Abbreviation: CE

centers n lines from the cursor position onwards. If n is not specified, it is assumed to be one. The lines are centered with spaces, relatively to the value of the right margin as set by the RightMargin command. See RightMargin.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.2 Paragraph

Syntax: Paragraph [n]
Abbreviation: PA

reformats n paragraphs from the cursor position onwards. If n is not specified, it is assumed to be one. The paragraph are formatted relatively to the value of the right margin as set by the RightMargin command. See RightMargin.

ne's notion of a paragraph includes the current non-blank line (regardless of its leading white space) and all subsequent non-blank lines that have identical (to each other's--not to the first line's) leading white space. Therefore your paragraphs can have various first line indentations and left margins.

After the Paragraph command completes, your cursor will be positioned on the first non-blank character after the last reformatted paragraph (or, if there is no such character, at the end of the document).

If you think paragraphing should insert "smart" spaces after full stops and colons, and do other "smart" things such as justification, you should consider using a text formatter. TeX is usually the best choice.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.3 ToUpper

Syntax: ToUpper [n]
Abbreviation: TU

shifts to upper case the letters from the cursor position up to the end of a word, and moves to the first letter of next word for n times.

The description of the command may seem a little bit cryptic. What is really happening is that there are situations where you only want to upper case the last part of a word. In this case, you just have to position the cursor in the first character you want to upper case, and use ToUpper with no argument.

If you apply ToUpper on the first character of a word, it will just upper case n words.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.4 ToLower

Syntax: ToLower [n]
Abbreviation: TL

acts exactly like ToUpper, but lowers the case. See ToUpper.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.5 Capitalize

Syntax: Capitalize [n]
Abbreviation: CA

acts exactly like ToUpper, but capitalizes, that is, makes the first letter upper case and the other ones lower case. See ToUpper.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.6 RightMargin

Syntax: RightMargin [n]
Abbreviation: RM

sets the right margin for all formatting operations, and for WordWrap. See WordWrap.

If the optional argument n is not specified, you can enter it on the input line, the default being the current value of the right margin.

A value of zero for n will force ne to use (what it thinks it is) the current screen width as right margin.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.7 WordWrap

Syntax: WordWrap [0|1]
Abbreviation: WW

sets the word wrap flag. When this flag is true, ne will automatically break lines of text longer than the current right margin while you type them. See RightMargin.

If you invoke WordWrap with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `w' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.8.8 AutoIndent

Syntax: AutoIndent [0|1]
Abbreviation: AI

sets the auto indent flag. When this flag is true, ne will automatically insert TABs and spaces on a new line (created by an InsertLine command, or by automatic word wrapping) in such a way to replicate the initial spaces of the previous line. Most useful for indenting programs.

If you invoke AutoIndent with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `a' will appear on the status bar if the flag is true.

AutoIndent features a nice interaction with Undo. Whenever a new line is created, the insertion of spaces is recorded as a separate action in the undo buffer (with respect to the line creation). If you are not satisfied with the indentation, just give the Undo command and the indentation will disappear (but the new line will remain in place, since its creation has been recorded as a separate action). See Undo.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9 Preferences Commands

These commands allow you to set your preferences, that is, the value of a series of flags that modify the behaviour of ne. (Some of the flag commands, like the command for the indent flag, appear in other sections.) The status of the flags can be saved and restored later either by writing them out to a file (saved as a macro that suitably sets the flags) or by pushing them onto a "preferences stack". The back search and the read only flags are not saved, because they do not represent a preference, but rather a temporary state. The escape time and the turbo parameter are global to ne, and are not saved. However, you can add manually to a preferences file any preferences command (such as EscapeTime or Turbo); usually, this will be done to the default preferences file `~/.ne/.default#ap'.

Note that there is an automatic preferences system, which automagically loads a preferences file related to the extension of the file name. Automatic preferences files are kept in your `~/.ne' directory. They are named as an extension postfixed with `#ap'. Each time you open a file whose name has an extension for which there is an automatic preferences file, the latter is executed. If you want to inhibit this process, you can clear the automatic preferences flag. See AutoPrefs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.1 Flags

Syntax: Flags
Abbreviation: FLAG

displays a list of all the status flags for ne and their associated commands. It is not recorded when recording a macro.

 
FLAG COMMAND      ABBR  DESCRIPTION
  i   Insert        I    inserts new characters (vs. replacing)
  a   AutoIndent    AI   aligns cursor under previous line after <Return>
  b   BackSearch    BS   searches search backward rather than forward
  c   CaseSearch    CS   searches are case sensitive
  w   WordWrap      WW   breaks long lines as you type
  f   FreeForm      FF   allows cursor to move beyond the end of lines
  p   AutoPrefs     AP   use automatic preferences based on file extension
  v   VerboseMacros VM   record macros using use long command names
  u   DoUndo        DU   record edits for later undoing
  r   ReadOnly      RO   changes are not allowed
  B   Binary        B    affects file loading/saving
  M   Mark          M    mark set for line-oriented block operations
  V   MarkVert      MV   like mark, but block is rectangle
  R   Record        REC  actions are being recorded in a macro
  P   PreserveCR    PCR  affects how <CR> chars are loaded from files
  C   CRLF          CRLF use CR/LF as line terminator
  *   Modified      MOD  document has been modified since last saved
  @   UTF8IO        U8IO I/O (keyboard and terminal) are UTF-8 encoded
A/8/U UTF8          U8   the document encoding (ASCII, 8-bit or UTF-8)

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.2 AutoPrefs

Syntax: AutoPrefs [0|1]
Abbreviation: AP

sets the automatic preferences flag. If this flag is true, each time an Open command is executed and a file is loaded, ne will look for an automatic preferences file in your `~/.ne' directory. The preferences file name is given by the extension of the file loaded, postfixed with `#ap'. Thus, for instance, C sources have an associated `c#ap' file. See section Automatic Preferences.

If you invoke AutoPrefs with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `p' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.3 Binary

Syntax: Binary [0|1]
Abbreviation: B

sets the binary flag. When this flag is true, loading and saving a document is performed in a different way. On loading, only nulls are considered newlines; on saving, nulls are saved instead of newlines. This allows you to edit a binary file, fix some text in it, and save it without modifying anything else. Normally, linefeeds, carriage returns and nulls are considered newlines, so that what you load will have all nulls and carriage returns substituted by newlines when saved.

Note that since usually binary files contain a great number of nulls, and every null will be considered a line terminator, the memory necessary for loading a binary file can be several times bigger than the length of the file itself. Thus, binary editing within ne should be considered not a normal activity, but rather an exceptional one.

If you invoke Binary with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An upper case `B' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.4 Insert

Syntax: Insert [0|1]
Abbreviation: I

sets the insert flag. If this flag is true, the text you type is inserted, otherwise it overwrites the existing characters. This also governs the behaviour of the InsertChar and InsertString commands.

If you invoke Insert with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `i' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.5 FastGUI

Syntax: FastGUI [0|1]
Abbreviation: FG

sets the fast graphical user interface flag. When this flag is true, ne tries to print as little as possible while displaying menus and the status bar. In particular, menu items are highlighted by the cursor only, the status bar is not highlighted (which allows printing it with fewer characters) and the hexadecimal code is not displayed. This option is only (but very) useful if you are using ne through a slow connection.

If you invoke FastGUI with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.6 FreeForm

Syntax: FreeForm [0|1]
Abbreviation: FF

sets the free form flag. When this flag is true, you can move with the cursor anywhere on the screen, even where there is no text present (however, you cannot move inside the space expansion of a TAB character).

If you invoke FreeForm with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `f' will appear on the status bar if the flag is true.

The issue free-form-versus-non-free-form is a major religious war that has engaged users from day one. The due of the implementor is to allow both choices, and to set as default the correct one (in his humble opinion). In this case, non-free-form.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.7 NoFileReq

Syntax: NoFileReq [0|1]
Abbreviation: NFR

sets the file requester flag. When this flag is true, the file requester is never opened, under any circumstances.

If you invoke NoFileReq with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.8 StatusBar

Syntax: StatusBar [0|1]
Abbreviation: ST

sets the status bar flag. When this flag is true, the status bar is displayed at the bottom of the screen. There are only two reasons to turn off the status bar we are aware of:

If you invoke StatusBar with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.9 HexCode

Syntax: HexCode [0|1]
Abbreviation: HC

sets the hex code flag. When this flag is true, the hexadecimal code of the character currently under the cursor is displayed on the status line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.10 ReadOnly

Syntax: ReadOnly [0|1]
Abbreviation: RO

sets the read only flag. When this flag is true, no editing can be performed on the document (any such attempt produces an error message). This flag is automatically set whenever you open a file that you cannot write to. See Open.

If you invoke ReadOnly with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `r' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.11 EscapeTime

Syntax: EscapeTime [n]
Abbreviation: ET

sets the escape time. The Escape key is recognized as such after n tenths of second. (see section Motivations and Design.) Along slow connections, it can happen that the default value of 10 is too low: in this case, escape sequences (e.g., those of the arrow keys) could be erroneously broken into an escape and some spurious characters. Rising the escape time usually solves this problem. Allowed values range from 0 to 255. Note that you can accelerate the recognition of the Escape key by hitting it twice in a row.

Note that the escape time is global to ne, and it is not saved. However, you can add an EscapeTime command manually to a preferences file.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.12 TabSize

Syntax: TabSize [size]
Abbreviation: TS

sets the number of spaces ne will use when expanding a TAB character.

If the optional argument size is not specified, you can enter it on the input line, the default being the current TAB size. Allowed values are strictly between 0 and half the width of the screen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.13 Turbo

Syntax: Turbo [steps]
Abbreviation: TUR

sets the turbo parameter. Iterated actions and global replaces will update at most steps line of the screen (or at most twice the number of visible rows if steps is zero); then, update will be delayed to the end of the action.

This feature is most useful when massive operations (such as replacing thousands of occurrences of a pattern) have to be performed. After having updated steps lines, ne can proceed at maximum speed, because no visual update has to be performed.

The value of the turbo parameter has to be adapted to the kind of terminal you are using. Very high values can be good on high-speed terminals, since the time required for the visual updates is very small, and it is always safer to look at what the editor is really doing. On slow terminals, however, small values ensure that operations such as paragraph formatting will not take too long.

You have to be careful about setting the turbo parameter too low. ne keeps track internally of the part of the screen that needs refresh in a very rough way. This means that a value of less than, say, 8 will force it to do a lot of unnecessary refresh.

The default value of this parameter is zero, which means twice the number of lines of the screen; for several reasons this does seem to be a good value.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.14 VerboseMacros

Syntax: VerboseMacros [0|1]
Abbreviation: VM

sets the verbose macros flag. When this flag is true, all macros generated by recording or by automatic preferences saving will contain full names, instead of short names. This is highly desirable if you are going to edit the macro manually, but it can slow down command parsing.

If you invoke VerboseMacros with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. A lower case `v' will appear on the status bar if the flag is true.

The only reason to use this flag is when recording a macro that will be played a great number of times. Automatic preferences files are too short to be an issue with respect to execution timing.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.15 PreserveCR

Syntax: PreserveCR [0|1]
Abbreviation: PCR

sets the preserve carriage returns flag. When a file is loaded into a buffer for which this flag is false, both CR (carriage return) and NL (new line) characters are treated as line terminators. If the flag is true, CR characters do not act as line terminators but are instead preserved in the buffer. This flag has no effect except when loading a file into a buffer.

If you invoke PreserveCR with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An upper case `P' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.16 CRLF

Syntax: CRLF [0|1]
Abbreviation: CRLF

sets the CR/LF flag. When a file is saved from a buffer for which this flag is true, both a CR (carriage return) and a NL (new line) character are output as line terminators. This flag has no effect except when saving a file.

This flag is automatically set if you load a file that has at least one CR/LF sequence into it.

If you invoke CRLF with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An upper case `C' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.17 PushPrefs

Syntax: PushPrefs [n]
Abbreviation: PUSHP

pushes n copies of the user preferences onto a stack. If not specified, n defaults to one. Use the PopPrefs command to pop preferences off the stack and restore the values. See PopPrefs. Note that the preferences stack is global, not buffer-specific, so you could PushPrefs one buffer's preferences, switch buffers, then PopPrefs those preferences, thereby altering the preferences for the second buffer. The maximum preferences stack depth is 32.

PushPrefs and PopPrefs are useful in macros that require certain preferences to work properly. A macro can PushPrefs, change any preferences necessary, do its work, then PopPrefs to restore the users previous preferences settings.

PushPrefs saves the following values on the prefs stack:

 
   AutoIndent   DoUndo    NoFileReq    StatusBar     
   AutoPrefs    FastGUI   PreserveCR   TabSize       
   Binary       FreeForm  ReadOnly     Turbo         
   CaseSearch   HexCode   RightMargin  VerboseMacros 
   ClipNumber   Insert    SearchBack   WordWrap     

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.18 PopPrefs

Syntax: PopPrefs [n]
Abbreviation: POPP

pops n sets of preferences from the prefs stack (where they were placed previously by PushPrefs) and applies those preferences to the current buffer. See PushPrefs. If not specified, n defaults to one. Note that the preferences stack is global, not buffer specific. Therefore you could PushPrefs one buffer's preferences, switch buffers, then PopPrefs those settings altering the preferences for the second buffer. The maximum preferences stack depth is 32.

PushPrefs and PopPrefs are useful in macros that require certain preferences to work properly. A macro can PushPrefs, change any preferences necessary, do its work, then PopPrefs to restore the users previous preferences settings.

PopPrefs restores the following values from the prefs stack:

 
   AutoIndent   DoUndo    NoFileReq    StatusBar     
   AutoPrefs    FastGUI   PreserveCR   TabSize       
   Binary       FreeForm  ReadOnly     Turbo         
   CaseSearch   HexCode   RightMargin  VerboseMacros 
   ClipNumber   Insert    SearchBack   WordWrap     

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.19 LoadPrefs

Syntax: LoadPrefs [filename]
Abbreviation: LP

loads the given preference file, and sets the current preferences accordingly.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.) If you escape from the file requester, you can input the file name on the command line.

Note that a preferences file is just a macro containing only option modifiers. You can manually edit a preferences file for special purposes, such as filtering out specific settings. See section Hints and Tricks.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.20 SavePrefs

Syntax: SavePrefs [filename]
Abbreviation: SP

saves the current preferences on the given file.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.) If you escape from the file requester, you can input the file name on the command line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.21 LoadAutoPrefs

Syntax: LoadAutoPrefs
Abbreviation: LAP

loads the preferences file in `~/.ne' associated with the current document's file name extension. If the current file name has no extension, the default preferences are loaded. See AutoPrefs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.22 SaveAutoPrefs

Syntax: SaveAutoPrefs
Abbreviation: SAP

saves the current preferences on the file in `~/.ne' associated with the current document's file name extension. If the current file name has no extension, an error message is issued. See AutoPrefs.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.23 SaveDefPrefs

Syntax: SaveDefPrefs
Abbreviation: SDP

saves the current preferences on the `~/.ne/.default#ap' file. This file is always loaded by ne at startup.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.24 Modified

Syntax: Modified [0|1]
Abbreviation: MOD

sets the modified flag. This flag is set automatically whenever a buffer is modified, and is used to determine which buffers need to be saved when ne exits. Normally you would not alter this flag, but when a buffer is inadvertently modified and you don't want the changes saved, Modified provides a way to make ne consider the buffer unchanged.

If you invoke Modified with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An asterisk (`*') will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.25 UTF8

Syntax: UTF8 [0|1]
Abbreviation: U8

sets the UTF-8 flag. When this flag is true, ne considers the current buffer as UTF-8 coded. Note that this flag is set automatically upon file loading (if possible) if you required automatic detection. See UTF8Auto.

If you invoke UTF8 with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. When you try to set this flag, the buffer will be checked for UTF-8 compliance, and you will get an error message in case of failure. When you try to reset it, the buffer is set to ASCII or ISO8859, depending on its content. A `U' will appear on the status bar if the flag is true. Alternatively, an `A' or an `8' will be displayed to denote whether the buffer is composed esclusively by US-ASCII characters, or also by other 8-bit characters (which are likely to be ISO-8859 encoded). Note that each time this command modifies the buffer encoding, it also resets the undo buffer.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.26 UTF8Auto

Syntax: UTF8Auto [0|1]
Abbreviation: U8A

sets the UTF-8 automatic-detection flag. When this flag is true, ne will try to guess whether a file just loaded is UTF-8 encoded. Moreover, when a non US-ASCII character is inserted in a pure US-ASCII buffer, ne will automatically switch to UTF-8. See UTF8. The flag is true by default if ne detects UTF-8 I/O at startup. See UTF8IO.

If you invoke UTF8Auto with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.9.27 UTF8IO

Syntax: UTF8IO [0|1]
Abbreviation: U8IO

sets the UTF-8 input/output flag. This flag is set automatically depending on your locale setting, and is used to determine whether communication with the user (keyboard and terminal) should be UTF-8 encoded. Normally you would not alter this flag, but sometimes ne may make the wrong guess (e.g., when you are remotely connected).

If you invoke UTF8IO with no arguments, it will toggle the flag. If you specify 0 or 1, the flag will be set to false or true, respectively. An `@' will appear on the status bar if the flag is true.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10 Navigation Commands

These commands allow you to move through a document. Besides the standard commands that allow you to move by lines, pages, et cetera, ne has bookmarks that let you mark a position in a file so to move to the same position later.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.1 MoveLeft

Syntax: MoveLeft [n]
Abbreviation: ML

moves the cursor to the left by one character n times. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.2 MoveRight

Syntax: MoveRight [n]
Abbreviation: MR

moves the cursor to the right by one character n times. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.3 LineUp

Syntax: LineUp [n]
Abbreviation: LU

moves the cursor up by one line n times. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.4 LineDown

Syntax: LineDown [n]
Abbreviation: LD

moves the cursor down by one line n times. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.5 GotoLine

Syntax: GotoLine [line]
Abbreviation: GL

moves the cursor to the lineth line of the file. If line is zero or greater than the number of lines in the file, the cursor is moved to the last line.

If the optional argument line is not specified, you can enter it on the input line; the default input response is the current line number.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.6 GotoColumn

Syntax: GotoColumn [column]
Abbreviation: GC

moves the cursor to the columnth column of the file.

If the optional argument line is not specified, you can enter it on the input line; the default input response is the current column number.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.7 GotoMark

Syntax: GotoMark
Abbreviation: GM

moves the cursor to the current mark, if it exists. See Mark.

GotoMark is mainly useful if you forgot where you started marking. If you want to record a position in a file and jump to it later, you may want to use a bookmark. See SetBookmark.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.8 PrevPage

Syntax: PrevPage [n]
Abbreviation: PP

moves the cursor n pages backward, if the cursor is on the first line of the screen; otherwise moves the cursor to the first line of the screen, and moves by n-1 pages. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.9 NextPage

Syntax: NextPage [n]
Abbreviation: NP

moves the cursor n pages forward, if the cursor is on the last line of the screen; otherwise moves the cursor to the last line of the screen, and moves by n-1 pages. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.10 PageUp

Syntax: PageUp [n]
Abbreviation: PUP

pages the screen backward by n screens. If n is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.11 PageDown

Syntax: PageDown [n]
Abbreviation: PDN

pages the screen forward by n screens. If n is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.12 PrevWord

Syntax: PrevWord [n]
Abbreviation: PW

moves the cursor to the first character of the previous word n times. If the optional n argument is not specified, it is assumed to be one (in which case, if the cursor is in the middle of a word the effect is just to move it to the start of that word).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.13 NextWord

Syntax: NextWord [n]
Abbreviation: NW

moves the cursor to the next word n times. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.14 MoveEOL

Syntax: MoveEOL
Abbreviation: EOL

moves the cursor to the end of the current line (EOL = end of line).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.15 MoveSOL

Syntax: MoveSOL
Abbreviation: SOL

moves the cursor to the start of the current line (SOL = start of line).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.16 MoveTOS

Syntax: MoveTOS
Abbreviation: TOS

moves the cursor to the top line of the screen (TOS = top of screen).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.17 MoveBOS

Syntax: MoveBOS
Abbreviation: BOS

moves the cursor to the lowest line currently visible (BOS = bottom of screen).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.18 MoveEOF

Syntax: MoveEOF
Abbreviation: EOF

moves the cursor to the end of the document (EOF = end of file).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.19 MoveSOF

Syntax: MoveSOF
Abbreviation: SOF

moves the cursor to the start of the document (SOF = start of file).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.20 MoveEOW

Syntax: MoveEOW
Abbreviation: EOW

moves the cursor one character past the end of the current word.

MoveEOW is extremely useful in macros, because it allows you to copy precisely the word the cursor is on. See section Hints and Tricks.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.21 MoveIncUp

Syntax: MoveIncUp
Abbreviation: MIU

moves the cursor incrementally towards the beginning of the document. More precisely, if the cursor is not on the start of the line it lies on, then it is moved to the start of that line. Otherwise, if it is on the first line of the screen, then it is moved to the start of the document; otherwise, it is moved to the first line of the screen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.22 MoveIncDown

Syntax: MoveIncDown
Abbreviation: MID

moves the cursor incrementally towards the end of the document. More precisely, if the cursor is not on the end of the line it lies on, then it is moved to the end of that line. Otherwise, if it is on the last line of the screen, then it is moved to the end of the document; otherwise, it is moved to the last line of the screen.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.23 AdjustView

Syntax: AdjustView [T|C|B|L|M|R]
Abbreviation: AV

shifts the view (text visible in the terminal window) horizontally or vertically without changing the cursor's position in the document. View adjustments are constrained by the current TAB size and the length and width of the current document. If called with no arguments `T' is assumed.

`T', `C', and `B' cause vertical shifts so that the current line becomes the top, center, or bottom-most visible line respectively.

`L', `M', and `R' cause horizontal shifts, making the current column the left-most, middle, or right-most visible positions.

Horizontal and vertical adjustment specifications may be combined, so that for example `AdjustView TL' shifts the view so that the current position becomes the top left-most character on screen (within the limits of the current TAB size).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.24 ToggleSEOF

Syntax: ToggleSEOF
Abbreviation: TSEOF

moves the cursor to the start of document, if it is not already there; otherwise, moves it to the end of the document.

This kind of toggling command is very useful in order to gain some keystrokes on systems with very few keys. See also ToggleSEOL, MoveSOF, and MoveEOF.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.25 ToggleSEOL

Syntax: ToggleSEOL
Abbreviation: TSEOL

moves the cursor to the start of the current line, if it is not already there; otherwise, moves it to the end of the current line.

This kind of toggling command is very useful in order to gain some keystrokes on systems with very few keys. See also ToggleSEOF, MoveSOL, and MoveEOL.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.26 SetBookmark

Syntax: SetBookmark [n|-]
Abbreviation: SBM

sets the nth bookmark to the current cursor position. If the optional n argument is not specified, it is assumed to be zero. You can also unset the `-' automatic bookmark, but it will be reset automatically to the current position whenever a GotoBookmark command is issued. Each document's valid bookmark designations are 0 to 9, and the `-' automatic bookmark.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.27 GotoBookmark

Syntax: GotoBookmark [n|-]
Abbreviation: GBM

moves the cursor to the nth or - automatic bookmark, assuming that bookmark has been set; see SetBookmark. If the optional n argument is not specified, it is assumed to be zero. When successful, the `-' automatic bookmark is set to the position in the document from which the command was issued, so that GotoBookmark - returns you to the location from which you last issued a GotoBookmark command. Subsequent repeated GotoBookmark - commands toggle you between the two locations. Each document's valid bookmark designations are 0 to 9, and the `-' automatic bookmark.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.10.28 UnsetBookmark

Syntax: UnsetBookmark [n|-]
Abbreviation: UBM

unsets the nth bookmark, making it as if it had never been set; see SetBookmark. If the optional n argument is not specified, it is assumed to be zero. You can also unset the `-' automatic bookmark, but it will be reset automatically to the current position whenever a GotoBookmark command is issued. Each document's valid bookmark designations are 0 to 9, and the `-' automatic bookmark.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11 Editing Commands

These commands allow modifing a document directly.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.1 InsertChar

Syntax: InsertChar [code]
Abbreviation: IC

inserts a character whose ASCII code is code at the current cursor position. code must always be different from 0. All the currently active preferences options (insert, word wrapping, auto indent, et cetera) are applied.

If the optional argument code is not specified, you can enter it on the input line, the default being the last inserted character.

Note that inserting a line feed (10) is completely different from inserting a line with InsertLine. InsertChar 10 puts the control char Control-J in the text at the current cursor position. See InsertLine.

Note also that SaveMacro converts InsertChar commands into a possibly smaller number of InsertString commands. This makes macros easier to read and edit. See SaveMacro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.2 InsertString

Syntax: InsertString [text]
Abbreviation: IS

inserts text at the current cursor position. If the optional argument text is omitted, you will be prompted for it on the command line. All the currently active preferences options (insert, word wrapping, auto indent, et cetera) are applied.

Note that SaveMacro converts InsertChar commands into a possibly smaller number of InsertString commands. This makes macros easier to read and edit. See SaveMacro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.3 DeleteChar

Syntax: DeleteChar [n]
Abbreviation: DC

deletes n characters from the text. If the optional n argument is not specified, it is assumed to be one. Deleting a character when the cursor is just after the last char on a line will join a line with the following one; in other words, the carriage return between the two lines will be deleted. Note that if the cursor is past the end of the current line, no action will be performed.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.4 Backspace

Syntax: Backspace [n]
Abbreviation: BS

acts like DeleteChar, but moves the cursor to the left before deleting each character.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.5 InsertLine

Syntax: InsertLine [n]
Abbreviation: IL

inserts n lines at the current cursor position, breaking the current line. If the optional n argument is not specified, it is assumed to be one.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.6 DeleteLine

Syntax: DeleteLine [n]
Abbreviation: DL

deletes n lines starting from the current cursor position, putting the last one in the temporary buffer, from which it can be undeleted. See UndelLine. If the optional n argument is not specified, it is assumed to be one. Note that this action is in no way inverse with respect to InsertLine.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.11.7 DeleteEOL

Syntax: DeleteEOL
Abbreviation: DE

deletes all characters from the current cursor position to the end of the line.

DeleteEOL could be easily implemented with a macro, but it is such a common, basic editing feature that it seemed worth a separate implementation.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12 Support Commands

These commands perform miscellaneous useful actions. In particular, they provide access to the shell and a way to assign the functionality of Escape to another key.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.1 About

Syntax: About
Abbreviation: About

displays a simple information line about ne on the status bar.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.2 Beep

Syntax: Beep
Abbreviation: BE

beeps. If your terminal cannot beep, it flashes. If it cannot flash, nothing happens (but you have a very bad terminal).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.3 Exec

Syntax: Exec
Abbreviation: EX

prompts the user on the input line, asking for a command, and executes it. It is never registered while recording a macro (though the command you type is).

Exec is mainly useful for key bindings, menu configurations, and in manually programmed macros.

Note that if the command you specify does not appear in ne's internal tables, it is considered to be a macro name. See Macro.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.4 Flash

Syntax: Flash
Abbreviation: FL

acts as Beep, but interchanging the words "beep" and "flash". Same comments apply. See Beep.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.5 Help

Syntax: Help [name]
Abbreviation: H

displays some help about the command name (both the short and the long versions of the command names are accepted). If no argument is given, a list of all existing commands in long form is displayed, allowing you to choose one. You can browse the help text with the standard navigation keys. If you press Return, the command list will be displayed again. If you press f1 or Escape, you will return to normal editing.

Invocations of the Help command are never registered while recording macros so that you can safely access the help system while recording. See Record.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.6 NOP

Syntax: NOP
Abbreviation: NOP

does nothing. Mainly useful for inhibiting standard key bindings.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.7 Refresh

Syntax: Refresh
Abbreviation: REF

refreshes the display. Refresh is very important, and should preferably be bound to the Control-L sequence, for historical reasons. It can always happen that a noisy phone line or a quirk in the terminal corrupts the display. This command restores it from scratch.

Refresh has the side effect of checking to see if your window size has changed, and will modify the display to take that into account.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.8 Suspend

Syntax: Suspend
Abbreviation: SU

suspends ne and returns you to a shell prompt; usually, the shell command fg is used to resume ne.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.9 System

Syntax: System [command]
Abbreviation: SYS

asks the shell to execute command. The terminal is temporarily reset to the state it was in before ne's activation, and command is started. When the execution is finished, control returns to ne.

If the optional argument command is not specified, you can enter it on the input line.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.12.10 Escape

Syntax: Escape
Abbreviation: ESC

toggles the menus on and off, or escapes from the input line. This command is mainly useful for reprogramming the menu activator, and it is never registered while recording a macro. See section Record.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Sebastiano Vigna on September, 1 2005 using texi2html 1.76.