|
Wily IdiomsThis is a collection of useful scripts, guide files and ways of working with Wily.Guide filesCollect useful script names, file names, regular expressions into a simple text file, which can act as a tool box/menu. e.g. my $h/lib/html/guide|title |h1 |h2 |h3 |href http:// |mailto gary@cs.su.oz.au |i |b |tt |tag blockquote |indentand my $h/guide remote rm guide |par |indent |undent :., :, W sam sg wdef 9term Mace/in src/jcrab news; overp comp.risks $wilysrc $wilybinI edit my $h/guide to have the names of files and directories I'm frequently working with. Start-up ScriptStart Wily from a shell script which sets up the environment, and initial files#!/plan9/bin/rc EDITOR=W # makes wily the editor for mail, etc. path=(. $path) # add '.' to the path exec wily $h/guide # use an initial 'guide file' Short-cut Environment VariablesSet environment variables to make window labels shorter and easier to type, e.g.h = $HOME wilysrc = $h/src/wily/wily wilybin = $h/obj/$cputype/wily/wily "buttons"These are commands designed to operate on the window in which they are clicked.
wily tagUse the wily tag (the tag above the columns) to store very frequently used commands and addresses. This is particularly useful because the wily tag is never obscured.I normally copy the top line of my $h/guide file to the wilytag as soon as I start Wily. B3 to change "last selection"B3 in the label of a window to make its body the last selection without having to sweep the selection out again.Plan to double-clickPut quotes or brackets around long commands you might want to re-select later. It's just a bit easier than sweeping the command out again.double-click to check syntaxDouble-click just inside a bracket or brace to find where the other half of the matching pair is, e.g. to check if you've got enough closing brackets.double-click to select SGML elementsDouble-clicking will select between >< pairs, so given this text: "<H1>the heading</H1>", double-clicking just before "the" will select "the heading".address expressions in the wily tagB3-ing in a tag with no body (i.e. the wily tag or a column tag) searches for the address in the last selected window. This lets you put common address searches (e.g. :, (select the whole window)) in the wily tag and apply them to a window by selecting the window, then B3-ing in the address.use history file(s)Set $history and use it as a memory for obscure commands you perform infrequently, and as a short-cut for for commands you've performed recently.I set $history based on the date. This gives me one file with recent commands, and a directory full of files with older commands. I use two history-printing commands, one called 'h' which searches through the current history file, the other called 'hg' searches through all my history files, using glimpse. h #!/plan9/bin/rc if ( % $#* 0 ) { tail $history } else { agrep $1 $history | tail } hg #!/plan9/bin/rc glimpse -H $h/lib/history -h -y -L 15 $* remote interface to netscapeI call this script 'remote'#!/plan9/bin/rc for(i) { netscape -noraise -remote 'openURL('^$i^',new-window)' } To use it, select one or more URLs, and B2B1 on 'remote'. Netscape will then open a window on each of the URLs. Look
BackupsEdit and execute the "backup warning" messages. A typical one might be backup 48 /n/staff/u13/pgrad/gary/guide Replace the word backup with 'diff' and execute the line to find out what changes were discarded. Replace the word 'backup' with 'cp' to easily recover the modified version of the file. Poor man's hypertextYou can put the name of a related file in a comment, to let you more easily jump between files. E.g. I have the documentation for msg.h in C.html, so each file has a comment referring to the other, e.g. in msg.h,/* see ../Doc/C.html for more extensive documentation */and in C.html <!-- documentation for msg.h --> This makes it more likely that when I change one file I'll just B3 in the name of the related file to jump to it. gary@cs.su.oz.au |