V IDE - Release 0.8


The V Integrated Development Environment

VIDE is the V Integrated Development Environment for the GNU g++ compiler and the standard Sun Java Development Kit. The current release is Beta 0.8. VIDE has been a part of the V C++ GUI Framework, but is now avaiable as a separate package. Executables for MS-Windows 9x/NT and Linux (glibc) are available for download at http://www.objectcentral.com/vide.htm.

VIDE has been designed by a programmer for programmers. It makes the task of developing software for C/C++, Java, and HTML much easier than using command line mode. It is easy to learn, so it is a good tool for the beginner. It also has the critical features needed to enhance the productivity of the experienced programmer.

While VIDE doesn't have every feature found in many commercial development systems, it is an ongoing project, with more features included in each release. And best of all, VIDE is free! The source code is available under the GNU Public License (GPL), so you can help add even more features if you want.

The main features in the current release of VIDE include:

The executable version of VIDE is totally freeware. Use it, share it, do whatever you want. The source of VIDE falls under the GNU General Public License, and is normally included with the V GUI distribution. See the file COPYING included with the distribution for more information. Its development is not always in phase with the current V distribution, so there will be additional releases of executable versions as they become available. With the added support for Java, it is likely that the standalone executable version will see broader use than the source version included with V.

This program is provided on an "as is" basis, without warranty of any kind. The entire risk as to the quality and performance of the program is borne by you.

Features that are planned for the near future include:

This document describes how to use VIDE. Because the process is slightly different for C/C++ and Java, there is a brief tutorial section for each language. Following the tutorials, all the commands available from the menus are described.

VIDE Overview

The design of VIDE has been somewhat evolutionary, but you should find that it is not that much different than other IDEs you may have used. Because VIDE is a free, open source program, it probably lacks some of the polish of commercial IDEs. However, it is still quite functional, and it is really easier to develop programs with it than it is to use a command line interface.

Generally, any application you write will consist of various source files (with associated header files for C/C++), and required data files. These files are generally dependent on each other. By defining a VIDE Project for your application, all the file dependencies are automatically handled. The standard tool make is used for C/C++ files, while the JDK Java compiler automatically handles dependencies.

Using VIDE, the normal work cycle goes:

  1. Design your application.
    VIDE currently has no capabilities to help with this stage.
  2. Start VIDE, and create a Project File.
    This will include all source files, compiler options, and other information needed to compile your application.
  3. Build your project.
    This stage compiles your source into object code. Compilation errors are displayed in the status window, and you can simply right-click on the error to go to the offending line in your source code. After making corrections, you repeat this step until all compilation and linking errors are removed.
  4. Run your program.
    You can start your program from within VIDE.
  5. Debug your program.
    VIDE for MS-Windows has integrated support for the gdb debugger for C/C++. Because the DDD debugger available for Linux is so good, VIDE for Linux does not have integrated debugging support, but will automatically launch DDD.
    VIDE currently does not support the jdb debugger for Java, but it will "any day now."
  6. Write documentation for your application.
    VIDE has syntax highlighting for HTML to make that job easier. You can also automatically launch your web browser to view the resulting HTML pages. Really neat.

Using VIDE for C/C++ with GNU gcc/g++

General procedures

The only C/C++ compiler VIDE is currently designed to work with is the GNU g++, either on a Unix-like system, or on MS-Windows with the GNU GCC compiler. (VIDE will work with either the mingw32 version of GCC, or the Cygnus B20.1 version. Try the latest merged GCC 2.95!) Functionality of VIDE for g++ is based on standard GNU makefiles. VIDE uses a standard GNU make Makefile to build your project. Thus, you must have a Makefile defined. This Makefile can be one created automatically by VIDE itself from your Project file, one generated by the vgen V application generator, or even one you've written yourself. If you have your own Makefile, then you probably won't need to use a VIDE Project.

VIDE assumes you have your gcc/g++ compiler already installed on your system and the PATH correctly set. For Unix/Linux systems, this is a given. If you are using a MS-Windows version (Mingw32 or Cygnus), then you must follow the instructions provided with their distributions. You might find it helpful to copy the VIDE executable to the /bin directory that has your g++ compiler. VIDE requires GNU make (it is not compatible with some other versions of make), the GNU C/C++ compiler (preferably the latest GCC 2.95) and associated utilities, and the GNU gdb debugger. You also may want the V utilities vgen and viconed.

Once you start VIDE, you will see a blank window labelled "No Makefile, Project, or .java file Specified." This opening window is the message window, and is used to output the results of your make. A typical first step after starting VIDE is to open a VIDE Project or select an existing Makefile.

