QNX Community Resources

Home
Developer Resources
PDF Documents
[Previous] [Contents] [Next]

vedit

Fullscreen editor (QNX)

Syntax:

vedit [options]...
      [file [-a outfile1] [-l nnn]]...

Options:

-b
Browse mode
-c command
Execute macro command
-f
Fast file save (New group and ownership)
-i execfile
Execute execfile in place of veditrc
-m
Use monochrome (B/W) screen colors
-o8
Enable 8 bit (graphics) chars on CRT terminal
-r
Restricted: only file(s) listed on the command line can be edited.
-snnn
Restrict additional memory usage to nnn Kbytes
-x execfile
Execute autostartup file execfile
--
Indicates last option, permits file beginning with -
file
The pathname of a file to be edited.
-a outfile
The preceding file will be saved as outfile
-l nnn
("el") Editing of the preceding file will start on line nnn.

Description:

VEDIT lets you edit any files on your system, including text, program, binary, database, and mainframe files. It's also well-suited for editing huge multi-megabyte files. You can edit in ASCII, hexadecimal, octal, or EBCDIC.

VEDIT supports all QNX terminals, including the main console, QNX Windows, Photon, CRT terminals, and connections via serial lines or telnet.


Note: For information about the changes to vedit, see /qnx4/vedit/whatsnew.txt.

Getting Started Fast:

It's easiest to start VEDIT by specifying the name of the file(s) you want to edit:

vedit filename

You can then use the cursor keys to move around and make changes.

For help while editing, press the [HELP] key. The name of the help key is displayed on the status line (default: <F1>). [HELP] first displays the Table-Of-Contents for the online help. Press [HELP] again for help on using the online help.

The online help topics "QNX" and "QNXCFG" describe important aspects of using and configuring VEDIT that are specific to the QNX operating system.

To display the keyboard layout of the basic edit functions, select "[K]ey-layout" from the bottom line of the help viewer. For more help on any edit function, just press the corresponding key.

The [MENU] key (default: <F10>) starts the pull-down menu system. Select the desired function using the cursor keys and then press <Enter>.

To finish editing, access either the {FILE} or {ESCAPE} menu and select "Exit (save/abandon)". You are then prompted whether you want to save or abandon your changes.

The following pages describe VEDIT in somewhat more detail and often will refer you to particular online help topics for complete details.

Starting (Invoking) VEDIT:

Begin editing by typing the name of the VEDIT program; this is normally "vedit". Although not necessary, this is normally followed by the name of the file or files you want to edit or create. For example:

    vedit letter.txt
    vedit chapter1.txt chapter2.txt
    vedit chapter?.txt
    vedit *.c *.h

Invocation Options

The syntax for invoking VEDIT is:

 
   vedit [options]... [filename [-a outfile1] [-l nnn]]...

In addition to the filename, one or more "options" can be specified when you start up VEDIT. The commonly used options are:

-b
Puts VEDIT into "browse-only" mode; you can view files, but cannot alter them.
-m
VEDIT uses the monochrome (Black/White) screen attributes. (You can configure both a set of color attributes and a set of monochrome attributes.)
-r
Puts VEDIT into "restricted" mode; only the file(s) loaded from the command line can be edited. Additional files cannot be opened.
--
Signals the end of the options. This is needed only when the filename being edited begins with a "-".
filename
The name of the file or files to edit. The shell will expand any wildcard characters. Each single filename may be followed by the following two options:
-a outfile
The preceding file being edited will be saved under the name "outfile". This is similar to using the {FILE, Save as} function.
-l nnn
("el") Editing of the preceding file will start on line nnn. You can also specify a numeric expression such as "-l(7890/3)".

See also:

Give the commands "use vedit" or "vedit -h" for a short description of all invocation options.

The online help topic "INVOKE" fully describes all invocation options.

Exiting VEDIT:

You can selectively save or abandon each file that has been modified, or save or abandon all files at once.

To exit VEDIT and save or abandon the current file(s):

If no modified files are open, this will immediately exit VEDIT. Otherwise it displays each modified file and prompts whether it is to be saved or abandoned. For example:

Save chapter1.txt? [Yes] [No] [Save-all] [Quit-all] 
[Cancel]

Notes:

When you abandon a file, you discard changes made only since the last time you saved the file (e.g. with {FILE, Save and continue}).

{MISC, Shell} and {MISC, Run program} let you execute commands for deleting files. Be careful not to delete any files that start with the same name as the file(s) you are editing. VEDIT may be using these files for temporary storage.

See also:

The online help topic "EXITING" describes exiting in more detail, including the Edit Session Restore feature and backup files.

Using VEDIT:

VEDIT is very easy and intuitive to use. New users can access most features using only a few control/functions keys, the drop-down menu system and optionally a mouse. Experienced users can speed up their editing with "hot-keys" to directly access most editing functions and bypass the menus.

The keyboard layout is fully configurable and any desired number of hot-keys (keystroke macros) can be added. The menus dynamically display the hot-keys.

