Previous Section  < Day Day Up >  Next Section

Recipe 6.5. Copying Between Two Files in JOE

6.5.1 Problem

All right, you're sold. You want to have your own ~/.joercprefs. But how do you create this file without having duplicate entries or entries that conflict with the original ~/.joerc?

6.5.2 Solution

Open two windows inside of JOE, one containing ~/.joerc and the second containing the new file, ~/.joercprefs. Copy your desired preferences from ~/.joerc into ~/.joercprefs.

First, make a backup copy of the original ~./joerc.

$ cp ~/.joerc ~/.joerc.bak

Open ~/.joerc, then open a second window and name the new file:

$ joe -linums -help ~/.joerc

^K O

^K E

Name of file to edit (^C to abort): ~/.joercprefs

Navigate between the two windows with ^K P and ^K N. Sometimes the windows play tricks on you; toggle ^K I to show all windows/hide inactive windows.

Mark a block of text to copy with ^K B and ^K K. Position the cursor at your insertion point, and copy with ^K C.

6.5.3 Discussion

Because ~/.joerc is so large, it can be helpful to display only the inactive options. In the ~/.joerc window, use JOE's filter command to grep the inactive options:

^K /

$ grep '^[[:space:]]'

Now you can easily see which commands are inactive and copy the ones you wish to activate into ~/.joercprefs.

You can also show only the active options:

$ grep '^[^[:space:]]'

Hit ^K X to save ~/.joercprefs and exit.

Now your changes are nicely separated for easy tracking and editing.

6.5.4 See Also

  • joe(1)

    Previous Section  < Day Day Up >  Next Section