EDIT/ED User Commands
NAME
edit - Text Editor
ALIASES
EDIT, ED, MORE
SYNOPSIS
edit [-R] FILE
DESCRIPTION
The EDIT Editor is a simple text editor relying on VT-100 compatible
terminal clients. Advanced features are available for those terminals
providing XTERM (X Windows System) emulation. It is compatible with the
JNIOR WebUI Console tab.
EDIT opens the specified text file and displays the first page of lines.
If XTERM emulation is available the editor will fill the window knowing
the screen dimensions. There are several editing functions provided. It is
important to know that Ctrl-Q exits the editing and at that point the
option to save any modifications is offered. You can also optionally save
the file with a new name performing the Save-As.
-R
The FILE may be opened in Read-Only mode by specifying the -R option.
You may want to do this if do not intend to alter the file and want to
be extra certain that you do not. The MORE alias assumes the -R option.
As an alternative to a file, content for editing may also be 'piped' into the
command using the pipe character '|'. For instance:
cat jniorsys.log* | MORE
The MORE alias opens the editor in a read-only mode. In any case you can then
view a lengthy command output in the editor where you can scroll, page and
even search the text.
KEYSTROKE REFERENCE
Ctrl-Q
Exit the editor. Optionally save, rename or cancel at that point.
Ctrl-S
Allows you to save your work without leaving the editor. A confirmation
will appear at the bottom of the screen. Note that you can only save to
the original file. If you want to save the file under a new name then
you must Ctrl-Q and exit. You may edit the destination file at that point.
Screen
F5
Refreshes the screen. This may be useful if you resize your window and
need the editor to utilize the new area.
Character Editing
Ins
The Insert key toggles between insert or overstrike on key entry.
Del
Deletes the character at the cursor or deletes any selected text.
Bksp
Backspace deletes the character before the cursor or any selected
text.
Ctrl-U
Toggles the accent applied to the character to the left of the cursor.
To enter an accented character type the base character and use
Ctrl-U repeatedly if necessary until the desired accent is applied.
Indentation
Tab
The TAB key moves the non-blank text following the cursor position to the
next tab stop location. Spaces are inserted as needed. The TAB used in
the indentation area of a line basically increases the indentation by
another tab stop. Note that if there is a selection (see dropping the
anchor) and multiple lines are selected the TAP key will increase indent
for the selected line. This allows you to indent a block of code for
example.
Shift-Tab
With XTERM emulation the Shift-Tab key combination is available. Like
TAB this moves the non-blank text following the cursor to the left
and to the previous tab stop if possible. If used in the indentation area
this effectively reduces the indent. This will move a block of selected
lines to the left.
Movement
Cursor movement using the arrow keys is intuitive.
Home
Moves the cursor to the beginning of the text on the current line. If you
are at the beginning of text it will move to the beginning of the line at
the left margin.
End
Moves the cursor to the end of the current line.
PgUp
The Page Up key displays the previous page of text until the beginning
of the file is reached.
PgDn
The Page Down key displays the next page of text until the end of
the file is reached.
Ctrl-Home
Moves you immediately to the beginning of the file.
Ctrl-T
As an alternative to Ctrl-Home which may not be supported by all terminals,
Ctrl-T move you to the top of the current page. If you are already at the
top of the page it moves you to the begging of the file.
Ctrl-End
Moves you immediately to the end of the file.
Ctrl-B
As an alternative to Ctrl-End which may not be supported by all terminals,
Ctrl-B moves you to the bottom of the current page. If you are already at
the bottom of the page it moves you to the end of the file.
Alt-UpArrow
Moves to the spot of a previous edit if any. This walks backwards through
the Undo list and can be very useful in moving to the areas that you are
working on. At the earliest edit it will circle back to the latest. This
does not modify the data.
Alt-DownArrow
Moves to the spot of the next edit if any. This walks forward through
the Undo list. This is also circular and if you just made an edit this
will take you back to the first changes that were made. This does not
modify the data.
Ctrl-]
Webpage files that include JavaScript, Cascading Style Sheets (CSS), the
PHP-like JANOS Scripting language as well as many other programming languages
rely on braces { } for structure. When editing it is useful to be able to
navigate between matching pairs of braces. The Ctrl-] key combination will
jump between the braces enclosing the current block of text if those are in
use. This works when there are nested blocks.
Ctrl-G
This can be used to move to a specific line number. When used it will
request a line number at the bottom of the screen and move there if the
line exists. There will be no change if the line number is invalid.
Search
Ctrl-F
Enables the Search/Find mode. The help text at the bottom of the screen
is replaced with the Find prompt. Enter the desired search string. Note
that the search is case-independent. Hit ENTER to execute the search.
If a match exists the cursor will be located at the start of the match.
The match is not selected. The F3 key may be used to move from one
match to the next. The search will wrap back around to the beginning of
the file. There is status in the bottom boundary line.
Note that REGEX is available. To search using REGEX the string must be
enclosed with forward slashes '/'. With the REGEX search string you may
need to escape certain characters special to the syntax with the '\'
backward slash. For example to search for a string containing an open
parentheses such as "func(" you will need to use "/func\(/" for the
search string.
F3
Moves to the next match if there is an active search in progress.
Undo
Ctrl-Z
This will undo typing, deleting, or other changes, and you can repeat the
action multiple times to revert further back in the history
Ctrl-Y
The redo function reverses an undo action. It is the opposite of undo
Text Selection and Copying
Ctrl-A
Drop the Anchor. The cursor keys can then be used to highlight or
select text for subsequent editing. This is similar to holding the
Shift key when editing on the computer but since VT-100 does not
support Shift key status reporting we have to 'drop an anchor' and
then drag it by moving the cursor.
With XTERM emulation you may left-click the mouse while holding the
Shift key. This moves the cursor to that location and also drops the
anchor for selection. You cannot drag the selection with the mouse from
that point.
Ctrl-C
Copy the selected text to the clipboard.
Ctrl-X
Copy the selected text to the clipboard and remove it from the
file.
Ctrl-K
This cuts the current line in its entirety and places it in the
clipboard. The line is removed from the file. Each consecutive Ctrl-K
cuts one line from the text and uniquely appends the line to the clipboard.
Ctrl-K must be used one right after another if a block of lines is to be cut
and made available for later pasting as a whole.
Ctrl-V
Paste any text from the clipboard to the current cursor location
in the file.
MOUSE
The editor is able to utilize special escape sequences that are available if
you are connecting to the command console using a terminal program that offers
XTERM (X Windows System) emulation. This includes certain mouse functions.
Not all mouse function is available to the editor. The terminal program
reserves some mouse events to support its own function.
Left Single Click
Clicking the left button moves the edit cursor to the location of the mouse
pointer. Clicks outside of the text area are ignored. If the Shift key is held
when you click and there is no active selection the anchor is dropped.
If a selection is active you can manipulate the selected area with subsequent
left clicks. You may also do so using the cursor movement keys. You can disable
the selection with the ESC key or toggle it with Ctrl-A.
Left Double Click
Double clicking the left mouse button moves the edit cursor to the text under
the mouse pointer. The word under the pointer composed of alphanumeric
characters (a-z A-Z and 0-9). is selected (anchor dropped). You may alter
the selection or edit it normally from that point.
Left Triple Click
Triple clicking the left mouse button moves the edit cursor to the text under
the mouse pointer and selects characters bounded by spaces/blanks. This will
select the block of non-blank characters. You may alter the selection or edit
it normally from that point.
Left Quadruple Click
Clicking the left mouse button four times moves the edit cursor to the line
under the mouse pointer and selects the entire line. You may alter the selection
or edit the line normally from that point.
Scrolling
You can scroll the screen using the mouse wheel. The edit cursor remains
visible and is moved as necessary to stay in sight. If there is an active
selection, the area will be deselected (anchor lifted) when it moves out
of sight.
What is Not Supported
You cannot drag anything with the mouse. This includes enlarging the selected
area. You may be used to doing this in other editors. This has not been
implemented to this point.
The right mouse button is ignored. It may have some function with your
terminal program and that will be unaffected. Similarly any center button
or wheel click event will be ignored. The wheel provides scrolling only.
CLIPBOARD
The editor maintains a clipboard. Selected text copied (Ctrl-C) or cut (Ctrl-X)
is saved in the clipboard. Entire lines may be copied to the clipboard using
Ctrl-K. This feature will actually append cut lines allowing you to cut
several and then insert them back in another place in the original order.
Normally new content overwrites anything previously help in the clipboard.
Upon exiting the editor the content of the clipboard is saved to the
/temp/clipboard.txt file. If this file exists when you enter the editor
it will preload the clipboard. You may use this to copy text from one file
and insert into another even though you must exit the editor for the first and
reopen it for the second file.
The clipboard file is simple text and content can be used externally as such.
You may also copy text into the clipboard.txt (creating it if needed) making
it available in the editor if that helps you.
TAB USAGE
The editor converts tabs to spaces. The default tab stop is 4 which means
that with the leftmost column being 0 the tab key will advance to columns
4, 8, 12, etc. by inserting the appropriate number of spaces. A file that
initially contains TAB characters will be converted upon loading. When the
file is saved it will no longer contain tabs.
The tab stop may be altered in the range from 2 to 8 inclusive. This may be
temporarily achieved for the current console session by setting the TABS
environment variable before starting the editor. For example:
set TABS=2
This will establish tab stops at columns 2, 4, 6, etc. and may be necessary
when loading a file with tabs and getting it formatted correctly after the
space conversion.
A more permanent redefinition of the tab stop can be achieved through the
Registry. For example:
reg Edit/Tabs = 2
In this case the new tab stops will be used on that JNIOR whenever the
editor is invoked.
If the source file does not contain leading tabs the editor may analyze
the indentation used and suggest an alternate tab stop if it would vary from
the default. Files save by the editor will not contain tabs nor trailing
spaces. Trailing spaces are trimmed when the file is saved.
The editor does perform a C-oriented form of smart indent based off of the
left column of the prior line considering the use of the curly brace '{'.
NOTES
Mouse usage may vary depending on the client terminal software in use. This
editor is designed as a command line keyboard driven utility.
[/flash/manpages/manpages.hlp:3492]