Extensive context sensitive online help is always available. In particular, help is available for each dialog box.

VEDIT has over 150 configuration options including many emulation options. Common keys such as <Enter>, <Tab>, <Home> and <End> can be configured to emulate almost any editor. See the online help for the {CONFIG, Emulation} sub-menu for more information.

Using the Keyboard

Since VEDIT's keyboard layout is fully configurable, and because you may be running VEDIT from a non-IBM type terminal, edit functions are usually referred to by name, such as [MENU], instead of a particular key to press. The function name is often followed by the built-in, default key assignment, e.g. (default: <F10>).

To display the current (basic) keyboard layout, press the [HELP] key. The name of the help key is displayed on the status line (default: <F1>). Then press "K" to select "[K]ey-layout". For more help on any edit function, just press the corresponding key.

To display or print the entire keyboard layout, select the {CONFIG, Keyboard layout} menu and select "Display layout" or "Print layout".

To enter control characters into your file or into the search dialog box, precede it with [ENTER CTRL] (default: <Ctrl-P>).

See also:

The online help topic "KEYBOARD" explains how control and graphics characters are displayed and entered.

Dialog Boxes

VEDIT has both "full" and "terse" dialog boxes. Full dialog boxes often include more options and offer "point and shoot" selection. Terse dialog boxes are smaller and include only commonly used options.

By default, VEDIT uses full dialog boxes on high-speed QNX consoles and terse dialog boxes on slower serial connections. Erasing a terse dialog box's input field and pressing <Enter> switches to the full dialog box.

Press [HELP] (default: <F1>) for detailed online help on the dialog box currently displayed.

The precise operation of full and terse dialog boxes, including how the <Tab> key works is configurable. See the online help for the {CONFIG, Misc} sub-menu for more information.

See also:

The online help topic "DIALOG".

Special Features

VEDIT has many powerful and unique editing features. Most of them are described in the numerous online help topics. To help you get started, here are the names of some of the more useful online help topics.

COLUMNS
Describes how to perform columnar block operations.
DISPLAY
Describes VEDIT's various display modes for control and graphics characters, and how to directly edit EBCDIC files.
EBCDIC
Describes how to translate a file between ASCII, EBCDIC and ANSI. Also how to create custom translation tables.
FILETYPE
Describes how to edit DOS, UNIX/QNX and Mac type text files and convert from one type to another. Also how to edit binary and fixed-length-record (database) files.
HEX
Describes how to edit in hexadecimal and octal.
SEARCH
A very detailed description of VEDIT's extensive search and replace capabilities. VEDIT supports both regular expressions and its own easy-to-use pattern matching language.
WORDPROC
Describes how to use the word processing features including margins, word wrap, paragraph formatting and justification.

Unique Characteristics

VEDIT is very intuitive to use, but like all programs, has a few unique characteristics which may initially confuse a new user.

Configuration:

Most configuration changes can be made with selections in the various {CONFIG}, {PRINT, Config} and {SEARCH, Config} sub-menus. While navigating these menus, press [HELP] (default: <F1>) for online help on each configuration parameter.

These configuration changes will be temporary unless you make them permanent by selecting {CONFIG, Save to disk}.

The keyboard layout can be changed with the {CONFIG, Keyboard layout} sub-menu. Similarly, selecting {CONFIG, Keyboard layout, Save to disk} will make any changes to the keyboard layout permanent.

The casual user does not need to know how the startup configuration works. In brief, VEDIT's configuration is controlled by the startup file "veditrc" in the VEDIT Home Directory, typically /qnx4/vedit. veditrc contains a series of VEDIT macro language commands that configure VEDIT to the current hardware configuration. VEDIT then further configures itself by processing one or more configuration and keyboard layout files, e.g. "vedit.cfg" and "vedit.key". Finally, VEDIT configures itself for each user by processing the "veditrc", "vedit.cfg" and "vedit.key" files in the user's HOME directory.

Experienced users may prefer to configure VEDIT by editing these files directly, but be aware that modification of "vedit.cfg" and "vedit.key" may affect the operation of VEDIT for all users.

The online help topic "QNXCFG" describes VEDIT's configuration in complete technical detail.

Printed Documentation:

Users that prefer printed documentation can print any desired portions of the online help file or can purchase the VEDIT User's Manual from Greenview Data, Inc.

VEDIT's online help file "vhelp.hlp" can easily be edited. Most of the online help topics are organized as a "User Guide" that can be printed for future reference. (It is one major chapter of the VEDIT User's Manual).

To print all of the online help topics:

  1. Open the file "vhelp.hlp" for editing as a normal text file.
  2. Search for the text "\START\".
  3. Begin marking a block by selecting {BLOCK, Set marker} (default: <F9>).
  4. Go to the end of the file with {GOTO, End of file} (default: <Ctrl-PgDn>).
  5. Select {PRINT, Block} to print the highlighted block of text.
  6. Select {PRINT, Finish/Eject} to release the print job, or simply exit VEDIT.

