Visit the new ACCC website! (beta)
ACCC Home Page Academic Computing and Communications Center  
Accounts / Passwords Email Labs / Classrooms Telecom Network Security Software Computing and Network Services Education / Teaching Getting Help
 

Using the (The Hessling Editor) at UIC

 

This document is a introduction to THE -- The Hessling Editor -- text editor for UNIX. It was written specifically for people who have used XEDIT. (Though it's worth it for vi and pico fans to take a look at THE, too. THE has some very useful features that are missing from the other UNIX text editors; see THE has something for vi fans too.)

If you already know XEDIT, there's enough information in this article to get you started. If you haven't used XEDIT or if you'd like more information on THE, see the ACCC THE Home Page.

 
     
 
     
Special Message for CMS Users/XEDIT Fans
 

Are you a veteran CMS user and an XEDIT fan? What should you do if you find yourself editing files on UNIX? In the long run, particularly if you're going to be using several different UNIX machines, you'll probably want to learn vi. (And you can do it.) But you don't have to tackle vi just yet if you're going to be using an ACCC UNIX machine; you might want to consider using THE instead.

THE (The Hessling Editor, written by Mark Hessling) is a text editor for UNIX that looks and acts very much like XEDIT. The ACCC supports THE on all of our UNIX workstations -- on tigger, icarus, and on argo.

Interested? Try THE out; if you already know XEDIT, there's enough information in this article to get you started, and there's a lot more at http://www.uic.edu/depts/accc/software/the/
 

Figure 1: To see just how much THE resembles XEDIT consider this figure. It looks like it's in XEDIT, doesn't it? Look again -- it's really THE, running in an SSH session on tigger. 
 
     
Entering and Leaving THE
 

Using THE on UNIX starts out just like using XEDIT on CMS; enter:

the filename

If the file filename exists in your current directory, THE will open it. If not, THE will create it. (And if you forget where you are and enter: filename instead, that will work too; x is an alias for the.) The filename can include a path; for example:

the ~/mydir/test.ext

edits or creates a file called test.ext in your mydir subdirectory.

If you leave filename out altogether, THE will display a list of the files in your current directory. To edit a listed file, use Tab or an arrow key to point to the line with the file's name and press Ctrl-x. (A bit like CMS's FILELIST, isn't it? But Pine's pilot is like FILELIST too, and gives you more options. See Wanted -- FILELIST for UNIX.)

When you're finished, save your changes with save or file or discard them using quit or qquit, like in XEDIT.

 
     
  The .therc Profile
 

Like XEDIT, THE has a profile file that you can use to tailor THE to your liking. But unlike XEDIT, each ACCC UNIX system has a default THE system profile that already has been customized for use on that machine. Copy this file to your home directory:

/usr/local/src/the/THE/.therc ~/.therc

Then make your changes; THE will use it by default.

 
     
The Bad News
  Don't worry, it's not too bad. THE is very sensitive to the details of how you connect and what your terminal type is. If you get into THE and find that your function keys don't work -- but also try Esc-n for Fn before you panic -- you might have to do a bit more work to get THE to work for you. The problem -- and its solution -- are described on the ACCC THE home page under "Keyboard Remapping."

Checking out your keyboard

To find out how THE will interpret a specific keystroke, enter: showkey on THE's command line, then type the keystroke(s). Pressing the Spacebar returns you to THE.
 
     
Important Differences between THE and XEDIT
 

Entering lines of text:

THE doesn't have either an Input Mode or a Power Input Mode. You can use F2 to add succeeding lines of text as a substitute for Input Mode or use a combination of margins and wordwrap for Power Input Mode. For example, enter (in this order) :

set margins 1 50
set wordwrap on

Then as you type, XEDIT will begin a new line when you type over the right margin (column 50 in this example), moving the word that you are typing when you go over the margin to the beginning of the new line.

Insert mode:

As in XEDIT, the Insert key toggles you in and out of THE's variation of Insert mode. If you don't have an Insert key (or if it doesn't work), try Esc-' (F0). Or you can define one:

define c-v set insertmode toggle

(No, that's not a typo, you type "c-hyphen-v".) This makes Ctrl-v toggle Insert mode. If no Insert toggle key is defined, character insert may not be possible.

Character delete:

The UNIX Ctrl-h backspace functions as a character delete in THE, deleting the character to the left of the cursor. The Delete key, if you have one, might act as it does in XEDIT to delete the character under the cursor, or you can define a keystroke that does:

define c-d sos delchar

This makes Ctrl-d function as Delete does in XEDIT.

Selective change:

THE's selective change command is also a bit different:

schange /oldstring/newstring/ * *

(Note the * * -- THE's schange requires a target.) Then, starting from the cursor's current location, THE moves the cursor to the first instance of oldstring and asks you to: press C to change this instance to newstring, press N to go to the next instance, or press Q to quit.

Working with columns:

THE supports text blocks. Doesn't sound too exciting? Suppose you're working on a table and decide that you want to switch a pair of columns. That's a chore to do in just about any editor, but it's easy in THE. First, mark the block: move your cursor to the upper left corner of the column and press Ctrl-b, then move the cursor to the lower right corner and press Ctrl-b again. Then move your cursor to the spot you want the upper left corner of the copy to be, and, with Insert mode on, press Ctrl-c. (When Insert mode is off, the copied block overwrites the existing text.) Then delete the original copy of the column (Ctrl-g deletes blocks) and you're done.
 
     
-- The little differences you need to know about
 
  • Commands that take a numeric operand require a space between the command name and the operand; for example: d 3
  • The screen automatically scrolls left and right when the cursor passes the screen edge.
  • The shortest abbreviation of quit is qu
  • /, \, and @ are the only valid string delimiters.
  • The arbchar matching multiple characters is not yet implemented. (Single-character arbitrary character matching is supported.)
  • Not all XEDIT cursor commands have been implemented; most can be emulated with the set zone command.
  • The equal sign = or question mark ? to repeat or redisplay the last command is supported, but only the one immediate previous command can be recalled.
  • The default line width of all files is 512 characters. Use the -w command line option it increase it; for example: the -w 2000 file.ext
  • Mixed case is the default for all files, and there is additional case significance in CHANGE and SORT.
  •  
         
    THE has something for vi fans too
      Sure you can do just about anything you'd ever want to do in vi (usually in two different ways!). But THE provides some exciting tools that longtime UNIX people and vi devotees might want to look into.

    There's the XEDIT/THE all command to display and work on only those the lines in a file that contain a given string. For example, enter: all /string/ and THE will display only the lines that include "string"; any global changes you make will act only on those lines. (You might find it easier in general to make global changes in THE than in vi.) Enter: all (without a target) to display the entire file again.

    The XEDIT/THE prefix area and prefix commands make it easy to move, copy, or delete groups of lines -- and it'll be clear exactly which lines you're working with.

    The XEDIT/THE editing "ring" allows you to work on two or more files at once, without having to commit the current changes in any of them to disk as you must in vi. THE isn't good when you want to "cut and paste" multiple lines from one window to another (vi's better for that), but XEDIT/THE's put and get commands are great when you want to copy groups of lines from one file to another.

    And THE's support for text blocks can come in handy also.
     
     

     


    2005-8-17  document@uic.edu
    UIC Home Page Search UIC Pages Contact UIC