Once you've opened a project or specified a Makefile, you can build your project with the Build:Make C++ menu command, or click on the Make button on the tool bar. This runs the make utility with the default target (often "all"). VIDE first runs the Makefile in dry run mode. It uses that output to then run the commands generated. It intercepts the error messages for g++ and put them in the message window. You can then right-click the error line, and VIDE will open up the file in question, and put the cursor on the offending line. This all assumes that the source and makefile are in the same directory. VIDE also assumes all your files have unique names (i.e., you don't have files in your project with the same name but in different directories). After you correct the problem, rerun make.

You can also make a specific target in your makefile by using the Make menu: Make:Make <target>. If you include a "clean" target in your Makefile, Make:Make Clean will run make clean. (The Makefile generated by VIDE from a Project has a "clean" target.)

The tools menu allows you to run your program. If you are using a VIDE Project, then Tools:Run project will run the project you just built. If you are using your own Makefile, then Tools:Run project will prompt you for the file to run.

VIDE C/C++ Projects

When you are first creating a new project (or moving an existing program to VIDE), click on the Project:New C++ Project menu. You will get a dialog box with various tabbed items. Set the names you want in the Names tab. Then add source files using the Files tab. You can set defines as needed in the other tabs. Once you have added the files needed, VIDE will create a Makefile suitable to compile your project with g++.

HINT: When you open a new project file, VIDE assumes some options and switch settings that are commonly appropriate to use with the compiler. It is likely that the defaults will not be the one you want. There is an easy solution. Simply create a new project, change the settings to be just what you want, and then save that project as a "template" using an appropriate name. Next time, open that template project file, and immediately use Project:Save Project As... to save it under the working name of the new project.

Names

This pane lets you set the target name for the executable. You can also change the name of the generated Makefile. Usually, you will use g++ as the compiler. The Compiler Flags line lets you pass switches to the compiler, such as -O for optimize, or whatever. The linker flags are passed to the linker, and default to what you need to compile V programs with g++. The HOMEV value is required for V programs, and specifies where the V GUI libraries and include files are found.

You may have to change some of the default switches for your specific compiler or operating system. You should only have to do this once for a project. If you will be creating other projects, you can save a template project in a file of your choice, and then use it as a starting point for new projects.

On MS-Windows, to build console apps, remove the -mwindows loader switch. Delete the -lV -lcomclt32 switch.

Files

This lets you add the names of the source files included in the project. Click ADD, and files are added without any path name. If you need to add a relative (or absolute) path, select the file, and click Edit to hand edit the entry. Click Del to delete the selected entry. Until V adds multi-line selection (someday soon), you have to add files one at a time.

Paths

This lets you specify the directory for the source files, the directory where you want object files to be generated, and the directory where the binary should be written to. You can also list paths for include and library directories. These are passed to g++ as the appropriate switches.

Defines

There is a pool of definitions that you can have used during make time by adding them to the Active Definitions list using the ">" button between the lists. The pool will stay constant, while the Active side can be a bit more dynamic as you work with your project. Note that you have to supply the full g++ definition switch: -DFOO or -UNOTFOO.

Options

Anything you add to this list will be written to the generated Makefile after the standard definitions. You could use it to define your own symbols, or whatever. If you know about Makefiles, you can edit the V project file directly to add targets that aren't generated automatically. The .vpj file is a plain text file, and the various sections are labeled more or less clearly. Using these two mechanisms, you can build complicated makefiles which will be automatically generated as you edit the project file.

For example, if you want to add a Windows resource file to your project, you could add a line something like:


//% Section 3 - OPTIONS # Add in .o for resource 
EXOBJS += $(oDir)/viderc.o //%end-options 

either with the Project editor, or directly into the .vpj file. Then, with the standard editor, edit the .vpj file and add:

//% Section 16 - USER TARGETS # Define a target for the resource
file $(oDir)/viderc.o:      vide.rc vide.ico vwindow.ico
        windres vide.rc $(oDir)/viderc.o
//%end-user-targets 

OK, I know that seems inconsistent - you should be able to add in both with the Project editor, or have to edit the .vpj file directly for both. I'll fix that in the future. I also intend to add better integrated support for resource files directly. Same for libs and dlls. Next version...

Using VIDE for Java with Sun's JDK

General procedures

VIDE has been designed to work with Sun's JDK. The default values assume the conventions of JDK 1.2 (Java 2), but it should be easy to change the default values to whatever is required by earlier JDKs. It is also possible that VIDE might work with IBM's Java tools, but that hasn't been tested. VIDE assumes you have correctly installed JDK according to Sun's instructions, and have appropriately set whatever environment variables you need.

VIDE interfaces with the command line versions of the tools provided with JDK. VIDE lets the JDK compiler javac handle all the file dependencies. In VIDE, you work with the name of the main class, e.g., MyNeatJavaProgram, which would be found in the file MyNeatJavaProgram.java. Because of the capabilities of JDK, a VIDE Java Project file is somewhat less complex than a C/C++ Project file.

