CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs

DOCWEB Logo PDF Available

NERSP Text Editors: Getting To Know joe

CNS Document ID: D0154
Last Updated: 2/18/02

Abstract

JOE is an acronym for Joe's Own Editor, a UNIX text editor that is installed on the NERSP computer at CNS. Unlike (for example) vi, joe has text-wrap, which would be familiar to those who are used to more modern text editors. It also has a help feature that displays editing key combinations while you work.


UF Computing & Networking Services

CNS Information Services

2124 NE Waldo Rd, Suite 2100
Gainesville Florida  32609-8922
(352) 392.2061


Table of Contents

NERSP Text Editors: Getting To Know joe
Starting joe from NERSP
Working in joe
Moving around in joe
Where Are You?
Searching in joe
Special Searches
Blocks of text and joe
Turning word wrap on and off
Formatting Paragraphs
Go away, for now
Exiting joe
Resources

NERSP Text Editors: Getting To Know joe

JOE is an acronym for Joe's Own Editor, a UNIX text editor that is installed on the NERSP computer at CNS. Unlike (for example) vi, joe has text-wrap, which would be familiar to those who are used to more modern text editors. It also has a help feature that displays editing key combinations while you work.

Starting joe from NERSP

To begin using joe on NERSP, type joe at the NERSP $ prompt. Or enter joe filename. That will create a new file named filename or edit an existing file if filename already exists.

Working in joe

After starting joe, you can just begin typing. Your words will wrap around until you hit <Enter>. Joe has a on-screen help feature that you can toggle on and off by pressing <Ctrl>KH . That will display the first help screen. To see additional help screens, press <Esc>. (Escape-period) to go forward in the help screens and <Esc>, (Escape-comma) to go backward. The help screens show you "hot keys" for all the basic text editing: moving the cursor, searching, go-to, define a block of text, reformatting text blocks, spellcheck, exit, and many more. Remember that the ^ (carat) symbol represents the <Ctrl> key.

Moving around in joe

You can move around in joe using the arrow keys. If those don't work (perhaps because of the terminal emulator you're using), then you can use:

<Ctrl>F to move the cursor Right (think "Forward")

<Ctrl>B to move the cursor Left (think "Backward")

<Ctrl>P to move the cursor Up (think "Previous line")

<Ctrl>N to move the cursor Down (think "Next line")

<Ctrl>Z moves to the previous word

<Ctrl>X moves to the next word

Where Are You?

When you want to know where your cursor is located in joe, you can press <Ctrl>K<space> to have joe tell you the line number, column number and byte number, and the ASCII value of the byte at the current cursor location. This will appear on the last line of the screen.

Searching in joe

You can use joe to search for a string of characters. The search begins from where your cursor is in the text. It does not perform a wrap text. It will ask if you want to search backwards when you get to the end of the file.

  1. Use <Ctrl>KF (find) text.

  2. The program will ask you what text you want to search for.

  3. After you hit <Return>, you are prompted with a series of options "(I)gnore (R)eplace (B)ackwards Bloc(K) NNN (<Ctrl>C to abort):".

  4. If you type an I and hit <Enter>; the cursor goes to the end of the first instance of the specified string, and the file is unchanged.

    Typing R <Enter> will lead you through a series of prompts.

    The first asks you to provide the replacement text.

    Type your replacement text and then <Enter>.

    It will highlight the first occurrence of the found string and ask if you want to "Replace (Y)es (N)o (R)est (B)ackup (<Ctrl>C to abort)?" If you say Y (yes) it will replace the first occurrence, and then search forward and highlight the next occurrence. If you say N (no) it leaves the found string unchanged and searches forward for the next occurrence. If you say R (rest) it will replace the rest of the matching strings in the file without further prompts.

  5. You can also search backwards by pressing B (for backup) when prompted.

  6. If you want to repeat a search, <Ctrl>L.

Special Searches

You can use joe's search capacity to do high-powered searches. You can tell it to find the third occurrence of a particular string of characters. You can also tell it to treat upper- and lower-case letters as the same when searching.

To find a specific occurrence of text, start search with <Ctrl>KF. Then when prompted with "(I)gnore (R)eplace (B)ackwards Bloc(K) NNN (<Ctrl>C to abort):" type a number and <Enter>. That will take you to that number occurrence of the text.

Blocks of text and joe

If you want to edit large chunks of text in joe, you use blocks. Blocks allow you to move, copy, save or delete sections of text.

Define a block with <Ctrl>KB. Then move to the end of the block of text you want to change and press <Ctrl>KK. The text block you want to work on will be highlighted.

To move the text block, move your cursor to where you want the text block to end up. Then press <Ctrl>KM to move the block from its original position to the new place.

If you want to make a copy of the block before moving it, use the <Ctrl>KC command and then move the cursor to where you want the text to go and use the <Ctrl>KM command to move the block.

Delete the highlighted block with <Ctrl>KY.

To save the highlighted block into its own file, use the <Ctrl>KW command. It will prompt you with "Name of file to write (<Ctrl>C to abort):". Type in a filename and it will save it for you. Cancel with <Ctrl>C.

Joe will also allow you to filter a block of text through a UNIX command. When you have a block of text highlighted, press <Ctrl>K/ . Joe will prompt you to provide a UNIX command. One example of this is the tr command. Type tr a-z A-Z at the prompt and all the letters highlighed will be converted to uppercase.

When you're done working with blocks, the highlighting stays on. To turn it off, hit <Ctrl>KB<Ctrl>KK.

Turning word wrap on and off

Word wrap is a device common to most modern word processors. Joe gives you the choice of having word wrap or not. You may not want word wrap on, for instance, if you are writing lines of code which would "break" if the words wrap. To toggle word wrap on and off, use the press <Ctrl>TW. Joe starts up with word wrap automatically on.

Formatting Paragraphs

After applying edits to your work, if you want to format paragraphs in joe use the reformat command, <Ctrl>KJ. Joe considers a "paragraph" to be a block of text separated above and below by a blank line.

You can change the margins that joe uses for formatting and wrapping with the <Ctrl>TL and <Ctrl>TR command. You can also center a line within the margins with the <Ctrl>KA command.

Go away, for now

Joe allows you to leave the program temporarily by suspending it. To suspend joe, use <Ctrl>KZ. It will give you this message: "You have suspended the program. Type 'fg' to return". From the command prompt, type fg (short for "foreground") and you will be returned to joe, with the cursor in the exact same place.

Exiting joe

There are three ways to quit out of joe. One is to quit and save with <Ctrl>KX. That saves the file upon closing joe. Another option is to save without closing. This is accomplished by <Ctrl>KD. If you want to exit without saving your file, press <Ctrl>C (think "cancel"). This will bring up a prompt of "Lose changes to this file (y,n, ^C)?" Pressing Y will exit without saving your edits.

Resources

For more information, type man joe at the NERSP $ prompt for the joe manuals.

Your Comments are Welcome

We welcome your comments and suggestions on this and all CNS documentation. Please send your comments to:


CNS Information Services

2124 NE Waldo Rd, Suite 2100
Gainesville Florida  32609-8922
(352) 392.2061

UF Computing & Networking Services
2124 NE Waldo Rd, Suite 2100
Gainesville, Florida 32609-8922

Phone: (352) 392.2061
E-mail: editor@cns.ufl.edu

CNS DOCWEB Home
CNS Home Page
CNS Publications Page
Search All CNS Docs