CodeQuill version 1.0

From EDM2
Jump to: navigation, search

A Programmer's Editor Shootout

Written by Andy Pitonyak

Introduction

"CodeQuill is an enhanced vi style editor. It adds to that base: pull-down menus, multiple file editing, template based syntax expansion, a rotating command line buffer, a recall list, and some other basic formatting features. CodeQuill is designed to run efficiently from the keyboard."

Packaging and Installation

The packaging consists of a single zip (or tar) file cqu10.zip which I unzipped. I then ran os2inst.cmd and then everything was ready to go, or at least I wish it had been. CodeQuill should not use an OS/2 Java version before 1.1.4, and I have heard mixed reviews for version 1.1.6.

If you are using version 1.1.6 and experience any anomalous behavior, be certain to contact the author as he has already programmed in fixes for these in a current alpha version which should be available by the time you read this.

Convincing CodeQuill to run was a configuration hell thanks to the difficult Java installation process. I managed to make this work thanks to John Simmons and his infinite patience. The problems all started when I realized that I did not have the proper version of Java installed (after this, installation and running CodeQuill was trivial).

I decided to update Java to version 1.1.4. Java 1.1.4 is faster than the previous version and from what I hear it beats Windows NT. Note that they are now up to at least the developers kit version 1.1.6. To find the latest updates, you can go to the service center at http://service.boulder.ibm.com/asd-bin/doc/ or directly to the US English site at http://service.boulder.ibm.com/asd-bin/doc/en_us/catalog.htm.

Be forewarned that you require not only the Java developers kit, but also the feature install. After you have obtained the Java update and installed it, you are ready to run CodeQuill.

Now is perhaps a good time to mention that the Java installations may become easier thanks in part to John Simmons the author of CodeQuill, and also to Timothy F. Sipples. (A personal thanks from myself to both of these gentlemen) Mr. Simmons was attempting find a way to bypass the need to download the entire Java development download and install process and he was corresponding with Timothy F. Sipples, who said the following:

"... for those who simply want an "UNZIP and go" procedure, RUNTIME.EXE is available from ftp.hursley.ibm.com (in the "fixes" section). Granted, you'd have to provide a README (or some other procedure) to inform people how to use this, but it is the standalone runtime."

I managed to find the 5MB runtime at ftp://ftp.hursley.ibm.com/pub/java/fixes/os2/11/114/ but I did not explore this any further since I had already downloaded the significantly larger developers version. There is also a 1.1.6 runtime version at 8MB whereas the full package is 12MB. These large downloads may not be a problem for you, but I did not yet have my cable modem so I had to download them from another location at 28.8 and then bring them in on floppy. Now if only I could figure out how to make my RoadRunner cable modem work with OS/2.

My first attempt to run CodeQuill yielded the error message

"cannot find class java/lang/Thread"

This error is related to an installation problem on my end and had nothing to do with CodeQuill. Java classes are stored in either ".jar" files or ".zip" files. These files are referenced in the CLASSPATH variable and my classes.zip file was not included in my CLASSPATH. My current config.sys was changed to contain the line

[Note: this line below should be unbroken. Here it is broken for formatting purposes only. Ed.]

SET CLASSPATH=D:\NETSCAPE\njclass.zip;D:\JAVAOS2\LIB\JEMPCL10.ZIP;.\.
    ;D:\JAVA11\ICATJAVA\DAEMON\JAVAPROB.ZIP;D:\JAVA11\LIB\CLASSES.ZIP
    ;D:\JAVA11\LIB;

and this solved all of my problems. To summarize the installation issues:

  • Verify that you have Java version 1.1.4 or later
  • Do not forget the feature install if you need to update Java
  • Check your CLASSPATH statement in your config.sys if java classes are not being found.

A partial list of features follows:

  • vi keyboard personality
  • User definable syntax expansion
  • File recall list
  • Tab compression
  • Cut/Copy /Paste
  • Undo
  • Selectable font and attribute
  • Configurable tabs/spaces
  • Configurable EOL usage
  • Auto indentation
  • Regular expression command line support
  • Multi-platform, currently in use with OS/2, Solaris, SGI, HP-UX, AIX, Linux, and Windows NT/95

CodeQuill is not a fully compatible implementation of vi. It is, however, close enough that if you know vi, then you will be able to pretty much sit down and use CodeQuill. To quote from an included user guide.