Once you start VIDE, the first action normally is to open a VIDE Java Project or select a Java source file. The opening window is the message window, and is used to output the results of your compiles. If you have a small Java application (not an applet), you can simply specify the name of the top level Java class file, and don't need to use a VIDE Java Project. However, for if you have an applet or need to specify compiler options, you will need to create a new Java Project file.

Once you've opened a project or specified a Java source file, you can compile your project with the Build:Compile Java menu command, or click on the Make/Compile button on the tool bar. This runs the Java compiler, javac. The results of the compile are shown in the message window. If you get an error, you can usually right click on the error line and the source file will be loaded into an edit window, and the cursor placed on the offending line. with an existing program), click on the Project->New C++ Project menu. You will get a dialog box with various tabbed items. Set the names you want in the Names tab. Then add source files using the Files tab. You can set defines as needed in the other tabs. Once you have added the files needed, VIDE will create a Makefile suitable to compile your project with g++.

VIDE Java Projects

When you are first creating a new project (or moving an existing program to VIDE), click on the Project->New Java Project menu. You will get a dialog box with various tabbed items. You will only need to use the Main and Files tabs for most projects. Once you've specified the required information, you can compile your project as described earlier.

HINT: When you open a new project file, VIDE assumes some options and switch settings that are commonly appropriate to use with the compiler. It is likely that the defaults will not be the one you want. There is an easy solution. Simply create a new project, change the settings to be just what you want, and then save that project as a "template" using an appropriate name. Next time, open that template project file, and immediately use Project:Save Project As... to save it under the working name of the new project.

Main

This pane lets you specify the name of your application or applet. This should be the Java Class name of the top class. You don't need to add .java or other extension. If you are creating an applet, then you need to specify the name of the file with the HTML code that runs your applet. When you run an applet, VIDE uses JDK's appletviewer.

If you have JDK 1.2, you usually won't need to use the CLASSPATH setting. However, earlier JDKs and some circumstances may require the CLASSPATH to be specified. This is passed to the compiler and interpreter via switches.

Files

This lets you specify which files are included in your project, as well as the source directory. In fact, VIDE really doesn't use this information in this version. (It simply uses the app name specified in the Main tab.) However, the information will be used in later versions.

Compiler

This pane lets you specify which Java compiler to use. It is almost always javac, but you can change it for other development environments. The Compiler Switch Pool has the standard switches supported by JDK 1.2. Click the > button to use a switch. You can add your own switches to the Pool if you need to (for other JDKs, for example).

Interpreter

This pane lets you specify the interpreter. It is usually java for Java apps. Using javaw will run your application without showing a console window. If you have an applet, you must specify the HTML source in the Main pane, which will cause appletviewer to be used.

Debugger

VIDE currently does not support the jdb debugger. However, when it does, this pane will let you specify options.

VIDE Help System

VIDE now includes a Help menu. Most of the help is supplied in a separate distribution file, and is in HTML format. V Help uses your default Web Browser to show the help files.

I have attempted to collect the most useful documentation I could find for the various GNU C++ tools. If you download and install the Help files, you should have a very complete and useful set of documents for C, C++, and Java programming at your finger tips. See Installing VIDE for more instructions on how to install VIDE help.

If there are other HTML based documents you would like added to the VIDE distribution, please let me know.

VIDE Command Summary

This section provides a summary of the all the VIDE commands available from the menus.

File Menu

The File menu is used for source files. Use the Project menu to open and edit project files.

File:New

Create a new source file. Syntax highlighting doesn't take effect until you've done a File:Save as and repainted the screen.

File:Open...

Open an existing file.

File:View...

Open an existing file for viewing. The file is read-only, and you won't be able to make any changes.

File:Save

Save the current file to disk.

File:Save as...

Save the current file using a new name you will specify.

File:Close

This will close the existing file. If you've made any changes, you will be prompted if you want to save them.

File:Save All

Saves all currently open files.

File:Save/Close

Save the current file, then close it.

File:Send to Browser

Save the current file, then open it with default browser. This command has a quick and dirty implementation, and it passes just the default file name to the system routine that opens the browser. Thus, this command can fail if the file doesn't have a full path qualification. This can happen when you type a file name in directly to the file open dialog. On MS-Windows, you must have .htm and .html files associated properly with your browser. This command won't do anything for not HTML files. This usually happened automatically.

File:Exit

Exit from VIDE.

Edit Menu

The edit menu has some basic commands to edit text in the current file.

Edit:Undo

Restores the last text deleted. Only one level. Doesn't undo insertions or position changes. Also, doesn't undo deletions greater than 8K characters.

Edit:Cut

Delete the highlighted text, and copy it to the clipboard. Standard GUI operation - use mouse to highlight region of text, then cut

Edit:Copy

Copy highlighted text to clipboard.

Edit:Paste

Paste the text on the clipboard to the current text position.

Edit:Find...

Find a text pattern in the file. Brings up a dialog.

Edit:Find Next

Find the next occurrence of the current pattern in the file.

Edit:Replace...

