Contents
TVI HELP CONTENTS

Introduction

How to use TVI

Keyboard Commands

Printing

Customizing TVI

Special Features

Common Problems

About TVI


Introduction
TVI(1)

USER COMMANDS

NAME

TVI - Windows based editor similar to the Unix editor, VI.

DESCRIPTION

TVI is a text file editor sharing many of the commands of the editor VI while adding features supported by the Windows3.1 graphical environment. Some of the new features added by this program are: user selection of color and font, mouse and dialog box support, printing, a menu bar, and on-line help.

NOTES

The editor runs in two different modes: INSERT and COMMAND. In insert mode, the keyboard works as expected... you type and the text apprears on screen. However, in command mode the keystrokes are interpreted as editing commands, NOT as text.

To go into COMMAND mode from insert mode, type <escape>.

To go into INSERT mode from command mode, type i.

The current mode is indicated in the box at the bottom right of the window.

For a detailed listing of keyboard commands, see Keyboard Commands.

To handle text larger than 32K bytes, this program swaps 'chunks' of memory in and out of the local buffer. In these situations a message is presented at the lower left edge of the window indicating which chunk is currently displayed. You can switch chunks with keyboard or menu commands.

FEATURES

VI commands not listed in the keyboard help topic are not supported at this time. In particular the ":g/xxxxx/xxx" syntax for global search and replace has been superceded by a dialog box. Most of the commands for cursor movement, deletion, copying, pasting, and [named] buffers have been retained.

In addition, the mouse can be used for cutting and pasting:  Hilite then click the right mouse button to 'copy'. Move the cursor to the destination then hold down the shift key while clicking the right mouse button for 'paste'.


examples
TVI(1)

HOW TO USE TVI

TO START TVI

Make an icon for TVI in the Program Manager or start TVI from the File Manager. The command line is...

          <path>\tvi.exe -i <ini path\file> -h <help path\file>

All arguments are optional. If you don't specify an initialization file, the default is to create one called tvi.ini in the windows system directory. The help file is supplied with tvi and is called tvi_h.hlp The argument '-m' can also be specified when running on a monochrome display. It changes some grey 3-d objects to black and white. A filename can also be specified on the command line. It is used to specify an initial file to load into TVI.

SAMPLE RUN

Here's a sample run through the editor...

     Double click on the TVI icon that you created above, to start the editor.

     Type 'i' to go into insert mode.

     Enter some text.

     Type <esc> to go into command mode.

     Type ZZ (capitals) or :q to quit

     (note, you could also use the menu bar to perform these actions)

MOUSE TO CUT/PASTE

Hilite text, click the right mouse button to copy it to the clipboard. Click left mouse at destination to advance the text cursor (or use cursor movement keys). Then hold shift key and click right mouse button to paste in the text.

KEYBOARD COPY TEXT

method 1: using line counts

move to starting line, type <n>yy where <n> is the number of lines to copy (ie 6yy for 6lines). To copy a single line: yy

method 2: using markers

Move cursor to starting line, type m<x> where x is a letter from a-z (this represents the mark label). Move cursor to ending line, type y'<x> where x is the label above. This copies the enclosed lines to the clipboard. (ie ma then y'a)

Think of m as 'mark', y as 'yank' and '(apostrophe) as 'to', so y'a means 'yank to a'.

Instead of copying to the clipboard, you can copy to one of 26 internal buffers. Preceed the y command with "<x> where x is a letter from a-z (not necessarily the same letter as the mark label, ie "qy'a instead of y'a). To copy a single line: "qyy

Think of "(quote) as 'buffer', so "qy'a means 'buffer q yank to a'.

KEYBOARD PASTE TEXT

Move cursor to desired line, type 'P' to paste above the line, or 'p' to paste below. If you used the " to copy into a buffer, you must use the quote when pasting, (ie "bp)

KEYBOARD DELETE TEXT

Same as copy but use 'd' instead of 'y'. As with copy you'll save the deleted text into the clipboard unless you preceed the command with "<x> (ie "qdd or "qd'a)

OPENING, CLOSING, AND QUITTING

open file 	- :e<filename> brings up file open dialog

new file 	- Alt-f then 'n' or File/New off the menu bar clears the TVI window

save file 	- :w<filename> brings up file save dialog

quit 	- :wq or ZZ to save changes and quit, and :q to just quit.

CHANGE FONT/COLOR

Options/Fonts and Options/Colors on the menu bar or shift-f for font dialog.

Note that the color dialog requires the following format:

'bbggrr/bbggrr' to represent the foreground/background colors where the values are entered in HEXADECIMAL. Each character can be 0-9 or a-f where a is 10,  b is 11, ... f is 15  ie ffffff/000000 would give white foreground and black background. ff0000/0000ff would give blue foreground and red background.

SEARCH AND REPLACE TEXT

search foreward 	-  / <search text>

search backward 	-  ? <search text>

search/replace  	-  :g (brings up dialog box)

PRINTING

There are two dialog boxes where you make customization settings:

The 'Settings' dialog box (Options/Settings off the menu bar). And the print dialog box (File/Print off the menu bar). Make desired settings in these dialogs and then press OK in the File/Print dialog.

You can print in two formats 1.) regular (portrait) and 2.) compressed (landscape with two columns and small font).

The fonts used for printing are fixed and independent of the screen. If you use a proportional font on screen, spacings and indentation may be printed differently.

UNDO AND REPEAT

undo 	- in COMMAND mode hit 'u' to undo the last edit operation

repeat last command  	-  in COMMAND mode type . (period)

CHUNKS

Under menu Actions pulldown there are selections to traverse 'chunks'. This editor loads text in ~15K portions and swaps the unused text into global memory. So if you notice that your document seems to be broken up into pieces, remember to move among them with these menu items.

Also if you're at the end of a chunk ^f or pg-down will move you foreward to the next one. Similarly, at the top of a chunk ^b or pg-up will move you back to the previous one. The status box at the bottom of the window provides information regarding how many chunks there are and which is currently being displayed. If it's blank, there's only one (local) chunk.

MULTIPLE PROGRAM INSTANCES

Multiple TVI instances can be run at one time, to allow for editing of more than one file, cutting and pasting between documents, etc.


Keyboard Commands
TVI(1)

KEYBOARD COMMANDS

STANDARD COMMANDS

Below is a listing of supported keyboard shortcuts when in COMMAND mode.

Some support a preceeding number to indicate how often to perform the command, (ie 6j means move down 6 lines). These are indicated with a preceeding (n). Usually they default to '1' if no number is provided.

Some require a second keystroke indicating what type of action to take, (ie dw means delete word, dd means delete line). These are indicated with trailing letters (ie w,d).

