home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
ehp14ce.zip
/
ehp.INF
(
.txt
)
< prev
next >
Wrap
OS/2 Help File
|
1995-06-28
|
62KB
|
1,804 lines
ΓòÉΓòÉΓòÉ 1. Introduction ΓòÉΓòÉΓòÉ
First of all note, that since release 1.4 EHP is shareware. If you are using
it for longer than four weeks you will have to register. Please DO register.
EHP is not crippled in anyway and I expect the appropriate fairness from you.
The registration fee is a joke compared against the efforts needed to port the
editor to OS/2 and maintaining it.
The shortcut EHP comes from "Editor for HP workstation" and was invented during
the first implementation on a HP 350. This first implementation was done by
Maximilian Riesenhuber and me during 1990. Since then EHP has gone its way via
DOS to OS/2. Of course the name remains only for historical reasons, since it
has no real meaning for the editor now running with OS/2.
EHP is an interactive fullscreen text editor, running also in a PM text window
and allowing quasi-parallel editing of multiple texts using window technique.
3-button mouse support is provided (of course only, if a 3-button mouse driver
is installed).
Compared with the UNIX vi, EHP does not distinguish an edit- and a command
mode. Instead, the control- and the alt-keys are used for invoking commands, as
most today-editors do. Why use EHP instead of e.g. EPM or other PM editors? Of
course, discussing this topic is a very subjective issue, and we're aware, that
people don't change their favourite editor like others change their shirt. The
first reason is, that EHP starts up more quickly than EPM. EHP, as mentioned
and runs also full-screen, which makes it a possible choice for system
recovery, if PM doesn't come up. Furthermore, EHP can be - and has been -
easily ported to other platforms like UNIX, since it was implemented upon the
curses library initiallly. In some way it has more powerful features than, say,
EPM. E.g. the possibilty of intermixing macros and repeat commands and nesting
them into each other might be possible only with EMACS. By the way one more
word on EMACS: Though I'm not using it, I'm sure it's a very powerful editor.
But the torture of installing and learning it, the gigantic ressource
comsumption, the overhad of having a complete LISP system while not really
using it and so on make EMACS not the first choice for everybody. As a quick
overview, we might give a list of the distinguishing features of EHP:
o Interactive 32-bit text editor, well-suited for programming or writing TeX
o Runs OS/2 fullscreen or in PM text window in different text resolutions
(80x25, 80x50, etc.)
o Windowed user interface with mouse support
o Keybindings redefinable
o Full-featured regular expressions for search
o Powerful macro and repeat commands
o Powerful block commands
o Support for rectangular blocks (wonderful for maintaining comments)
o Mode with automatic linebreaking and paragraph reflowing
o Remembers its configuration exactly when exiting
o Copes with underlined characters (Unix-style: _^H) and can easily manage them
o Comes with detailed online documentation in .INF format
In the sequel all available commands will be listed in a semantic grouping. For
a command reference see Command reference in the apppendix.
Note, that when this document speaks about a 'screen', and you are running EHP
in an OS/2 PM text window, then screen means that window. Don't intermix PM
windows with EHP windows!
Note, that the following words are sometimes used as synonyms:
o RETURN and ENTER
o Space and blank
o Tab and tabstop
ΓòÉΓòÉΓòÉ 2. Registration ΓòÉΓòÉΓòÉ
If you are using EHP for more than four weeks you will have to register. Please
register by sending $10 or DM 10,- and your EMail address to
Axel Uhl
Weinbrennerstraсe 108
76185 Karlsruhe
Germany
This will yield you an unlimited license of using all further releases of EHP.
Additionally, it will provide you the advantage of receiving the latest updates
via UUENCODED EMail (please write if you don't need this, e.g. due to EMail
cost).
To state it once again: EHP is completely uncrippled. Please note this, be
equally fair and register if you are really using this editor. 10$ is nothing
for an editor with EHP's features.
ΓòÉΓòÉΓòÉ 3. Installing EHP ΓòÉΓòÉΓòÉ
The installation of EHP is quite simple. Place the file EHP.EXE in a directory
contained in your PATH, e.g. c:\os2\bin. Place the keyboard definition file
tasten.inf in a directory of your choice, say also c:\os2\bin. Edit your
CONFIG.SYS file and insert the line SET EHPINIT=keys c:\os2\bin\tasten.inf.
This forwards the path of the keyboard file to EHP. For further settings via
EHPINIT see EHPINIT. Further, the dynamic link library EMX.DLL must be in a
directory contained in your LIBPATH.
ΓòÉΓòÉΓòÉ 4. General information ΓòÉΓòÉΓòÉ
This section contains information about invoking EHP, the contents of the
screen, user interaction and accepted fileformats.
ΓòÉΓòÉΓòÉ 4.1. Invoking EHP ΓòÉΓòÉΓòÉ
Precondition for invoking EHP is the correct installation of EHP. If this is
done, you can start the editor by typing ehp at the command prompt. You can
provide the names of files to load as parameters. E.g. the command
ehp x y z
loads the files x, y and z each into a seperate window. The window displayed on
top of the others is the one named first, in this case x, since files are
loaded in reverse order, and each newly opened window becomes the top window.
Note, that the numbering of the windows is also in reverse order. The numbering
can be used to switch among the windows.
If no parameters were provided, EHP looks for a configuration file. If such a
file exists, the editor is restored in the state it was in when quitting it
before. Otherwise you are asked for the name of a file to load. If a file with
that name does not exist, you are asked whether you want to create it. If so, a
new empty file is presented. Otherwise the editor terminates with a
corresponding message.
ΓòÉΓòÉΓòÉ 4.2. Screen contents ΓòÉΓòÉΓòÉ
This section describes the outfit of windows, the position and the contents of
the status line and the colors.
ΓòÉΓòÉΓòÉ 4.2.1. Windows ΓòÉΓòÉΓòÉ
A window is a rectangular part of the screen, on which text is presented in a
frame. Since it is possible to look at multiple windows at the same time, the
current window's frame is highlighted. The frame contains helpful information
and control areas for the mouse.
Headline
In the headline you find the current line and column number, information about
insert/overwrite (Insert or Overwrite), underline (Under), autoindent (Indent),
shell (SHELL) and tab (Tabs or Spcs) mode.
Footline
In the footline the window number and the filename are displayed. If the file
is read only, then WRITEPROTECTED is displayed. If the file was modified after
loading or after the last saving, then MODIFIED is displayed in the footline.
Such modified files are saved when quitting the editor with the save option (of
course only, if the file was not write protected).
ΓòÉΓòÉΓòÉ 4.2.2. Status line ΓòÉΓòÉΓòÉ
The status line is the bottom line of the screen. Here the helptexts for the
keycommands and error messages are displayed.
ΓòÉΓòÉΓòÉ 4.2.3. Colors ΓòÉΓòÉΓòÉ
The default color setting is the following:
o Grey
This is the color normal text and frames of inactive windows appear in.
o Green
Highlighted blocks and the frame of the current window appear green.
o Red
With red underlined text passages are displayed.
o Brown
If underlined text appears in a highlighted block, it is colored brown.
ΓòÉΓòÉΓòÉ 4.3. Interaction ΓòÉΓòÉΓòÉ
An input consisting of more than one letter (except the key commands) has to be
terminated with the ENTER-key. This are for example filenames or line numbers.
If EHP expects exactly one letter (for example in a yes/no query), pressing the
letter suffices and pressing ENTER is not needed.
Error messages, which are displayed in the status line must be confirmed with
ENTER. If a hint is displayed in the status line, e.g. the new status of the
the status of a binary variable, like the blockhighlighting status, this hint
will disappear automatically after a couple of seconds.
The keyboard commands are case sensitive. That means, if e.g. in the command
reference there is a command CTRL-x n then you have to use a lower-case n.
Note, that hence having Caps Lock activated accidently will cause troubles in
executing commands.
ΓòÉΓòÉΓòÉ 4.4. Fileformat ΓòÉΓòÉΓòÉ
The files to edit must be in ASCII format. With OS/2 the size of texts is
limited to some GB, which will satisfy most needs and will exceed swap space in
most cases. However, if a file should still be too large to load, an error
message will be displayed.
If lines longer than 500 characters appear, they will be wrapped (see also
Limits and bugs). The limit on the number of lines is 4G due to the limit of
integers, but this has no effect, since memory limits are more strict.
Note, that binary files should not be edited with EHP, since e.g. tabs are
expanded during load, and are only recompressed at the beginning of a line
(important for tools like MAKE). This could lead to an unexpected and
unpleasant change in representation.
A combination of an underscore followed by a backspace and a character is
interpreted as if that character is underlined. Characters entered in EHP's
underline mode are written to file in the same representation. Due to this
representation, if manually an underscore followed by a backspace (entered via
CTRL-c Backspace) is inserted before a character, this character will appear
underlined in the sequel. This is also true for an underscore-backspace
combination entered at the end of a line, which will be converted into an
underlined space.
ΓòÉΓòÉΓòÉ 5. Commands ΓòÉΓòÉΓòÉ
The keyboard mapping for commands was chosen in a way that key combinations can
be remembered as easily as possible. However, a compromise had to be found
between shortness of commands and the mnemonic property. So for heavily used
commands sometimes in the predefined keyboard mapping a somewhat cryptical
combination has been chosen to speed up everyday's work (e.g. CTRL-t for
'delete word').
The key combinations for invoking the commands may be changed by using the
withcoming tool KM, explained below (see Keyboard remapping).
Note, that if typing an illegal combination, all typed keys belonging to the
current command are discarded up to and including the one causing the sequence
to be illegal. Say for example you wanted to type the command for deleting a
block (CTRL-b d) but you hit s instead of d, then the CTRL-b and the s are
discarded. This can of course be used as a kind of escape facility. E.g. the
spacebar is currently not assigned any command. So pressing SPACE escapes from
a multi-key command.
ΓòÉΓòÉΓòÉ 5.1. Moving text and cursor ΓòÉΓòÉΓòÉ
ΓòÉΓòÉΓòÉ 5.1.1. Change cursorposition ΓòÉΓòÉΓòÉ
In order to position the cursor there are many commands. All have in common
that they can't move the cursor beyond the last line of the text and beyond
column 501 (see Limits and Bugs). If the cursor would move out of the window,
the text is scrolled accordingly.
The following sections will describe the single commands in detail.
Character oriented
o Arrow-left
moves the cursor one column left, if not already in column 1. If in column 1,
then the cursor is moved to the end of the previous line, if the current line
number was greater than 1.
o Arrow-right
moves the cursor one column right, if not already in column 501.
Word oriented
Word separator are the following characters: .,#:;]@$&()[]{}!?'`/\<>-+*=" in
addition to TAB, SPACE and a line break.
o CTRL-Arrow left
moves the cursor one word left, if not already at the beginning of the line.
Consecutive word separators (except if separated by blanks or tabs) are
treated as one word, which makes word skipping much more convenient. By the
way: this is the way, VI does word skipping, too.
o CTRL-Arrow right
moves the cursor one word right, if not already at the last word of the line.
As stated above, consecutive word separators not separated by blanks or tabs
are treated as one word. If the cursor is placed on the last word in a line,
this function places the cursor immediately right to the end of the line (as
if the End-key had been pressed).
Line oriented
o Home
moves cursor to the beginning of the current line.
o End
moves cursor to the end of the current line.
o Arrow up
moves cursor up one line, if not already in first line of current file.
o Arrow down
moves cursor down one line, if not already in last line of current file.
o ENTER (in overwrite mode, see Insert and delete)
moves cursor to the beginning of the following line, if the current line is
not the last line of the current file.
Window oriented
o CTRL-Home
moves the cursor to the top of the current window. Note that this need not be
the first line of the file.
o ALT-Arrow right
move the cursor to the middle line of the current window. If the last line of
the file is displayed above the middle of the window or the window is empty,
then the cursor is placed to the last line of the file.
o CTRL-End
moves the cursor to the bottom of the current window. Note that this need not
be the last line of the current file. If the last line of the file is
displayed above the bottom of the window, then the cursor is places in the
last line of the file.
ΓòÉΓòÉΓòÉ 5.1.2. Change window contents ΓòÉΓòÉΓòÉ
Line oriented
o ALT-Arrow up
makes current line the top line of the current window.
o ALT-Arrow left
makes current line the middle line of the current window.
o ALT-Arrow down
makes current line the bottom line of the current window.
o CTRL-Arrow up
moves window content up one line, if the current line is not the last line of
the current file and is located at the top of the window. The cursor stays in
the same line number, if it was not in the top line of the window. If the
latter was the case, then it is moved down to the next line. That means it
stays on the same screen position in that case.
o CTRL-Arrow down
moves window content down one line, if the first line on the current file is
not already visible in the window. The cursor stays in the same line number,
if it was not in the bottom line of the window. If the latter was the case,
then it is moved up to the next line. That means it stays on the same screen
position in that case.
Page oriented
o PgUp
scrolls up one page, if not already at the beginning of the file. The
direction is hence towards smaller line numbers.
o PgDn
scrolls down one page, if not already at the end of the file. The direction
is hence towards greater line numbers.
o ALT-PgUp
sctolls up half a page, if not already at the beginning of the file. The
direction is hence towards smaller line numbers.
o ALT-PgDn
scrolls down half a page, if not already at the end of the file. The
direction is hence towards greater line numbers.
ΓòÉΓòÉΓòÉ 5.1.3. Absolute jumps ΓòÉΓòÉΓòÉ
o CTRL-PgUp
moves the cursor to the first line of the current file.
o CTRL-PgDn
moves the cursor to the last line of the current file.
o CTRL-g n
go to a specific line number. The query for the line number is displayed in
the status line.
o CTRL-g b
moves cursor to the beginning of the block marked in the current window. If
no block is marked in the current window, then the corsorposition remains
unchanged.
o CTRL-g e
moves cursor to the end of the block marked in the current window. If no
block is marked in the current window, then the corsorposition remains
unchanged.
o CTRL-g l
move the cursor to the so-called 'last position'. This position is saved,
when a jump to the beginning or the end of a file, a search, a replace or any
of the CTRL-g commands is performed. By the latter it is possible to jump
back and forth between two positions by repeatedly doing CTRL-g l.
o Left mouse button
By moving the mouse pointer to a suitable position and pressing the left
mouse button once, the cursor is moved to the mouse position. Note, that this
also works, if the mouse pointer is located outsinde the current window (see
window switching).
o CTRL-p
move the cursor to the bracket or parenthesis matching the one being nearest
to the cursor. This command is extremely useful for testing the matching of
nested parenthesis / curly braces as they appear in C or in LISP. If no
matching parenthesis / bracket is found, EHP issues a beep.
ΓòÉΓòÉΓòÉ 5.1.4. Marker ΓòÉΓòÉΓòÉ
There is a total of ten markers which may be set anywhere in open windows.
Markers are global, which means, that a marker not only contains the cursor
line and column, but also the window index. This may be helpful for performing
fast window switching, since of course the window of the marker jumped to is
made to be the current window.
o CTRL-g s <n>
sets marker number <n> at the current position.
o CTRL-g g <n>
goes to marker number <n> and activates the corresponding window.
ΓòÉΓòÉΓòÉ 5.2. File operations ΓòÉΓòÉΓòÉ
The following operations always refer to the current window and to the whole
file in the window.
o CTRL-e l
loads a file into the current window. The file in the current window, and all
unsaved changes applied to it, are discarded after a security query. The name
of the file to load is asked for in the status line. If a file with that name
is already contained in another open window, then this is announced and one
can choose to edit that window or nevertheless load the file in the current
window. Note, that the latter causes two possibly different copies of the
same file to be held in EHP, which could lead to loss of changes.
o CTRL-e s
saves the file contained in the current window. If the backupoption is
activated, the file, which would be going to be overwritten, gets the
extension '.bak'. File attributes (system, hidden etc.) remain as they were
when loading the file. New files are created as non-system, non-hidden and
writeable.
o CTRL-e r
renames the file and saves it under the new name. The new file name is asked
for in the status line. Note, that the file with the old name is not deleted.
Subsequent saving causes the file to be saved with the new name.
o CTRL-e m
saves all modified files. Files not modified are not written to disk on this
command.
ΓòÉΓòÉΓòÉ 5.3. Block operations ΓòÉΓòÉΓòÉ
EHP offers a great variety of block commands. It is important to know, that EHP
supports two kinds of blocks. There are the so-called rectangular blocks. They
are defined by marking the upper left corner and the character right to the
lower right corner. The rectangular field between is the block. These blocks
are nice to move parts of tables or comments in a program.
The second block kind is the so-called normal block. One marks the first
character and the character right to the last character. All the text between
(with line wrapping etc.) belongs to the block. These blocks are good for
moving whole paragraphs or parts of paragraphs.
ΓòÉΓòÉΓòÉ 5.3.1. Updating of block boundaries ΓòÉΓòÉΓòÉ
When inserting lines before a block, then the beginning and the end of the
block are moved correspondingly. So the text does not move through the block,
but the marked block moves and the block contents stay the same. When a line is
inserted within the block, then the block end moves one line down. When
characters are inserted or deleted within a block, then the resulting block
changes depend on the block kind.
For normal blocks if the character was inserted/deleted in the last block line
(i.e. the block end is on the current line), then the block end moves
right/left one position.
For rectangular blocks the block remains rectangular with the same width all
the time. That means, that characters may be moved outside/into the block.
ΓòÉΓòÉΓòÉ 5.3.2. Blockhighlighting ΓòÉΓòÉΓòÉ
If a block was correctly marked, i.e. the block end comes after the block
beginning (though you can mark them in any order) and the blockhighlighting is
activated, then the block is displayed in a color different from the standard
text color. The blockhighlighting can also be turned off via the environment
variable EHPINIT.
ΓòÉΓòÉΓòÉ 5.3.3. Block oriented commands ΓòÉΓòÉΓòÉ
Note, that the following commands perform actions on blocks local to the
current window except the commands 'Cut' and 'Paste'. Only with these two
commands it is possible to move blocks between windows.
o CTRL-b b
marks the beginning of a block. The character the cursor is on is the first
one belonging to the block.
o CTRL-b n
marks the end of a normal block. The current character is the first one not
belonging to the block.
o CTRL-b r
marks the end of a rectangular block. The current character is the first one
not belonging to the block.
o CTRL-b u
unmarks the block. That means, that block beginning and block end are
unmarked and that, if it was activated, the blockhighlighting disappears.
o CTRL-b c
copies the marked block to the current cursor position. The block is
inserted, so no characters are overwritten. In case of a rectangular block a
check is performed, if insertion of the block does not collide with the
maximum line length. If it does, then the block is not inserted. If no block
was marked, nothing happens.
o CTRL-b m
moves the marked block to the cursor position. As with copying, a check is
done to see, if a rectangular block does not collide with the maximum line
length, if inserted at the cursor position. It is not moved, if it does
collide. If no block was marked, nothing happens.
o CTRL-b d
deletes the marked block. You can undo this command by using the block copy
command CTRL-b c. But note, that this undoing only works as long as no new
block boundary has been set. Furthermore, the buffered deleted block is
discarded when exiting EHP and is not stored in the configuration file.
o CTRL-b i
indents the block by a certain amount of columns to the right or left. The
number of columns is queried in the status line. Providing a positive number
shifts the block to the right, a negative number to the left. Note, that a
negative number with an absolute value greater than the maximum number of
leading spaces in the block leads to loss of characters in such lines, since
they are shifted 'outside the window'. All block lines including block
starting line and block ending line are shifted, except when the block end is
on the first column of a line. Then this line is not shifted left, since no
character of that line belongs to the block. Block start and end column are
shifted also, except the block end column was in the first column. In this
case indenting the block will leave the block end column unchanged. This will
cause the line, where the block end is set, not to fall into the block, which
would be surprising, when indenting the same block again.
o CTRL-b r
reads a file, of which the name is asked for in the status line and inserts
it at the cursor position. The file contents are marked as a normal block.
o CTRL-b w
writes the marked block to a file, of which the name is asked for in the
status line. This works for normal and rectangular blocks.
o CTRL-b f
passes the block contents to an external filter (e.g. SORT), deletes the
block and inserts the filter outputs as a new block at the position of the
old one. If the filter returns with a non-zero value, one can decide, whether
the results should nevertheless be inserted as block or if they should be
discarded. The former can be useful for programs, which are known to return
non-zero values even if no error occurred.
Note, that the name of the used filter serves as default for the next call.
Thus the previously used filter name is displayed in the prompt for the new
filter name. If one wants to use the default, one just has to press ENTER
without providing the filter name.
o CTRL-b t
cuts the block. This is not a cut in the common sense, since it has become a
standard for cut operations to delete the cutted part. This cut only copies
the marked block into the so-called 'paste buffer'. The contents of the paste
buffer can be inserted in any window, as described in the sequel.
o CTRL-b p
pastes the contents of the paste buffer into the current window at the cursor
position. To do this, one previously has to cut a block with the CTRL-b p
command. The paste buffer is not emptied by this command. Hence one can
repeatedly insert the same block by iterating the command.
o Left mouse button with moving
By pressing the left mouse button on the first block character and releasing
it on the first non-block character, one marks a normal block.
o Right mouse button with moving
By pressing the right mouse button on the first block character and releasing
it on the first non-block character, one marks a rectangular block.
o Clicking the right mouse button
has two functions depending on whether a block is marked in the current
window and whether a block is contained in the paste buffer. If a block is
marked in the current window, then the cut command is performed, storing the
block in the paste buffer. In addition the block is unmarked.
If no block is marked in the current window, but the paste buffer is not
empty, then the paste buffer contents are inserted at the mouse position
(corresponds to the paste command). If the paste buffer is empty, only the
cursor is positioned at the mouse position.
o Middle mouse button with left mouse button
If the middle mouse button is held down and then the left button is pressed,
a block marked in the current window is moved to the mouse position. If no
block was marked in the current window, nothing happens.
o Middle mouse button with right mouse button
If the middle mouse button is held down and then the right button is pressed,
a block marked in the current window is deleted. If no block was marked in
the current window, nothing happens.
ΓòÉΓòÉΓòÉ 5.4. Window commands ΓòÉΓòÉΓòÉ
The most obvious feature of EHP is the possibility to edit multiple texts quasi
simultaneously by using windows. The editor functions for the use of windows
are explained below.
ΓòÉΓòÉΓòÉ 5.5. Window switching ΓòÉΓòÉΓòÉ
o CTRL-w p
makes the window which was previously active become the current window.
Successively using CTRL-w p thus jumps back and forth between two windows.
o CTRL-w n
makes the next window the current one (whatever 'next' will be). Only one
this about 'next' is asserted: one can use it to cycle through all opened
windows.
o CTRL-w d
makes a window containing a certain file become the current window. The file
name must be entered in the status line after issuing the command. If no file
with the desired name is in any window, one gets the option to load the
specified file into a new window.
o CTRL-w i
makes the window with a certain number the current window. The window number
is queried in the status line. If a window with the specified number does not
exist, an error message is displayed.
o Left mouse button
By clicking with the left mouse button, the window on which the mouse points
becomes the current window and the cursor is placed on the mouse position
(except the window frame was hit).
ΓòÉΓòÉΓòÉ 5.5.1. Changing size and position ΓòÉΓòÉΓòÉ
The size and position of each window can be changed either by using the
corresponding key commands or by using the mouse. In general it is advisable to
use the mouse. Key commands for that take some time to get used to...
o CTRL-w s
leads to a mode where you can use the cursor keys to resize the current
window. Only the corners of the window frame are displayed. Cursor keys move
the lower right corner. Hitting ENTER confirms the chosen size.
By pressing 's' during adjustment one can toggle the stepwidth between 5 and
1.
o CTRL-w m
leads to a mode, in which the position of the current window can be changed.
The whole window, of which only the corners are displayed during movement,
can be moved via the cursor keys. As in resizing, pressing 's' toggles the
stepwidth between 5 and 1.
o CTRL-w t
EHP stores two positions for each window. When a window is opened, both are
set to full size. When you now move or resize the window, the second stored
size/position remains unchanged. You can switch between these two
sizes/positions by using this command. Of course the second position remains
only as long full screen as you don't change it. It is thus possible to work
with two size/position pairs which are both non-fullscreen.
o Left mouse button on lower right corner
By pressing the left mouse button on the lower right window corner and
holding it down, one can resize the window by moving the mouse with the left
button pressed. As when changing window position by key commands, the window
size is indicated only by its four corners. Releasing the button confirms the
chosen size.
o Left mouse button on upper window border
By pressing the left mouse button on the top window border and holding it
down, one can move the window by moving the mouse with the left button
pressed. As when changing window position by key commands, the window
position is indicated only by its four corners. Releasing the button confirms
the chosen position.
o Left mouse button on upper right corner
By pressing the left mouse button on the upper right window corner and
holding it down, one can switch between the two window sizes. This
corresponds to the key command CTRL-w t.
ΓòÉΓòÉΓòÉ 5.5.2. Open and close windows ΓòÉΓòÉΓòÉ
EHP allows to have as many windows open simultaneously, as there are 32-bit
integers (though this limit may be somewhat theoretically, since memory limits
will be much more severe.
o CTRL-w o
asks for the file name in the status line and loads the named file into a new
window. If the file is already in an open window, EHP asks, whether it is
desired to switch to that window instead of opening a new one.
The newly opened window is assigned the smallest free window number and both
window sizes are set to the size of the screen. The cursor is placed in the
first line and the first column and autoindent is activated, if specified in
EHPINIT. The tab-compression is activated by default. The tab length is set
to the default 8, if not specified different by command or via EHPINIT. The
window is put to insert mode by default and underlining is turned off. Shell
mode is deactivated by default.
o CTRL-w c
closes the current window. If changes were made to the text (indicated by
MODIFIED in the bottom frame border), a confirmation is requested, avoiding
accidental loss of changes.
ΓòÉΓòÉΓòÉ 5.6. Insert and delete ΓòÉΓòÉΓòÉ
EHP distinguishs the insert mode and the overwrite mode. The mode is local to
each window and is indicated in the top frame border (Insert or Overwrt). If in
insert mode, typed characters are inserted in the text, in overwrite mode
existing characters are overwritten. In order to switch between modes, use the
following:
o Ins
toggles between insert and overwrite mode
o Del
deletes the current character (the one the cursor is on). If there are
characters to the right of the cursor, they are pulled left one position. If
the cursor was right of the end of the line, hitting Del causes the current
line to be joined with the subsequent one (see also CTRL-j described below).
o Backspace
deletes the character left to the cursor. Characters to the right of the
cursor including the one the cursor is on are pulled left one position. If
the cursor was on the first column of a line, then the current line is joined
with the line above, provided that the current line was not the first line of
the current file. See also CTRL-j described below for joining lines.
o CTRL-t
deletes all characters beginning with the one under the cursor up to the last
character before the next word. If there is no next word, because the cursor
is placed in the last word of the line, then all characters up to the end of
the line are deleted.
o CTRL-y
deletes the current line. It can be restored with CTRL-k as described below.
o CTRL-k
inserts the last deleted line before the current line.
o CTRL-q
deletes from the cursor to the right up to the end of the line including the
current character.
o CTRL-a
inserts an empty line at the current cursor position. The current line is
thus moved down one line. If autoindent is active, then the cursor is
indented accoring to the current line. That means, if e.g. the current line
starts with 5 blanks and CTRL-a is performed with autoindent active, then the
cursor is positioned in column 6 of the inserted line. Note, that only
non-underlined blanks count for this purpose, as well as only non-underlined
blanks are inserted for doing the indentation, regardless of the current
underline mode.
o CTRL-o
inserts a line below the current line. If autoindent is active, then the
cursor is indented according to the current line. That means, if e.g. the
current line starts with 5 blanks and CTRL-a is performed with autoindent
active, then the cursor is positioned in column 6 of the inserted line. As
with all indentation, underlined blanks do not count as blanks for
determining the indent width. Also, the inserted blanks are not underlined,
no matter what the current underline mode is.
o ENTER
If in insert mode, the current line is splitted at the cursor position and
the part from the cursor to the right is placed in the inserted line. The new
line is indented according to the splitted line, if autoindent is active. For
this indentation always non-underlined blanks are used, for doing the
indentation as well as for determining the indentation width (see also
Underline). The cursor will be located in the first column of the inserted
line afterwards. If in overwrite mode, then the cursor is placed in the first
column of the next line, if the current line is not the last line in the
file. No line is inserted in overwrite mode.
o CTRL-j
joins the current line with the subsequent line. First the cursor is placed
two characters behind the end of the current line. Then the following line is
moved to the cursor position, if the length of the line doesn't exceed 500
characters (see Limits and Bugs). While doing this, leading blanks are
removed from the line moved to the corsor position. So, there remains exactly
one blank character between the current line and the following line.
Note the funny feature, that CTRL-ENTER is equal to CTRL-j under OS/2 and
thus invokes the joining of lines.
ΓòÉΓòÉΓòÉ 5.7. Find and replace ΓòÉΓòÉΓòÉ
Searching with EHP supports regular expressions for matching patterns. All
expressions available with grep should work with EHP, too. If there is much
searching done on special characters like '[' or '.', then regular expressions
might slow down work and can therefore be turned off by using EHPINIT or by
command (see Miscellaneous for a description of the command) or by option when
doing the search.
ΓòÉΓòÉΓòÉ 5.7.1. Regular expressions ΓòÉΓòÉΓòÉ
Regular expression pattern matching is done with the GNU REGEX package. Thus
the recognized expressions should be the same as with grep. The most important
regular expression rules will now be summarized. Note, that 'X' stands for an
arbitrary regular expression.
Pattern matches
non-special character Each non-special character builds a basic regular
expression.
. (dot) matches any character.
\(X\) groups the expression X. May be used nested.
\n where n is a number, refers to the n-th group. Groups are numbered in
increasing order depending on the position of the left group
parenthesis from left to right. The \n refers to the text matched by
the group (not the pattern itself). That means for example, that
'\(oh+\) \1' matches 'oh oh' and 'ohh ohh', but not 'oh ohh' or 'ohh
oh'.
X+ matches an non-zero number of subsequent X's.
X* matches an arbitrary number of subsequent X's. Zero occurrences are
included. For example '\(ab\)*' matches 'abab'.
X? matches zero or one occurrence of X.
[Y] matches all characters contained in Y. Here Y is not an arbitrary
regular expression. Instead, Y may consist of a number of single
characters ([yYnN]) and of sequences. Sequences are specified by the
start and the end of the sequence separated by a dash. For example
[a-zA-Z] matches all letters, and [0-9] matches all digits.
^X matches X, if it is found at the beginning of the line.
X$ matches X, if it is found at the end of the line.
\<X matches X at the beginning of a word.
X\> matches X at the end of a word.
\ is the escape character. To avoid interpretation of a special
character (like '[' or '*'), such characters must be preceded by a
backslash. To search for a backslash double the backslash ('\\').
Note, that a parenthesis matches itself, while an escaped parenthesis
is good for grouping patterns (see above).
ΓòÉΓòÉΓòÉ 5.7.2. Find and replace commands ΓòÉΓòÉΓòÉ
o CTRL-f f
searches for a pattern, which is asked for in the status line. By default the
search is case sensitive and is directed forward. It starts at the character
right to the cursor (important for repeated searches) and wraps around the
end of the text to the beginning. By default, the search pattern is
interpreted as a regular expression as used with grep. See above for turning
regular expressions off and note the options 'x' and 'n' explained in the
sequel. When the search pattern is empty, no search is done.
When the search pattern has been entered, EHP asks for the options in the
status line. The following options can be combined as you like (no options is
allowed, too; just press ENTER). Exceptions are, that b and e exclude each
other and that r has no effect, if b or e are used. Available are:
Option Effect
<number> find the <number>th occurrence of the pattern
r search in reverse direction
i ignore case (case insensitive search)
w find words only (found pattern must be limited by a word
separator
b search from the beginning of the text
e search from the end of the text in reverse direction
x interpret regular expressions in search pattern
n don't interpret regular expressions in search pattern
o CTRL-f r
ssearches a specified number of times for a pattern and replaces it. By
default, EHP asks before replacing a found pattern. This can be turned off
using the options. Another default is, to underline the replace expression
according to the underlining of the first character of the found pattern.
Imagine, the text was 'documentation for editor EHP in INF format', and the
replace is started with search pattern 'EHP' and replace pattern 'VI', then
the replacement string is underlined, since the first letter of the found
'EHP' was underlined. The resulting text is thus 'documentation for editor VI
in INF format'. The underlining of the replace expression can be modified
using the options. Note the difference between the number option with the
find and the replace command: when doing find with option '10', the 10th
occurrence is found. When replacing with option '10', the first 10
occurrences are replaced (NOT only the 10th occurrence!). Options are as with
find, additionally the following options are available:
Option Effect
a replace all occurrences in the current file
g global: don't ask for replacement
u underline according to underline state This means, that the
replace expression underlining is not determined from the
underline state of the found pattern's first character, but from
the current underline state in the current window (indicated in
the window's top border). Thus, if underlining is turned on for
the current window, then the replace expression is underlined
regardless of underlining of the found pattern.
o CTRL-n or CTRL-f a
repeats the last search or replace action. The search and replace patterns
remain the same. Only the number provided in the options is reset to 1
(nevertheless, when doing replace, option a is interpreted as before), and
options b and e are removed.
ΓòÉΓòÉΓòÉ 5.7.3. Find multiple spaces ΓòÉΓòÉΓòÉ
When searching or replacing, the search pattern may contain blanks. Due to
EHP's internal representation of text, blanks beyond the end of the line are
not matched. That implies, that an empty line is not matched by a search
pattern consisting of one blank. Note this for example, if a search is done for
'not ': a 'not' at the end of line is not found with this pattern. Use either
the w option (for finding words only) or construct a suitable regular
expression.
ΓòÉΓòÉΓòÉ 5.8. Tabs and indentation ΓòÉΓòÉΓòÉ
EHP supports two kinds of tabstops: tabs with fixed width and tabs depending on
word boundaries of the above line. Which kind of tabs is used depends on the
autoindent mode of the current window.
Tabs are expanded to spaces in the text. If tab-compression is activated, each
8 (independent of the chosen tabwidth) leading spaces on a line are compressed
into a tab when the text is written to a file. Otherwise they remain spaces.
Tab-compression is turned on by default.
o CTRL-s a
toggles the autoindent mode for the current window. The mode is displayed in
the top window border (Insert or Overwrt).
ΓòÉΓòÉΓòÉ 5.8.1. With autoindent ΓòÉΓòÉΓòÉ
If autoindent is active for the current window, the tabwidth is determined by
looking at the line above the current line. The tab forward skips as far as a
'word right' command would skip in the above line. Similar, a tab back skips as
far as a 'word left' command would skip in the above line. This is good for
indenting comments or for jumping to the same indentation as used in the above
line. If the cursor is located beyond the end of the above line, tabs proceed
as without autoindent. Note, that tab backward and tab forward are inverse
operations except when the cursor is located below the last word of the above
line. In this case, the tab forward skips below the position immediately behind
the end of the word in the above line, while the tab backward skips below the
beginning of that word.
If a line is splitted in autoindent mode using ENTER, the line on which the
cursor is after the operation is indented that way, that it starts below the
start of the first word of the above line. Inserting a line before or after the
current line using CTRL-a or CTRL-o places the cursor in the column, where the
first word of the previously current line starts.
ΓòÉΓòÉΓòÉ 5.8.2. Without autoindent ΓòÉΓòÉΓòÉ
In this mode the tabwidth is determined only by the predefined tabwidth, which
is 8 by default. This tabwidth can be modified by two ways: These are the
environment variable EHPINIT or by the command
o CTRL-s t
asks for the new tabwidth, which can be entered in the status line. As
default for this input yields the currently chosen tabwidth. Thus, pressing
ENTER upon this query keeps the tabwidth unchanged.
ΓòÉΓòÉΓòÉ 5.9. Repeating ΓòÉΓòÉΓòÉ
o CTRL-r
repeats a command to specify a certain number of times. EHP first asks for
the number of repetitions in the status line. Here an empty or zero input
causes the command to repeat nothing. If a non-zero input was made, the
command to repeat is asked for. One can enter the command as if it should be
executed directly with one exception: the ENTER key must be escaped by
prefixing it with CTRL-c (see also Controlcodes), since pressing the
ENTER-key unescaped will be interpreted as the end of the command sequence.
Note, that during input of the command the usual help texts will be displayed
in the status line, if not turned off.
Repeating may be nested up to a depth of 20. Note, that macros also each take
one of those nesting levels. So, if your command to repeat contains a macro,
which itself has a nesting depth of say n, then there must be less than 20-n
nested repeats around it.
Look at the following example for a better understanding. It causes five new
lines to be inserted at the cursor position, where each of them is filled
with the string 'hello':
Key commands Effect
CTRL-r For invoking the repeat command
5 ENTER For specifying the number of repetitions
CTRL-c For escaping the subsequent ENTER
ENTER For inserting the new line at the cursor position
hello The text to be inserted in the new line
ENTER For terminating the command sequence to repeat
o CTRL-n or CTRL-f a
repeats the last find/replace command.
ΓòÉΓòÉΓòÉ 5.10. Underline ΓòÉΓòÉΓòÉ
EHP offers the possibility to enter underlined text. See Fileformat for the
representation of underlined characters in the resulting file and consequences
of this representation. On the screen, underlined characters are displayed in
red color. The underline mode is local to each window and is displayed in the
top window border (Under in activated underline mode, nothing in non-active
underline mode).
If underlining is active, each inserted / overwritten character is
automatically underlined. Furthermore, underline mode influences replacing
To toggle the underline mode for the current window, use the following command:
o CTRL-u
toggles the underline mode for the current window.
ΓòÉΓòÉΓòÉ 5.11. Automatic line break ΓòÉΓòÉΓòÉ
EHP supports a mode for automatically breaking the current line if the cursor
otherwise would leave the window to the right. If this linebreak mode is
active, then if the cursor would step on the right window margin, the next
blank left to the cursor is searched, the cursor is placed right to this
position (i.e. on the beginning of the current word) and a newline is executed.
Note, that if the autoindent mode is active, then the splitting of the current
line will indent the new created line according to the current line. If
overwrite mode is active, then the cursor will be placed on the next line by
the execution of the newline. This is exactly what happens in overwrite mode,
if the ENTER key is hit. This, of course, does not make much sense. So the use
of insert mode is highly recommended when using the automatic linebreak mode.
The automatic linebreak mode is toggled by the following command:
o CTRL-s l
toggles the automatic linebreak mode
It can furthermore be set as the default for window creation by the flag
linebrk in the environment variable EHPINIT.
ΓòÉΓòÉΓòÉ 5.12. Reflowing of paragraphs ΓòÉΓòÉΓòÉ
EHP enables its user to reflow paragraphs so that they are as close as possible
aligned to the right window margin. Reflowing is started at the corsor line and
ends before the next empty line or the end of the text.
The margins used for reflowing are as follows: As right margin the right window
margin is used. So if reflowing to a certain size differing from the current
window size is desired, first resize the window, then reflow and afterwards
change the window size back to the previous size (see also changing window
size). What is taken to be the left margin for reflowing depends on the
autoindent flag. If it is set, then the column of the first non-whitespace in
each current line is taken as the left reflow margin. Otherwise, the left
reflow margin defaults to column 1.
Reflowing only breaks lines at blank characters. Character sequences separated
only by the so-called 'word separators' (e.g. '-' or '.') are not broken apart.
The cursor is positioned at the character where it was when reflowing started.
This may of course be in a line further down and more to the left due to moving
of that character during the reflowing process.
Reflowing might not work for two reasons. First, the maximum line capacity of
EHP might become exceeded by the breaking of the lines. Second, an error may
occur, when a line is shorter than the reflow width and the subsequent line
can't be joined because the length would go beyond EHP's line length limit.
o CTRL-d
initiates the reflowing of the current paragraph beginning at the cursor
position and ending at the next empty line or the end of the text.
Handle this command with care, since at the moment there exists no undoing for
this command. So, if the empty line you expected to be there isn't there, then
the results may be quite farther-going than you wanted. You can stop this
command by hitting CTRL-Break.
Regrettably, there was no mnemomical key binding available for this command. If
someone has a good idea, how CTRL-d* ************************************
ΓòÉΓòÉΓòÉ 5.13. Controlcodes ΓòÉΓòÉΓòÉ
Controlcodes cannot simply be typed to insert them into the text beacuse they
would issue a command. Nevertheless EHP allows to insert them by escaping them
with CTRL-c.
o CTRL-c <character>
insert <character> into the text, regardless whether it is a controlcode or
even the escape key. Only a NULL character cannot be inserted at all, since
this would mark the end of line. CTRL-c CTRL-c inserts a ^C into the text,
for example. Characters with ASCII code smaller than 28 are displayed as
invers character with 64 added to the ASCII code. Thus, e.g. an CTRL-a is
displayed as invers A.
ΓòÉΓòÉΓòÉ 5.14. Quit EHP ΓòÉΓòÉΓòÉ
o CTRL-x s
leaves EHP and saves all modified files. If the backupoption is active, then
the old file is saved by appending '.bak' to its name. The file attributes
remain as they were when loading the file, they are set to writeable,
non-system and non-hidden, if a new file is saved. If files cannot be saved
for some reasons, a warning is displayed. EHP offers the possibility to leave
anyway or to proceed with further editing.
o CTRL-x n
leaves EHP without saving modified files. For safety, this action has to be
acknowledged in the status line.
o CTRL-x S
leaves EHP without saving modified files after an acknowledgement,
additionally the load file is executed.
o CTRL-x N
leaves EHP with saving modified files after an acknowledgement (see above),
additionally the load file is executed.
ΓòÉΓòÉΓòÉ 5.15. Undo ΓòÉΓòÉΓòÉ
The only undo implemented so far is restoring a deleted line.
o CTRL-k
inserts the last deleted line before the current line and makes this line the
current line. This command can be executed multiply (good for quickly
duplicating the current line or copying it to many different locations).
ΓòÉΓòÉΓòÉ 5.16. Macros ΓòÉΓòÉΓòÉ
Macros are user-defined key command sequences (no mouse commands can be
recorded within a macro). They can be recorded, executed, nested and repeated.
Note, that the maximum nesting depth is limited to 20.
o CTRL-v X (where X stands for an upcase letter)
records macro X. One can now input the key sequence, which is to make up the
macro. The maximum macro length is limited to 500 characters (the maximum
line length), where keys producing more than one character are counted as
multiple characters. If this sould be a limit to you, make use of nested
macros and the repeat command. During input of the macro, EHP displays the
usual helptexts in the status line, if they are not disabled. To finish the
macro recording hit the ENTER key. To insert an ENTER into the macro, use the
controlcode technique, that means, hit CTRL-c ENTER.
o CTRL-v x (where x stands for an lowercase letter)
executes macro x. Note that this command cannot be entered when an input in
the status line is expected (e.g. the search expression). If this is desired,
the command issuing the status line query has to be included in the macro. If
the chosen macro is empty, a warning is displayed. For stopping the execution
of a macro see aboring running macros.
ΓòÉΓòÉΓòÉ 5.17. Abort running macro / repeat function ΓòÉΓòÉΓòÉ
Running macros and running repeat commands can be aborted.
o CTRL-Break
aborts all running macros and repeat commands. That means, that also in case
of a running nested macro all involved macros are terminated.
ΓòÉΓòÉΓòÉ 5.18. Shell escape ΓòÉΓòÉΓòÉ
EHP allows to execute shell commands from within a text window. This can be
done by using the shell mode.
o CTRL-s s
activates/deactivates the shell mode for the current window. If the shell
mode is active for the current window can be determined by looking at the top
border of the current windows's frame. If SHELL is displayed there, then
shell mode is active. To issue a command, hit ENTER. Then the part of the
current line to the left of the cursor will be taken as the command and
passed to the shell. The standard output will be inserted as a block at the
cursor position. Note that the current line will be split at the point where
the cursor was when hitting ENTER.
Commands expecting further user input should not be executed in this way,
since one cannot provide any further interactive input after issuing the
command. The result of invoking such a program would be, that the shell
didn't return. In this case the only way to get back to EHP is to hit
CTRL-Break, which must not be catched by the running program.
Now, which shell is executed? EHP always uses the shell specified by the
environment variable COMSPEC. This is usually c:\os2\cmd.exe. If the command
execution caused an error, a corresponding message is displayed.
ΓòÉΓòÉΓòÉ 5.19. Miscellaneous ΓòÉΓòÉΓòÉ
o CTRL-s a
toggles the autoindent mode for the current window. If autoindent is active
for the current window, this is indicated by the string Indent in the top
frame border.
o CTRL-s t
sets the tablength for the current window. The new tablength must be entered
in the status line. As default serves the current tablength, which means,
that pressing ENTER on the query leaves the tablength for the current window
unchanged. Thus this command can also be used to determine the current
window's tablength. See also Tabs and indent for more detailed information
about tabs.
o CTRL-s h
toggles activation of helptexts. If active, EHP displays a helptext in the
status line after the first key of a multi-key command. If the machine or the
display or whatever is too slow or one just wants the helptexts to disappear,
then helptexts can be deactivated by using this command.
o CTRL-s b
toggles the blockhighlighting. By default, a marked block is displayed
highlighted. This takes some time. As for helptexts, if this seems to be too
slow, this highlighting can be deactivated using this command.
o CTRL-s c
toggles the compression of tabs for the current window (see also Tabs and
indent). If activated, this is displayed by the string Tabs in the top frame
border, otherwise Spcs is displayed indicating, that leading spaces are
written out as spaces and not compress.
o CTRL-s r
Toggles the default for the usage of regular expressions in searching. This
default overrides the default set in EHPINIT but can be overridden by a
search option (see also Find and replace).
o CTRL-s .
toggles the creation of backup (.bak) files.
ΓòÉΓòÉΓòÉ 6. Configuration file ΓòÉΓòÉΓòÉ
The configuration file is updated upon leaving EHP. It contains global flags
(like blockhighlight, creation of backup files etc.), all defined macros,
information about window size, position and files loaded, and the position of
all defined markers. Thus is allows to restore the state exactly as it was when
reinvoking EHP.
When starting EHP the configuration file is looked for. If it is found, the
global flags and the macros are restored in each case. If no filenames were
specified in the command line, EHP loads the files specified in the
configuration file into windows with the same size and position they had when
leaving EHP the last time. In this case the markers are taken over, too.
The name of the configuration file is config.ehp in the current directory by
default. This is the name, under which it is written to disk as well as the
name under which it is searched when starting EHP. This name can be modified by
an entry in the environment variable EHPINIT. Via this option even an absolute
path for the configuration file may be specified with the effect of having all
ever defined macros global, for example.
ΓòÉΓòÉΓòÉ 7. Environment variable EHPINIT ΓòÉΓòÉΓòÉ
If an environment variable named EHPINIT is provided, EHP reads its contents
before reading the configuration file (so defaults specified in EHPINIT may be
overridden by values stored in the configuration file). Set EHPINIT by invoking
SET EHPINIT=...
from within config.sys or from the command line, where ... is an arbitrary
concatenation of the following options:
Option Effect
autoind Autoindent mode will be active when opening a new window.
nohelp Turns off helptexts when EHP is invoked.
noshowblock Blockhighlighting is turned off by default.
nobak When saving a file, no .bak file will be generated, if a
file with this name already exists.
deftab <n> where <n> stands for a number. This sets the default
tablength for a new window to <n>. <n> must be between 0
and 500.
conffile <f> where <f> is a filename path (absolute or relative). This
states, that the configuration file is stored and loaded
with the name <f>. An example might be conffile
c:\config.ehp.
loadfile <f> The load file is searched under path <f>.
screen <mode> where mode is <#columns>x<#lines> (instead of x also X is
possible). This sets the screen size to the desired values.
The provided values must be supported by the video card and
the operating system, otherwise the values default to
80x25, which should always be possible. An example might be
screen 80x50. Note, that after leaving EHP, the screen size
is switched back to the state it was in before invoking
EHP.
keys <f> Tells EHP to load the keyboard mapping from file <f>
instead of tasten.inf in the current directory. <f> may
contain an absolute path.
noregex Turns off regular expressions for searching be default.
This can be overridden by setting a global flag within EHP
by a command or by using a search option.
linebrk Turns on the automatic linebreak mode by default. It is
overruled by the manual setting for a window as well as by
the values stored for an open window in the config file.
clr_text <fg_color+16*bg_color> sets the color of the text display. Note, that
the frames around inactive windows are drawn with the same
color.
clr_frame <fg_color+16*bg_color> sets the color of the frame for the active
window. This is also the color used for highlighting the
mnemonical letters in the helpline.
clr_under <fg_color+16*bg_color> sets the color used for displaying underlined
characters
clr_block <fg_color+16*bg_color> sets the color used for displaying a
highlighted block.
The valued for fg_color and bg_color must lie between 0 and 15 (inclusive). The
bit values of each of them is defined as follows:
1 blue
2 green
4 red
8 light
Mixing the color bits yields the color resulting from the standard color
addition. Perhaps on the fullscreen display a light background may be
interpreted as blinking background. Check this out, if you want to use the
light-bit for your background setting and at the same time use EHP in a
fullscreen session.
ΓòÉΓòÉΓòÉ 8. Load file ΓòÉΓòÉΓòÉ
When leaving EHP, this can be done by a command, which invokes a batch file
after terminating EHP. By default, this batch file is searched in the current
directory and is assumed to be named load.cmd. This default name can be
overridden using the environment variable EHPINIT. A possible application for
this is, that load.cmd contains the call of make or a different compilation
tool, which performs some actions on the edited file(s).
ΓòÉΓòÉΓòÉ 9. Keyboard remapping (KM utility) ΓòÉΓòÉΓòÉ
To make EHP suit individual keyboard layout requirements, EHP comes with a
little tools enabling the modification and creation of own keaboard layout
files. Since this tool is used at most only a few times, it is not very gold
plated (not to say it is rather prehistoric, but it satisfies the basic needs).
This tool is called KM, which stands for 'keymake'.
KM can in addition to the modification of keystrokes modify the helptexts, that
can be displayed after the first key of the command in the status line. KM
assumes the keyboard file, which is called tasten.inf, to be located in the
current directory. If no such file exists in the current directory, then an
empty one it is created.
ΓòÉΓòÉΓòÉ 9.1. Main menu ΓòÉΓòÉΓòÉ
After invoking KM, it is tried to read in the tasten.inf file. If the file has
the wrong format, this is announced by an error message and the program stops.
Otherwise, a menu comprising four items will be displayed. These items are
o Change key combinations
o Change helptexts
o Show command names
o Exit (save keyboard file)
Issue the wished alternative by hitting the corresponding number (without
subsequent ENTER key).
ΓòÉΓòÉΓòÉ 9.2. Change keyboard command ΓòÉΓòÉΓòÉ
This command allows to provide key combinations for one or more commands. First
the number of the command to change is queried. To answer this question, the
below described option Show command names is helpful. Inputting the combination
number is quitted by hitting ENTER. If -1 is entered as key combination number,
changing of combinations is finished and KM returns to the main menu.
If a correct number was provided, KM shows the current mapping in decimal form.
If e.g. the combination is currently CTRL-l, then 12 is displayed, since the
ASCII code for CTRL-l is 12.
If the provided combination number exceeded the number of currently defined
combinations, then a new command is established with a number greater by one
than the combination number with the previously highest number. This of course
only makes sense, if a new tasten.inf file is created or indeed EHP was
extended by one or more commands (this would need a source code change as well
in EHP as in KM). In the latter case the modification of tasten.inf would
probably have been done by the programmer himself.
Now KM asks for the new key combination. This may consist of any key
combination not containing '/', since this is the key indicating the end of the
combination. It cannot be escaped. Note, that of course events like 'hitting
the left space key' or something like this can not be input at this point. When
chosing your combinations, note that commands must not be prefixes of each
other. This implies, that it is unconvenient to use normal letters like a,b,c
as the first character of a command, since then inputting these characters in a
text would not be easy anymore.
The assertion, that commands must not be prefixes of each other is checked
after inputting the combination. If a collision is detected, this is announced
by an error message and the old combination remains unchanged. In case the
entered combination was a new one (would have been added as the last
combination with the highest number), if a collision is detected, no new
combination is created.
If the provided combination consists of more than one ASCII code (note that
this is also true for some function and cursor keys), all existing helptexts
are displayed together with their indices. KM asks for a helptext index to link
to the current combination. This helptext would then be displayed in EHP's
status line after hitting the first character of the combination. If no
helptext should be displayed, then one has to enter -1 as helptext index (this
makes sense e.g. for the mentioned cases function keys or cursor keys). If a
non-existing helptext index is input, then KM asks for a new helptext. See
Change helptext for detailed information about changing and inputting the
helptexts.
ΓòÉΓòÉΓòÉ 9.3. Change helptext ΓòÉΓòÉΓòÉ
When this option is chosen, first all existing helptexts are displayed together
with their indices. KM then asks for the number of the helptext to change. If a
non-existing number is entered, the query is repeated.
If the helptexts with the provided number exists, it is displayed once more and
the new helptext is asked for. To enter letters, that should be highlighted in
EHP's helptext display, such letters must be enclosed in parenthesis. For
example '(L)ist' causes 'List' to be displayed. It is convention, to highlight
the letters, which invoke further commands.
One terminates the helptext by pressing ENTER. KM continues asking for helptext
numbers, until -1 is entered. This returns to the main menu.
ΓòÉΓòÉΓòÉ 9.4. Show command names ΓòÉΓòÉΓòÉ
All available editor commands are listed together with their numbers and names.
Using this command makes sense to get out the number of a certain command, for
which one wants to change the key combination.
One screen page is filled with command names, then a message is displayed, that
a keypress is expected for the continuation of the listing. Here, pressing a
aborts the listing. When the listing is finished, one further keypressed is
asked for, before KM returns to the main menu.
ΓòÉΓòÉΓòÉ 9.5. Quit KM ΓòÉΓòÉΓòÉ
This choice terminates the KM program. The keyboard mapping is written to the
file tasten.inf in the current directory. A possibly existing file will be
overwritten. Thus, save one working keyboard mapping file to avoid accidental
lost of keyboard definitions. To suppress the writing of the keyboard mapping,
terminate the program by hitting CTRL-Break from the main menu. Note that all
changes of this KM session will then be lost!
ΓòÉΓòÉΓòÉ 10. Appendix ΓòÉΓòÉΓòÉ
ΓòÉΓòÉΓòÉ 10.1. Limits and bugs ΓòÉΓòÉΓòÉ
The line length is currently limeted to 500. If this should be a problem for
anyone, please report (e.g. via email to auhl@fzi.de). Each window may contain
2^31-1 lines. There must be no more than 2^31-1 windows opened concurrently.
If the text in a window contains the mamimal number of lines, no blocks can be
moved anymore.
An underscore - CTRL-h combination ar the end of line is interpreted as
underlined space.
Tabs are not stored as tabs but expanded to spaces except at the beginning of a
line, where by default each 8 spaces are compressed to one tab. The latter
option allows the creation of makefiles, where the tab at the beginning of a
line has some concrete semantic. Still, this might be a limitation, especially,
if tables with constant column positions (almost) independent of the column
contents should be created (like it is possible with the way, VI handles tabs).
Also, this might be confusing, if a text containing tabs is loaded, modified
and saved, because in this case the tabs in the middle of a line are converted
to blanks.
ΓòÉΓòÉΓòÉ 10.2. Command reference ΓòÉΓòÉΓòÉ
Key combination Associated command
CTRL-a Insert line before current line
CTRL-b b mark beginning of block
CTRL-b c copy block to cursor position
CTRL-b d delete block
CTRL-b e end of rectangular block (good for moving comments)
CTRL-b f filter the block (e.g. pass the block through SORT)
CTRL-b i indent block (left or right)
CTRL-b m move block to cursor position
CTRL-b n end of normal block (with line wrap)
CTRL-b p copy contents of paste-buffer to cursor position
CTRL-b r read block from file and insert at cursor position
CTRL-b t cuT block (means: copy it to the paste-buffer)
CTRL-b u unmark block
CTRL-b w write block to file
CTRL-c abort repeat function or macro execution, insert control
code in text or command
CTRL-d Reflows the current paragraph
CTRL-e l load file in current window
CTRL-e m save all modified files
CTRL-e r rename file
CTRL-e s save file contained in current window
CTRL-f a Again (repeat last find or replace)
CTRL-f f find. For options see Find and replace.
CTRL-f r replace. For options see Find and replace.
CTRL-g b goto beginning of marked block
CTRL-g e goto end of marked block
CTRL-g g goto marker
CTRL-g l last position (stored before CTRL-g, jump to beginning or
end of file, searching, replacing)
CTRL-g n goto line number
CTRL-g s set marker
CTRL-j Join (append following line to the current one)
CTRL-k (from the German korrigieren (correct)) insert the line
deleted last (with CTRL-y) before the current line
CTRL-l Refresh (VI-like)
CTRL-n Repeat find/replace (same as CTRL-f-a)
CTRL-o (VI-like open line) insert line after current line
CTRL-p Jumps to the bracket (Parenthesis), that belongs to the
one, being nearest to the cursor.
CTRL-q Delete to end-of-line
CTRL-r repeat a command sequence n times
CTRL-s a autoindent
CTRL-s b blockhighlighting
CTRL-s c tabcompression (blanks may be converted to tabs when saving
the file, this is the default)
CTRL-s l toggle the automatic linebreak mode
CTRL-s r regular expressions (like with GREP) for searching
CTRL-s s shell mode (when pressing RETURN, the part of the current
line up to the cursor position is passed to the shell, the
result of the executed command is inserted in the text and
marked as a block)
CTRL-s t define tablength (how far the TAB key ought to jump, not
what number of spaces is converted to a tab in the text's
file representation)
CTRL-s . create .bak-files when overwriting an existing file
CTRL-t Delete word right to the cursor (Borland-like)
CTRL-u toggle underline mode (underlined characters are
represented by _^H<x> where <x> is the underlined
character).
CTRL-v Macro definition/execution
CTRL-w c close current window
CTRL-w d switch direct to another window by supplying the name of
the file contained in the window
CTRL-w i switch to window by index (number of the window displayed
in the lower left corner of each window)
CTRL-w m move window on the screen
CTRL-w n switch to next window
CTRL-w o open new window
CTRL-w p switch to previous window. This operation is symmetric,
i.e. applied twice, you get to the window where you were
before.
CTRL-w s change size of current window
CTRL-w t toggle window size (two sizes exist, both of which are
initially set to full size)
CTRL-x n exit without saving and without executing the load file
(the load file is a batch file, which can optionally be
executed when quitting the editor, e.g. it may contain the
call to MAKE)
CTRL-x s exit with saving all modified files, but without executing
the load file
CTRL-x N exit without saving, but with loadfile execution. The
default name for the load file is load.bat in the current
directory, but it can be modified using the environment
variable EHPINIT.
CTRL-x S exit with saving all modified files and executing the load
file.
CTRL-y delete the current line (can be undone using CTRL-k)
arr_left move cursor left one character
arr_right move cursor right one character
arr_up move cursor up one character
arr_down move cursor down one character
CTRL-arr_left move cursor left one word
CTRL-arr_right move cursor right one word
CTRL-arr_up move window content including cursor one line up
CTRL-arr_down move window content including cursor one line down
ALT-arr_left make current line appear in the middle of the window
ALT-arr_right move cursor to the middle of the current window
ALT-arr_up make current line first line of window
ALT-arr_down make current line last line of window
HOME move cursor to beginning of current line
END move cursor to end of current line
CTRL-HOME move cursor to the first line of the window
CTRL-END move cursor to the last line of the window
PgUp one page up
PgDn one page down
CTRL-PgUp go to beginning of file
CTRL-PgDn go to end of file
ALT-PgUp go half a page up
ALT-PgDn go half a page down
DEL delete character on which the cursor stands
Backspace delete character left to the cursor. If cursor is in first
column, join current line with the upper line.
Ins Toggle insert/overwrite mode
ΓòÉΓòÉΓòÉ 10.3. Mouse commands ΓòÉΓòÉΓòÉ
o Left button:
Position Effect
click on text in active window Set the cursor to the
current mouse position
click on text in non-active window Activate that window
(cursor position is NOT
set to mouse position).
If you want to set the
cursor to the mouse
position in the just
activated window, click
the left button again.
click and move on text Mark a normal block
(like CTRL-b b and
CTRL-b n)
click on headline and move Move the window
click on lower right corner of window and move Resize that window
click on upper left corner Close that window (like
CTRL-w c)
click on upper right corner Toggle window size (like
CTRL-w t)
click on arrows in frame Scroll text in arrow
direction
click on yes/no-question YES
o Right button:
Position Effect
click on text with no block marked and no block in PASTE-buffer Set the
cursor to the current
mouse position and
activate that window (if
not already activated)
click on text with no block marked and block in the PASTE-buffer Paste the
block from the
PASTE-buffer into the
text at the current
mouse position
click on text with a block marked in the window clicked to The marked block
is stored in the
PASTE-buffer and
unmarked
click and move on text Mark a rectangular block
(like CTRL-b b and
CTRL-b r)
click on headline Push the window into the
background
click on lower right corner of window and move Resize that window
click on upper left corner Close that window (like
CTRL-w c)
click on upper right corner Toggle window size (like
CTRL-w t)
click on arrows in frame Scroll text in arrow
direction
click on yes/no-question NO
o Middle and left: (press middle first, then left, probably three-button-mouse
is not supported by OS/2 at the moment)
Position Effect
on text move marked block to
mouseposition
o Middle and right: (press middle first, then right, probably
three-button-mouse is not supported by the mouse driver)
Position Effect
on text or frame with marked block in window clicked to delete marked block
in current window