Find a pattern in the file, and replace it with a new one. Brings up a dialog.

Edit:Find Matching Paren

If the cursor is over a paren character, i.e., ()[]{}, the cursor will be moved to the matching opposite paren.

Edit:Edit Help

Displays a list of the command supported by the current editor command set.

Project Menu

Project:Open

Open an existing project file. Project files all have a .vpj extension. VIDE automatically detects C/C++ or Java projects.

Project:New C++ Project

This will create a new C/C++ project. The options on the dialog are described in the C/C++ section above.

Project:New Java Project

This will create a new Java project. The options on the dialog are described in the Java section above.

Project:Edit

Edit the currently open project.

Project:Close

Save and close the currently open project.

Project:Save as...

Save the current project under a new name. This is useful for creating "template" projects that have specific settings for your development environment. These templates can be opened later, then saved under a new name again for the real project.

Project:Rebuild Makefile

OK, I admit it. VIDE doesn't handle all cases of changes to your files. If you add a new #include to a source file, for example, VIDE won't automatically rebuild the Makefile to add this new dependency. This command helps get around that problem.

Project:Select Makefile or Java file

Use this to specify a standard Makefile or a Java source file instead of a VIDE project. In this case, the Makefile will be run, or the Java source passed to the Java compiler.

Build Menu

Used to build and compile projects.

Build:Make C++/Compile Java

Build the project. This command first saves all your open files. It then runs make for C/C++ projects, or the Java compiler for Java projects. Errors are displayed in the message window, and you can go directly to the error by right-clicking on the error line in the message window.

Build:Make Clean

Runs make clean to clean old object files, etc. Used only for C/C++ projects.

Build:Make <Target>

Runs make to make the target you specify. Used only for C/C++ projects.

Build:Make Debug

Will build a debug version. Not currently implemented.

Build:Stop Make

For C/C++ makes, will stop the make after the current file is finished being compiled.

Debug Menu

In general, the commands on the debug menu (and the equivalents on the tool bar) work very similarly for the gdb and jdb debuggers. Please see the Debugging with VIDE section later in this document.

Debug:Start Debugger

Opens a new command window to interface to the debugger. Will use the current executable file.

Debug:Set Breakpoint

Set a breakpoint at the current line in the editor window. To use this (and other commands that use the "current line"), first get focus to the editor window of the source file you want to work with. Then go to the line you want to work with, either with the mouse or cursor movement commands. Finally, select this menu command or the equivalent command on the tool bar.

Debug:Delete Breakpoint

Delete the breakpoint set at the current line. This command isn't as easy to use as it could be because the editor doesn't highlight lines with breakpoints. The current version doesn't keep its own list of breakpoints, but relies on the debugger. Thus, you have to know in advance which line you want to debug. It is sometimes easier to just use the debugger command line interface for this. I hope this one gets better in the future.

Debug:Show Breakpoints

Show all set breakpoints. Uses native debugger commands for this.

Debug:Delete All Breakpoints

Delete all set breakpoints.

Debug:Run program

Run the program being debugged from the start. You will usually want to set some breakpoints first.

Debug:Step over statement

Step over the current statement. If the statement is a function call, the program will break after the function has returned.

Debug:Step into statement

Step into the current statement. This will break at the first statement of a called function. For non-function calls, this will have the same effect as the step over command.

Debug:Continue to line

Continue running the program until the current line in the editor window is reached.

Debug:Continue program

Continue running program until the next breakpoint is reached.

Debug:Kill program

Stop execution of the running program.

Debug:Show call stack

Display the call stack.

Debug:Inspect variable

Display the value of the variable highlighted in the editor window. The variable must be available in the current context of the running program. To use this command, use the mouse to highlight the variable name you want to inspect. Then click this command or the tool bar button.

Debug:Debugger help

Show debugger help. Uses debugger native help.

Tools Menu

Tools:Run program w/ args

Runs a specified program. Allows you to specify arguments to the program.

Tools:Run project

Runs the program from the existing project. Note: VIDE does not check to recompile before running an object.

Tools:Run OS Shell

Runs a basic OS shell.

Tools:V App Gen

Runs the V tool V App Gen.

Tools:V Icon Editor

Runs the V Icon Editor.

Options Menu

The Options menu allows you to customize various aspects of VIDE, including paths, editor attributes, and font. These settings are saved in a standard system place. For example, they are saved in C:/windows/vide.ini on MS-Windows. They will be in $(HOME)/.Viderc on Linux or other Unix-like systems.

Options:VIDE

This item allows you to set the paths VIDE uses to find the VIDE help sytem files as well as the standard help file included with the Sun JDK.

This item also allows you to specify which command shell and debugger are used. These two options are most useful on Linux/Unix systems.

Options:Editor

The options include:

Options:Font

Lets you specify the font used in the display window. The font will change in the current window, and in future windows, but not in already open windows. The font you chose will be saved in the preferences file.