Some require a second keystroke indicating which 'label' to use. Labels can be any alphanumeric key. (ie ma means mark this position with the label 'a', and "a  means use buffer 'a'). These are indicated with a trailing (x). Also, ^X means hit the Control key while pressing X.

a	- go into APPEND mode (this is really INSERT mode but starts inserting text after the cursor)

^b	- go back 1 screen

c(w,c)	- replace (word, line)

C	- same as cc

^c	- choose color dialog box

(n)d(w,d)	- delete (word, line)

d<space>	- delete character right of cursor

D	- same as dd

^e	- scroll up 1 line

^f	- go foreward 1 screen

F	- choose font dialog box

^g	- file information dialog box (ie how big the file is etc.)

(n)G	- goto line (n)

(n)h	- cursor left n characters

i	- go into INSERT mode

(n)j	- cursor down n lines

J	- join this line and the one below it

(n)k	- cursor up n lines

(n)l	- cursor right n characters

m(x)	- mark this line with the label (x)

n	- search for the next occurrence of the string

N	- search for the previous occurrence of the string

o	- open a new line below the cursor

O	- open a new line above the cursor

p	- paste below the current line (ie "xp pastes buffer x, p pastes the clipboard)

P	- paste above the current line

r	- replace 1 character with the next character typed

R	- replace succeeding characters with the next characters typed until hit <esc>

u	- undo last action

(n)w	- cursor right (n) words

x	- delete character left of cursor

(n)y(w, y)	- copy to buffer (n) (words, lines)  (can preceed with "<x> for buffer)

ZZ	- quit and save file (prompt for filename as necessary)

%	- move to matching brace or parenthesis  (currently only within a chunk)

$	- cursor to end of line

0	- (zero) move cursor to start of line

/	- search foreward

?	- search back

.	- (period) repeat last action

'(x)	- (apostrophe) move cursor to marked line (x)

"(x)	- (quote) refer to buffer (x)  (ie "ayy copies current line to buffer 'a')

<esc>	- go into COMMAND mode

COLON COMMANDS

:e	- file open dialog

:w	- file save dialog

:q	- quit

:wq	- write current file then quit

:g	- search/replace dialog box

:s	- settings dialog box

:(n)	- goto line (n)

WINDOWS COMMANDS

Since TVI is based on the Windows 'Edit' control, some keyboard shortcuts have been inherited. (B) means it works in both Insert and Command modes, (I) means it only works in Insert mode.

^Ins	- copy to clipboard (B)

^c	- copy to clipboard (B)

Sh-Del	- delete to clipboard (I)

^x	- delete to clipboard (B)

Sh-Ins	- paste from clipboard (B)

^v	- paste from clipboard (B)

^z	- undo last operation (B)

Alt-Backspace	- undo last operation (B)

Sh-Arrow	- move cursor and hilite (B)

Sh-PgUp/Dn	- move a page and hilite (B)

Sh-Home/End	- move to start/end line and hilite (B)

^Arrow	- move word by word (B)

^Sh-Arrow	- move word by word and hilite (B)

^Sh-Home/End	- move to start/end of chunk and hilite (B)

NOTES

TVI supports standard menu accelerators,  (ie Alt-f activates the File menu, and then x activates the Exit sub-item).

When in INSERT mode you can type ^l (control - L) to insert a page break for the printer.

Numerous VI commands not mentioned above aren't yet supported. This includes 's' (substitute), '>' (block indent), the display of line numbers, use of regular expressions, the shell out command, EX editor commands, and the d/a type commands (delete to search).


Printing
TVI(1)

PRINTING

SETTINGS

There are two places where you make selections that affect how text is printed.

In the Options/Settings dialog box you choose whether to have:

header - consists of document name and the date and time

footer - page numbers

margin - slight indentation at the sides

compressed text - use smaller font and print in landscape mode with 2 columns

In the File/Print dialog you choose standard Windows print options including whether to print all or a specific set of pages.

TO PRINT

After setting the desired options make sure the printer is on and connected to the computer, then press OK in the print dialog. While pages are being sent, a dialog should be displayed. If you wish to stop the job, click on the Cancel button. If Print Manager is installed you can also pause/cancel your job from within that program.

FONT

The fonts used for printing are fixed and independent of the screen. If you use a proportional font on screen, spacings and indentation may be printed differently.


prompts
TVI(1)

CUSTOMIZING TVI

SETTINGS DIALOG

Choose the Options/Settings menu item (or :s in COMMAND mode) to bring up the Settings Dialog box. It contains choices for:

autoindent  --  new lines automatically indent

tab size  --  how many spaces for a tab

expanding tabs on save  --  convert tabs to spaces

user prompts  --  use confirmation dialogs before exit etc.

saving settings on exit  --  save current tvi configuration

default working directory  --  sets current working directory

various printer settings  --  header, margin, small text etc.

SAVING BETWEEN SESSIONS

If the save-settings option in the settings dialog box is set, then when the program is terminated the window size, position, font, and color, and included print options are all saved for the next program run. They are stored in the .ini file specified on the command line (or in tvi.ini in the Windows system directory by default).

FONT AND COLOR

You can choose the screen font and colors through the dialog boxes under the Options menu bar item. You can preview how the font will look by clicking the Apply button in the font dialog. Choose OK to keep the font setting and close the dialog box. (Note that selecting a screen font has no effect on the printer.)

The color dialog requires hexadecimal entries to specify foreground and background colors. A hexadecimal digit is either 0-9 or a-f (where a-f represents the numbers 10-15). It uses the form: bbggrr/bbrrgg. So both the foreground and background have two digits each for red, blue, and green.  (see the 'How to Use TVI' help topic for more detail. One popular configuration is 'ffff00/000000' which specifies cyan text on an ebony background).

COMMAND LINE

TVI accepts command line arguments:

-i <ini filename/path>

-h <help filename/path>

-m

<text filename>

(ie.    tvi.exe -i c:\mydir\tvi.ini -h c:\mydir\tvi_h.hlp)

The -m argument can be specified when running on a monochrome display. It changes some grey 3-d objects to black and white.

The -i option is useful in a multi-user environment so that different users can have their own customization settings.

The text filename is used to specify an initial file to load into TVI.

PROGRAM MANAGER

You can supply the command line arguments in the Properties dialog in Program Manager. You can also specify a working directory to be used by default when TVI is activated.


Special Features
TVI(1)

SPECIAL FEATURES

GRAPHICAL USER INTERFACE

TVI incorporates a menu bar, on line help, a mouse, user selection of screen font and color, and printer access. A 'Lower' item has been added to the system menu that hides the editor and brings the window behind it to the foreground.

MEMORY CHUNKS

To handle larger documents (up to system swap capabilities), text is stored in memory chunks that are transferred to and from local memory. Switching chunks is currently not automatic, you must choose the menu item (ie Actions/Next Chunk) or hit ^b or ^f when at the top or bottom of a chunk, respectively. You can also use the pg-up and pg-down keys.

FILE HISTORY

The last 4 opened files are remembered and listed under the File menu item. This information is stored between TVI sessions whether or not the 'save settings' option is set.

FILE CONVERSION

During file load, TVI attempts to determine if the file is a pure DOS format text file. If not, it prompts the user for whether to attempt a file conversion. This only converts the carriage return / line feed pairs ( as with a Unix text file ). It is not a way to convert from other word processor files.

FILE MANAGER INTERACTION

If you associate a file type with TVI in the Windows File Manager, then when you double click on a file of that type, it should automatically start TVI and open that file.

If you Drag and Drop a file icon from File Manager onto TVI, then TVI will begin editing that file. It will prompt for whether to save the old file before opening the new one. Note that if you attempt to drag multiple files onto TVI at one time it will only accept the first file. The others will be ignored.

OTHER DIFFERENCES

Hitting 'j' when the Caps Lock key is engaged does not issue a 'J' (line join command) when in COMMAND MODE.

An additional option has been added... whether to expand tabs to spaces on file save.

The menu item "Options/Clear Buffers" deletes the contents of all named buffers. For example, if you type "ayy you have stored the current line in buffer 'a'. This would be cleared by the Clear Buffers menu item.

Some standard Windows text editing shortcut keys are available, since TVI is based on the edit control from the Windows API. See the Keyboard Commands topic for details.

Many standard VI commands have not been implemented, however the current set should cover most common editing tasks.


Common Problems
TVI(1)

COMMON PROBLEMS

WRONG MODE

If you try to type but text doesn't appear correctly, make sure you're in INSERT mode (check the indicator at the bottom of the window). If you're not, type 'i' to go into INSERT mode.

CAPS LOCK ON

If the COMMAND mode keyboard shortcuts aren't working, make sure the caps-lock isn't engaged. You might also try hitting the Control key a few times.

CHUNK BOUNDARY

If you try moving the cursor up or down but nothing happens and you know you're not at the beginning or end of your document, or if you're typing and suddenly no more text is added, you may have hit a memory chunk boundary...

Choose the menu item: Actions/Next (or Previous) Chunk to progress (regress) one memory chunk. Also, you can hit ^b or pg-up if you're at the top of a chunk to go back, and you can hit ^f or pg-down if you're at the bottom in order to go foreward one chunk.

In some cases you may need Actions/Split chunk to split the current chunk into smaller pieces. This is necessary if your local text buffer has reached full capacity (usually  around 15-20K bytes).

One way to re-distribute your text among chunks is to save and then re-load the text file.

INITIALIZATION FILE

A message will be displayed if no initialization file is found when TVI starts up. This is not serious, as default values will be used and TVI will write a file out when it exits.

A message will be displayed if TVI is unable to write out customization settings to its initialization file. This could be caused by an invalid command line argument specifying the initialization file and path. Other possibilities are that the the file is read only, or that the directory doesn't exist.

Check to see that the command line specifies a valid path and filename. If nothing was specified on the command line, TVI defaults to use a file "tvi.ini" in the windows system directory.

KEYBOARD DIAGNOSTICS

TVI simulates extra keystrokes in order to execute some of its commands. It is possible that the codes used may vary for different keyboards. If some keyboard commands behave strangely, try chosing the menu item Options/Diagnostics to reset the codes.

This pops up a window that asks the user to press a series of keys (7). Note, be sure the caps lock isn't engaged while performing these operations. If a key isn't recognized, it asks once more and then skips to the next key. When it's done, it asks whether to save the codes. If you click OK, it stores the key codes in the .ini file, otherwise it ignores them.

SAVE FILE OFTEN

As you enter text, remember to save your changes periodically. This is insurance to keep from losing data in the (unlikely) case of a system or application problem.

PRINTER FONT

The fonts used for printing are fixed and independent of the screen. If you use a proportional font on screen, spacings and indentation may be printed differently.

KNOWN BUGS

If the printer runs out of paper in the middle of a job, it doesn't resume the job correctly after the paper is restored. You should start another print job specifying the pages that have not yet been printed.

If you iconify the Search/Replace dialog box, the icon may appear as a blank square without the TVI graphic.


About TVI
TVI(1)

ABOUT TVI (Version 1.2)

This program is a shareware editor implementing a subset of commands from the VI editor. If you register your copy you will also receive a copy of the commented source code. Please send 10$ (20$ from outside the US) together with floppy disk preference, to:

Michael Edelstein

3276 Ashford St #D

San Diego, CA 92111

This software and documentation come 'As Is' with no limited or implied warranties. In no event shall the supplier or licensor be held responsible for damages arising out of the use of this product.

Comments, bug reports, and suggestions are welcome.