jVi in JBuilder

Introduction

I've always wanted to use JB's integrated editor so i could take advantage of code insight, fixing compiler errors quickly and access to other IDE features. Now i can work on text within JB and keep my hands on the keyboard. If you haven't tried it, compiling or the find-in-path command, along with Shft-Ctrl-N and Shft-Ctrl-P are real handy.

The version of jVi used by JBuilder is displayed on the "Vi..." editor option property page. Please include both the jVi version number and the JBuilder version number when reporting problems.

The class that defines the IDE keybindings is included in the jar file and can be modified by the user. Any keystrokes defined in this keymap are removed from the keymap used by VI, so take care not to define any keystrokes that you want vi to see. Function keys and double modifiers are safe.

Feedback welcome, particulary about:

Log your issues, problems and/or requests at
jVi Bug Tracking. Communications can also be sent to jVi.

Text Search

Text search commands, for example "/" and "?", depend on third party libraries for regular expression matching. Either OROMatcher version 1.1 or com.stevesoft.pat version 1.4 or gnu.regexp version 1.0.8 can be used. It is your responsibility to get the package of your choice. If you obtain a license for the shareware com.stevesoft.pat then you can set the JVM property "com.stevesoft.pat.Key" to your license key. Make sure the regular expression package is in the application's classpath.

If you do not get a regular expression package, as described under Quick Start, then the JBuilder version of jVi defaults to using JB's internal search engine.

There are options for controlling metacharacter escaping. These are set through the "Vi..." property tab. Also, the regular expression package in use is displayed here. Check Searching and Patterns for information on searching and a description of the options.

Since there is not yet a ':set [no]ic' command, this is controlled by the setting of the JBuilder flag for case sensitive searching. Use something like 'C-S-F' to bring up JB's find dialog and then set the flag.

Colon Commands

:mak[e] [%]
With no argument, this command does a JBuilder make. When the '%' argument is present only the active node is made.
:bui[ld] [%]
This command is similar to the :make command, but it invokes JB's rebuild.
:run
run the project using the default run configuration.
:deb[ug]
debug the project using the default run configuration.
:tog[gle] <view-pane>
This command is used to show/hide stuff in the browser window. The visible state of the specified <view-pane> is toggled. This might better be done with the ":set" command but there are technical difficulties. So, for now at least, there is the toggle command. This will probably also be available from the set command in some future release. The <view-pane> can be any one of:
  • cur[tain]
  • mes[sages]
  • con[tent]
  • pro[ject]
  • str[ucture]
  • sta[tusbar]
  • tab[s]
Note: the "tabs" view-pane is only available if the
Cosmetics open tool is loaded. It hides/shows the filename tabs of the editor.

Key Bindings

The IDE keybindings are derived from the CUA keybindings. Some keybindings may not be what you expect. The following table has some keybindings that are either changed from the standard vi keybindings or are changed from the CUA keybindings.

Ctrl-J JB's Code Templates. (cursor down in standard vi)
Ctrl-Shft-F moved: Bring up JB's find dialog. (was Ctrl-F)
Ctrl-Shft-R moved: Bring up JB's replace dialog. (was Ctrl-R)
Ctrl-G Removed: JB's goto line dialog.

Options

There are several familiar vi boolean properties on the Editor's property page tab, and there is a Vi property page tab. jVi's IDE keymap is derived from the CUA IDE keymap. There are a few changes as noted in the section on Keybindings.

JB options are used where applicable

Auto indent is handle by JB, so the following options are important hack read-only file option

Customization

You can add ":" commands as well as keybindings. Here is an example for adding ":" commands. Refer to ColonCommands API for more info.



    import com.borland.primetime.ide.Browser;
    import com.raelity.tools.vi.ColonCommands;

    class MyStuff {

      public static void initOpenTool(byte majorVersion, byte minorVersion) {
        ViManager.addStartupListener(
          new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                initStuff();
            }});
      }

      private void initStuff() {
        ColonCommands.register("com", "command", Browser.ACTION_NavigateBack);
      }
    }


Copyright © 1998-2000 Raelity Engineering
Contact Raelity Engineering