Help Menu

Help:VIDE

Opens your browser with this file.

Help:Editor Command Set

Shows a dialog box with a command summary of the editor command set currently being used.

Help:GNU, Other Tools

Opens your browser with the VIDE Help System page. This contains links to various GNU software, g++, libraries, and HTML. This is the page distributed as the VIDE Help Package.

Help:WIN32 API

This will try to open the Borland WIN32 API .hlp file. The hlp format file should be available at Windows API Reference from Borland.

Help:V GUI

Opens the V GUI Reference Manual.

Help:Java

Opens the Sun JDK Help pages. You must set the Java help path in the Options:Editor menu, and download the help files from Sun.

Help:HTML

Opens a guide to HTML tags.

Help:HTML - CSS

Opens a guide to HTML Cascading Style Sheets.

Window Menu

Standard MS-Windows Window menu.

The VIDE Editor

The VIDE editor is based on the V TextEditor class. It has syntax highlighting for C, C++, Java, and HTML files.

The current version of VIDE supports several command sets. The default is a generic modeless command set typical of most GUI editors. The second command set is based on the See editor which is the editor I've been using for 20 years. It is not well known - yet. There is also a very good emulation for Vi that will keep your fingers happy if you use Vi. An Emacs emulation is likely in the future.

One attribute of the VIDE editor is how it handles lines wider than the window. It does not use a horizontal scroll bar. Instead, as you move right on long lines, the text will automatically shift to show more of the line.

The Generic Editor

The generic command set of the VIDE editor is very similar to those found in many GUI based text editors. It is modeless. Commands are either special keys (e.g., arrow keys), or control keys (indicated by a ^ or Ctrl). Several commands use a meta modifier, Ctrl-A (^A) as a prefix. You can enter counts (noted by an "n") for commands by first pressing the Esc key, then a count, then the command. Not all commands are supported by command keys, and require you to use the menus (replace, for example). Unfortunately, not all the features supported by the See and Vi editors are found in the generic editor. This may change.

The Generic Command Set

Key Command Description
Esc Prefix to enter count n
   
  Movement Commands
   
Arrow keys Standard function
nLeft Move left [^L]
nCtl-Left Move left a word
nUp Move up [^U]
nShft-Up Move up to beg of line
nRight Move right [^R]
nCtl-Right Move right a word
nDown Move down [^D]
nShft-Down Move down to beg of line
Home Goto beg of line [^A,]
Ctrl-Home Goto beg of file
End Goto end of line [^A.]
Ctrl-End Goto end of file
nPgUp Move a screenful up
nCtrl-PgUp Scroll a screenful up
nPgDn Move a screenful down
nCtrl-PgDn Scroll a screenful down
   
  Searching commands
   