An extensive 380 page printed VEDIT User's Manual is available from Greenview Data, Inc. at a modest cost. A more powerful version of VEDIT called VEDIT PLUS is also available for QNX, Microsoft Windows, DOS and SCO UNIX. VEDIT PLUS adds integrated compiler support, color syntax highlighting for popular languages, template editing for C, HTML editing support, additional data/binary file editing capabilities, and a powerful C-like macro language which is ideal for automating editing tasks such as translations and file conversions. For additional information please contact:

Greenview Data, Inc., PO Box 1586, Ann Arbor, MI 48106
Toll-free: 1-800-458-3348 (US and Canada)
Telephone: 1-313-996-1300
Fax:       1-313-996-1308
E-mail:    sales@vedit.com
Web:       http://www.vedit.com

Normal Keyboard Layout:

This is a listing of the "normal" or default keyboard layout built into VEDIT. It includes only the basic editing functions. Select {CONFIG, Keyboard layout, Display layout} to view the entire layout including all keystroke macros (hot-keys).

Key Function Key Combination
[BACKSPACE] <Backspace>
[BACKTAB] <Shft-Tab>
[BLOCK COPY] <Ctrl-F9>
[BLOCK MOVE] <Alt-F9>
[CANCEL] <Ctrl-C>
[CURSOR UP] </\>
[CURSOR DOWN] <\/>
[CURSOR RIGHT] <-->>
[CURSOR LEFT] <<-->
[DELETE] <Del>
[DEL PREV WORD] <Alt-F5>
[DEL NEXT WORD] <Alt-F6>
[ENTER CTRL] <Ctrl-P>
[ERASE BOL] <Ctrl-Bksp>
[ERASE EOL] <Ctrl-Z>
[ERASE LINE] <Ctrl-Y> or <Ctrl-X>
[ESCAPE] <Esc>
[HELP] <F1>
[INDENT] <F8>
[INSERT TOGGLE] <Ins>
[LINE BEGIN] <Home>
[LINE END] <End>
[MENU] <F10>
[NEXT LINE] <Ctrl-Enter>
[NEXT PARAGRAPH] <Ctrl-\/>
[NEXT TAB STOP] <Ctrl-Tab>
[NEXT WORD] <Ctrl--->> or <F6>
[PAGE UP] <PgUp>
[PAGE DOWN] <PgDn>
[PREV PARAGRAPH] <Ctrl-/\>
[PREV WORD] <Ctrl-<--> or <F5>
[REPEAT] <Ctrl-R>
[REPEAT LAST] <Alt-R>
[REPLACE] <Alt-F2>
[SCREEN BEGIN] <Ctrl-Home>
[SCREEN END] <Ctrl-End>
[SCROLL UP] <Alt-/\>
[SCROLL DOWN] <Alt-\/>
[SCROLL RIGHT] <Alt--->>
[SCROLL LEFT] <Alt-<-->
[SEARCH] <F2>
[SEARCH AGAIN] <F3>
[TAB CHARACTER] <Tab>
[T-REG COPY] <Ctrl-F11> or <Grey +>
[T-REG MOVE] <Alt-F11> or <Grey ->
[T-REG INSERT] <F11>
[UNDENT] <F7>
[VISUAL ESCAPE] <Alt-F10>
[VISUAL EXIT] <Ctrl-F10> or <Ctrl-O>

Examples:

Edit the file myprog.c:

    vedit myprog.c

Edit the files myprog.c and myprog.h (two open edit buffers which you may switch between):

    vedit myprog.c myprog.h

Files:

The VEDIT utility will create and/or modify the files named on the command line. In addition to these files, it will create or destroy a temporary file in the directory the file being edited is in, named

When the editor is exited, these temporary files will be removed. If the editor is terminated abnormally, the temporary file(s) may remain.

In addition to the files being edited and the temporary files, vedit reads several configuration files, first from the VEDIT home directory (usually /qnx4/vedit/), then from the $HOME directory of the user invoking vedit. The main files of significance are:

$VEDIT_PATH/veditrc
Contains default vedit macro language commands to customize the editor to the terminal type, to the file suffix being edited, etc.
$VEDIT_PATH/vedit.cfg
default configuration information for vedit
$VEDIT_PATH/vedit.kbd
default keyboard layout information, in either binary or ASCII text form
$HOME/veditrc
Contains vedit macro language commands to customize the editor to the terminal type, to the file suffix being edited, etc.
$HOME/vedit.cfg
configuration information for vedit
$HOME/vedit.kbd
keyboard layout information, in either binary or ASCII text form

See the built-in help inside VEDIT under the topic "QNXCFG" for a complete discussion of these configuration files.

Environment variables:

HOME
used as the directory to read configuration files from
TERM
defines the terminal type in use
VEDIT_PATH
defines the VEDIT home directory (default /qnx4/vedit)

Exit status:

VEDIT always exits with a status of zero.

See also:

elvis, qed


[Previous] [Contents] [Next]