"In CodeQuill the cursor has freer movement (than) it would than in vi. The cursor is not bound to the end of line. ... The greatest difference from vi operation is the absence of the command line escape functions. During testing of the Java environment, a number of issues arose when spawning system commands from Java applications. To avoid complications this functionality was removed."

This strikes me as a very minor compromise. Java limits the ability to reliably spawn system commands, and I can always run them from a command line if I desire. I also feel that the extra things that come with this implementation more than make up for it. This is not the only limitation which is imposed by Java. Although there is a menu, you can not use shortcuts such as Alt+F to access the menu. This is a limitation of Java.

I am not a vi expert and I learned the vi commands so that I could use and review CodeQuill. This was quite fortunate because my new job requires me to use vi. I became spoiled by learning the vi command set from within CodeQuill because it is much more forgiving and easier to use than my unix based vi editors. In CodeQuill, I can mark text and navigate with the mouse, for example.

After opening a few files for editing, I decided to exit CodeQuill without saving my work. CodeQuill showed me a list of files that had been modified but not saved and allowed me to save them, exit anyway, or cancel the exit. This is a nice touch. I generally use Brief which is not so informative, it simply informs me that at least one of my buffers has been changed and then asks what action I desire.

Based on the features mentioned so far, CodeQuill may seem unremarkable and simply stand as a stable and potentially more friendly vi. The ability to use the same code across multiple platforms with the extra ability to use the mouse is probably enough of a reason for vi fans everywhere to give this product a try, but there are other reasons as well. This is where I get to talk about the "cool stuff".

CodeQuill supports what it refers to as a syntax file. I might be more inclined to call this a macro expansion file, but creating such names is not something at which I excel. CodeQuill comes with an example file meant for C. The file defines a list of keywords and associated text expansions to accompany the keyword. For example, assume that the following text is included in the syntax file:

  .if
  if (@) {
  }
  .

Now if I type the word "if" on a line by itself and press enter, the text

if () {
}

will automatically be inserted into the file and the cursor will be positioned between the parenthesis where the "@" character was in the syntax file. This is done using appropriate indentations of course. (I really need to install CodeQuill at work)

The following keywords are defined with the product: if, ifelse, elseif, while, comment, switch, case, main, printf, and print. This not only has a lot of potential, but in practice I found this very useful. Of course, after I start thinking about such things, I can't help but wonder if it would be possible to extend this capability to include real macro expansion so that I could do more than define the following:

  .class
  class @{
  public:
  };
  .

To something similar to:

  .class(#1)
  class #1 {
  :public
       #1(@);
       ~#1();
  };
  .

I find the current capability exciting and admit that I am starting to ask for very esoteric things. The fact that I can trivially expand the syntax capabilities is a wonderful thing. At the moment, you must manually load a syntax file for each file after you load it, otherwise it is not available. The author is currently working on allowing associations between file extensions and a syntax file. I hope that you can override this based on extended attributes, but this would probably be hardly ever used. A more realistic request, allow me to load multiple syntax files extending the syntax

The font and attribute are not meant to create a pretty document for printing. You can not select a single word and use a larger font just for this. You can change the font used for the entire document to make it easier to read, for example.

Gripes

When I start an editor, I like to open multiple files at once using a command line similar to "cq Thread*.?pp" and CodeQuill does not allow this. Normally I would have griped about this already, but the euphoria of finally having Java 1.1.4 properly configured and the intrigue of learning the vi command set changed my priorities a bit. I also admit that I really like CodeQuill and I was very enthralled with the syntax expansion.

While typing straight text, I found that I really would have liked the ability to turn on automatic text wrapping (I know, then it would no longer be vi, right?). I also would have liked a menu command or some method of quickly selecting an open edit buffer. The F3 and F4 to move forward and backwards through the buffers certainly suffices, but I was surprised not to have a list of open buffers available from the menu.

It sure would be nice if CodeQuill could remember what files I had opened in my last session and simply reopen them if I do not specify a file to open. This is a feature that I really like in some other editors that I use.

Wrap Up

I was pleased with how well CodeQuill functioned and after some use, I found that I was starting to see some of the strengths of the vi interface. If you desire a multiplatform vi editor with many advantages over vi, then give CodeQuill a try.

Information

CodeQuill is a shareware product which sells for $29

E-mail: simmons@goodnet.com
http://www.goodnet.com/~simmons/sonoransoft/

To Order, you can also contact BMT Micro at: http://www.bmtmicro.com