^A[ Balance match
^F Find pattern
Shift-^F Find next
   
  Insertion Commands
   
n^AIns Insert char with value of n
n^O Open a new blank line
Ins Toggle insert/overtype
   
  Editing commands
   
^ABkspace Delete to line begin [^A']
^ADel Delete to line end [^A\]
nShft-^C Fold case
^C Copy highlight to clipboard
^V Paste from clipboard
^X Cut highlight to clipboard
nBkspace Delete previous char
nDel Delete next char
nShft-Del Delete line
   
  Misc. commands
   
^AM Center Cursor in screen
^Av Repaint screen
n^G Goto line n
n^K Kill line
n^P Pretty print code.

The pretty print command will format C/C++, and Java code according to the V style conventions. To use this command, start on a code line that is indented how you want it. After that, 'n' lines will be formatted based on the starting indentation. This command is very useful if you use the V indent style. Some aspects of formatting will be settable in future versions to support slight modifications to the V style.

The See Editor

The command set of the See editor dates back to the late 1970's. The editor was originally called TVX, and the command set was modeled after the TECO editor. See, like Vi, has command mode and insert mode, and is normally in command mode. The commands are mnemonic. U for up, L for left, F for find, etc. It is very good for touch typists, and minimizes the need to move your fingers from the home row of the keyboard. If you don't have a favorite editor yet, or if you don't have a command mode editor you like, consider giving the See command set a try. It is really an efficient way to edit.

To use the See command set, start VIDE and select 'See' in the Options->Editor dialog. VIDE will remember your selection.

See is normally in Command mode. You can supply a count value to many commands by entering a value before the command. For example, entering 35d will move down 35 lines. When you enter insert mode, values you type are inserted until you press the Esc key. The f find command lets you enter a find pattern that is echoed on the status line, and can include tabs. Press Esc to begin the search. The F version of find displays a dialog to enter the pattern.

In most cases, you can use a standard dedicated key (such as the arrow keys) as well as the equivalent mnemonic See command. You can highlight text with the mouse, and cut and paste in the usual fashion.

The See Command Set

Key Command Description
   
  Movement Commands
   
nl Move left [Left Arrow]
nr Move right [Right Arrow]
nu Move up to beginning of line [Shft-Up]
nd Move down to beginning of line
n^U Move up [Up Arrow]
n^D Move down [Down Arrow]
n[ Move left a word
nTab Move right a word [Ctrl-Right]
n^P Move a screenful up [PgUp]
np Move a screenful down [PgDn]
, Goto beginning of line [Home]
. Goto end of line [End]
b Goto beginning of file [Ctrl-Home]
e Goto end of file [Ctrl-End]
j Jump back to previous location. This is an easy way to get back to where you were before a find command, or a large movement.
n^L Goto line n
m Center Cursor in screen.
nn note (mark) location n. Locations go from 1 to 25. This is a bookmark feature.
n^N Goto noted location n
nCtrl-PgUp Scroll a screenful up
nCtrl-PgDn Scroll a screenful down
   
  Searching commands
   
n] Balance match. Find the matching
  paren, bracket, or brace.
f Find pattern (non-dialog). The pattern is echoed on the status line and is terminated with an Esc.
F Find pattern (dialog)
; Find next
^F Find/replace (dialog)
   
  Insertion Commands
   
ni Insert char with value of n. This lets you enter Escapes or other non-printing characters.
i Enter insert mode
Esc Exit from Insert Mode
^O Toggle insert/overtype [Ins]
no Open a new blank line
   
  Kill/change commands
   
^C Copy highlight to clipboard
^V Paste from clipboard
^X Cut highlight to clipboard
' Delete to line beginning
\" Delete to line end
n^K Kill line
n~ Toggle case
/ Kill 'last thing'. The 'last thing' is determined by the previous command. Commands that set the last thing include find, move a word, save, append, and get. Thus, a common way to perform a replace is to find a pattern, then use '=' to insert the replacement.
= Change 'last thing'. Delete last thing and enter insert mode.
nt Tidy (prettyprint) n lines. This will format C/C++, and Java code according to the V style conventions. To use this command, start on a code line that is indented how you want it. After that, 'n' lines will be formatted based on the starting indentation. This command is very useful if you use the V indent style. Some aspects of formatting will be settable in future versions to support slight modifications to the V style.
nBackspace Delete previous character
nDel Delete next character
   
  Save buffer commands
   
ns Save n lines in save buffer. See provides a buffer that allows you to save lines. Using the save buffer is often easier than cut and paste. After saving lines, you can use the '/' delete last thing command to delete the lines you just saved. The See save buffer is independent of the clipboard, and is local for each file being edited.
na Append n lines to save buffer
g Get contents of save buffer. Inserts the contents of the save buffer at the current location.
y Yank file to save buffer. This is an easy way to import text from an external file.
^y Write save buffer to file. This lets you save part of your file in a new external file. Using 'y' and '^y' is often an easy to copy parts of one file to another, or include standard text into new files.
   
  Macros
   
\<a-z> Set register to use (a-z)
q Record keystrokes in Q-Register until ^Q
n@ Execute current Q-Register N times
   
  Misc. commands
   
v Repaint screen
? Help
^Q Save and close

Macros

The See and Vi emulations support a simple, yet powerful macro facility. (This feature will be added to the generic editor soon.) There are 26 buffers called "Q-Registers". You can record character keystrokes into any of the Q-registers, and then execute those characters as a set of commands. A set of commands like this is often called a macro. (Note: you cannot record special keys such as the arrow keys, etc.) You can enter any See or Vi command into the editor, including find patterns and insertion strings.

Even though VIDE has a search and replace function on the menu, you can do the same thing with a Q-register macro. Consider the following set of See commands:
fthe$=THE$
The '$' represents the Esc key. You would enter this macro by selecting a Q-Register (e.g., \a to select Q-Register 'a'), entering a 'q' command, then entering the command sequence, and ending the recording the sequence with a Control-Q (^Q). The characters you enter will be echoed on the status bar (which will indicate you are recording). Then execute the macro (22 times, for example):
\a22@
The next 22 occurrences of 'the' will be changed to 'THE'. The corresponding command in Vi would be: /the<CR>xiTHE$ where '<CR>' is a Return, and '$' is 'Escape'. Then execute it with 22@a. Note that in this emulation of Vi, 'x' will delete the pattern just found.

If you want to execute the macro for the whole file, give a very large count. The macro will exit after any command, such as a find, fails.

This is a See example for placing a '** ' at the beginning of every line that contains the word 'special'.

\aqfspecial$,i** $d^Q and execute \a1000@

The same function in Vi:

qa/special<CR>0i** $j0^Q and execute 1000@a

Future additions

Things missing from the editor that WILL be included in future versions:

The Vi Editor Emulation

VIDE now includes an emulation of the Vi command set. The emulation is not yet complete, and it is likely it will never be a complete emulation of Vi. However, it is a pretty good "finger memory" emulation. For the most part, the right things will happen when you edit using your automatic "finger memory" of Vi commands. This emulation should improve over time. See the limitations section for a description of the current limitations and differences of this emulation.

To use the Vi emulation set, start VIDE and select 'Vi' in the Options->Editor dialog. VIDE will remember your selection.

The Vi Command Set

  (* after cmd means emulation not exact)
Key Command Description
   
  *** Movement Commands ***
   
h,<Left> cursor N chars to the left
j,<Down> cursor N lines downward
k,<Up> cursor N lines up
l,<Right>,<Space> cursor N chars to the right
m<a-z> set mark <a-z> at cursor position
CTRL-D scroll Down N lines (default: half a screen)
CTRL-U scroll N lines Upwards (default: half a screen)
CTRL-B,<PageUp> scroll N screens Backwards
CTRL-F,<PageDown> scroll N screens Forward
<CR> cursor to the first CHAR N lines lower
0 cursor to the first char of the line
$ cursor to the end of Nth next line
<Home> line beginning
<CTRL-Home> file beginning
<End> line end
<CTRL-End> file end
B* cursor N WORDS backward ['word' not same]
"b cursor N words backward
`<a-z> cursor to the first CHAR on the line with mark <a-z>
`` cursor to the position before latest jump
'<a-z> cursor to the first CHAR on the line with mark <a-z>
'' cursor to first CHAR of line where cursor was before latest jump
<MouseClick> move cursor to the mouse click position
   
  *** Searching commands ***
   
/{pattern}<CR> search forward for {pattern}
/<CR> search forward for {pattern} of last search
?{pattern}<CR> search backward for {pattern}
?<CR> search backward for {pattern} of last search
N repeat the latest '/' or '?' in opposite direction
n repeat the latest '/' or '?'
% go to matching paren (){}[]
   
  *** Insertion Commands ***
   
A append text after the end of the line
a append text after the cursor
i,<Insert> insert text before the cursor (until Esc)
O begin a new line above cursor and insert text
o begin a new line below the cursor and insert text
R* toggle replace mode: overtype existing characters [just toggle]
CTRL-C Copy to clipboard
CTRL-V Paste from clipboard
CTRL-X Cut to clipboard
   
  *** Kill/change commands ***
   
C change from cursor position to end of line, and N-1 more
cc delete N lines and start insert
c[bBhjklwW$0] delete Nmotion and start insert
D delete chars under cursor until end of line and N-1 more
dd delete N lines
d[bBhjklwW$0] delete Nmotion
J* Join 2 lines [2 lines only]
S delete N lines and start insert;
s (substitute) delete N characters and start insert
u undo changes
X, <BS>* delete N characters before the cursor
x, <Del> delete N characters under and after cursor
~ switch case of N characters under cursor
   
  *** Yank buffer commands ***
   
P put the text on line before cursor
p put the text on line after the cursor
Y* yank N lines; synonym for 'yy' [cursor at end]
y< read file into yank buffer
y> write yank buffer to file
   
  *** Misc. commands ***
   
CTRL-L redraw screen
ZZ save file and close window
gm center cursor in screen
gt format N lines of C/C++/Java code
"<a-z> set q-reg/buff for next op
["<a-z>]q record to q-register until ^Q
["<a-z>]@ execute q-register N times

Emulation Limitations

As much as possible, this emulation tries to do the same thing Vi would do with the same command. Probably one of the main things missing in this emulation is the total lack of Ex support, i.e., there are no ":" commands supported. In fact, this should be a minor limitation as there are usually menu commands that support the most important ":" equivalents. You can also record macros that can duplicate many of the functions typically done with ":" commands.

Another major difference is the lack of support for a count for insert and find operations. Thus, "5ifoo$" will not insert 5 instances of "foo". This is true for some other commands as well. Generally, if you enter a command expecting some kind of repeated operation, and the VIDE Vi emulation does not support repeat, then the operation will be done only once. Again, you can use macros to get around this limitation.

The following list summarizes some of the other differences in how this emulation works.

The following list summarizes most of the Vi features that have not yet been implemented. They are likely to be added in future releases.

Debugging with VIDE

VIDE supports GNU gdb and will support the Sun jdb debuggers when the all the Java are finished. The VIDE interface to the debuggers is of minimalist design. The goal is to make using the native debuggers as easier as possible for casual users, while maintaining the full power of the debugger for experienced users. VIDE accomplishes this by showing a command window interface to the debugger. You can enter any native debugger command in this window, and thus have full access to all debugger features.

VIDE makes using the debugger easier by providing menu and tool bar commands for the most often used commands. And most importantly, VIDE will open the source file in an editor window and highlight the current execution line on breakpoints or steps. It is very easy to trace program execution by setting breakpoints, and clicking on the Step over or Step into tool bar buttons. VIDE also allows you to inspect variable values by highlighting the variable in the source and clicking the inspect button.

Debugging C/C++ with gdb

To debug C/C++ programs with gdb, you must first compile the program with debugging information. This is accomplished with the -g switch on the compile line. The current version of VIDE does not provide automatic generation of debug or release makefiles. The easiest way to define VIDE projects for both debug and release versions is to use the Project:Save Project as... command. First, define a release version of the project. Then, using that project as a template, change the switches as needed for your debug version, and save the project under a different name.

The full power of gdb is available in the debugger command window. You may enter any standard gdb command after the "(gdb)" prompt. In fact, there really is limited interaction between VIDE and gdb. VIDE starts gdb using the "-f" switch, which causes gdb to send a special output sequence after each break, which VIDE then uses to open and display the highlighted break line. Other than that, there is really no interaction between the two. The main disadvantage to this is the somewhat limited ability of VIDE to disable breakpoints.

Limitations with gdb

Debugging Java with jdb

The VIDE/jdb interface has not yet been implemented.

Limitations with jdb

The VIDE/jdb interface has not yet been implemented.

Known VIDE problems

If you run VIDE on NT from a desktop icon, there is a problem running the egcs mingw32 compiler. You need to run VIDE from a Command console window. I'm working on this. This is not a problem on Win9x, nor is it a problem with the Cygnus B20 compiler.

There seems to be bug in gdb with DLLs. If you load too many, gdb dies. This is mostly a problem on Windows9x when debugging V GUI applications, but it may also be a problem on NT if you load too many DLLs. I'm trying to work with the maintainers to fix this problem.

Errors generated by the compiler are passed via two temporary files. Sometimes these files are not deleted, and are left behind on the hard disk. If two instances of VIDE are running, it is possible to have an access conflict to these files from one of the instances. This can prevent builds with error messages from displaying those messages in the message window.

If g++ has a fatal error, it can hang VIDE. Because all files are saved right before running g++, there is no data loss.

The syntax highlighting doesn't work right for multi-line "/* comment */" style comments. If the lines between the opening "/*" and the closing "*/" have a "*" as the first character (which is the normal convention for Java programs!), syntax highlighting works correctly. Otherwise, those lines will not get the comment highlight. This is purely a cosmetic problem, but is unlikely to be fixed because of difficulties imposed by the internal structure used by the editor.

The tidy/prettyprint command doesn't handle the last case of a switch properly. This won't be fixed. Also note that the formatting is based on the indent of the previous line, so you must start at a known good indent point.

Installing VIDE

It is probably easiest to use a pre-compiled version of VIDE. The VIDE executable binary is a complete static program. It does not use any external files or DLLs. You can place the binary where ever you want. However, you might want to install VIDE to its own directory tree. This is most likely to be compatible with later versions of VIDE. For now, the tree just includes /vide/bin and /vide/help. You can run VIDE from the desktop without setting a PATH, but if you use V and want to start the Appgen and Icon editor from within VIDE, then those programs must be on your PATH. If you are using mostly GNU gcc/g++, then you may want to install the VIDE executables on the same /bin directory the compiler is on. If you are using Java, then you can create a /vide directory for the VIDE system. You may want to add a desktop shortcut if you use it a lot. There is no install or uninstall provided or needed.

If you want to use the help files, you will need to download the separate help file archive. It is best to install the help files in the /vide/help directory. After you've installed the help files, you will need to use the VIDE Options:Editor command to set the path to the help files.

VIDE doe not provide Java help. You will need to find and download the Sun JDK yourself. Then use the VIDE Options->Editor menu command to set the Java directory.

If you are building VIDE from the V distribution, then apply the above comments to the version you build. If you want to use the V appgen program, or the V Icon Editor, you need to get those from the V distribution.

Help make VIDE better!

The V IDE is GPL freeware. It has been written using the V C++ GUI framework. I get no compensation for either V or VIDE, so please don't get too fussy about features or problems. I welcome bug reports and requests for new features, but I make no promises.

My goal for VIDE is to make it a great alternative to Emacs. I know Emacs will do almost anything you would ever want, but the learning curve is huge. VIDE is much more GUI oriented, and I want to keep it simple enough for beginning programmers to use.

So, even more welcome than bug reports would be offers to help add features to VIDE! Since the source code for both V and VIDE are GPL and LGPL, they are available for enhancement. If you would like to make contributions to VIDE, please contact me directly by e-mail. VIDE is currently ahead of the V GUI release cycle, so I will need to provide you with the latest versions of all the source code.

I welcome any contributions or ideas, but right now the following projects:

If you'd like to help on any of these projects, please contact me and I will do everything I can to help you get started.

No Warranty

This program is provided on an "as is" basis, without warranty of any kind. The entire risk as to the quality and performance of the program is borne by you.


V IDE Reference Manual - Version 0.4 - 4/23/99
Copyright © 1999, Bruce E. Wampler
All rights reserved.

Bruce E. Wampler, Ph.D.
bruce@objectcentral.com
www.objectcentral.com