| | | | | | | | |
|
| |
|
|
| | |
By Andrew Stone of Stone Design
March 1990 |
|
I love the Edit program, thank you Bryan Yamamoto! Features like "Zoom", which shrink the file to just the method names and static declarations is extremely useful. The notion of opening a directory to double click open files is very powerful. [Command-D brings up the open directory dialogue, replete with name expansion]. Other features you may want to take advantage of is the ability to add your own menu commands to the Edit main menu. The .userdict file which resides in your home directory holds commands that get added to your "User" menu at runtime. It has a basic table syntax like this: |
|
|
<Menu Item Name> TAB <COMMAND to be performed> RETURN
.userdict:
------------- clip here ----------------------
Current Time/Date date
Word Count Selection wc|
Spell Check Selection spell -d /LocalLibrary/hlist|
Add to Spelling List spelling /LocalLibrary/hlist > /tmp/hlist ; mv
/tmp/hlist /LocalLibrary/hlist
File List ls -l | sort +3 -nr|
Directory ls |
Calendar | cal 1988 |
Methods grep "^[+-]" |
Word Count wc |
Print enscript
Indent indent -st
Time | date
Comment awk -f /me/bin/comment.awk
DeComment awk -f /me/bin/decomment.awk
------------- clip here ----------------------
These two beauties [by Kris Jensen] handle the way we comment and uncomment
the code:
/me/bin/comment.awk:
------------- clip here ----------------------
{print "//|" $0}
------------- clip here ----------------------
/me/bin/decomment.awk:
------------- clip here ----------------------
BEGIN {FS = "|"}
{for (i = 2; i <= NF; i = i + 1) printf("%s", $i)
printf ("\n")}
------------- clip here ----------------------
|
|
And this is my .edictDict which is where you can create macros that type in huge blocks of code. You simply type the first unique characters in the dictionary key, and then hit <ESC> and Bingo, there is the block. For example, typing "w"<ESC> would insert the code to handle disabling flushWindow, and then matching that with the reenable, flush method. Here are a few handy ones: |
|
|
.edictDict
------------- clip here ----------------------
win [window disableFlushWindow];\
\
[[window reenableFlushWindow]flushWindow];\
return self;\
}
if if («cond») {\
«stmt» \
}
elseif if («cond») {\
«stmt» \
else { \
«stmt» \
}
-method - «methodname» «parameters» \
{ \
«stmt» \
} \
+method + «methodname» «parameters» \
{ \
«stmt» \
} \
for for («start»;«end»;«update») {\
«stmt» \
}
while while («cond») {\
«stmt» \
}
message [«target» : «method» «parameters»]
printf printf("«msg»\n");
header /*********************************************************************
*****\
*\
* Object Name:\
*\
*--------------------------------------------------------------------------\
* History:\
*\
* Date Initials Comment\
*--------------------------------------------------------------------------\
*\
* Description:\
*\
*--------------------------------------------------------------------------\
* Programmer:\
* Copyright (c) 1989,1990 Stone Design Corp. All rights
reserved. \
***************************************************************************/
copyright /*********************************************************************
****\
* Copyright (c) 1989,1990 Stone Design Corp. All rights
reserved. \
***************************************************************************/
------------- clip here ----------------------
|
These things just scratch the surface of Edit. There is the nest/unnest commands. There is the ability to double click on a paren or brace and the matching pair is selected. Many emacs- style commands are available to move the cursor without a mouse.Chapter 18-15 of the NeXT Reference Manual:Concepts goes into more detail of this fine program. Emacs commands are on page 18-18.
© 1990 |