3 ms·
It works best with the plumber, which is to pattern matching as file name extensions are many file browsers. Plumb a uri and it opens the browser, unless you ad
by wendroid 17y ago
It works best with the plumber, which is to pattern matching as file name extensions are many file browsers. Plumb a uri and it opens the browser, unless you added a more specific rule to follow a different action.
http://swtch.com/plan9port/man/man4/plumber.html http://swtch.com/plan9port/man/man4/plumber.html
For instance in Plan 9 I mount the file system of my webserver (across the internet), tail -f /n/remote/var/log/httpd/error_log.
An example error would be
[Thu Nov 26 15:28:15 2009] [error] PHP Warning: Invalid argument supplied for foreach() in /staging/php/restricted.class on line 286
For which I have a plumbing rule
type is text
data matches '(/staging/[^ ]+) on line ([0-9]+)?'
data set /n/remote/var/www/$1
attr add addr=$2
plumb to edit
plumb client $editor
My apache is chrooted so I set the un-chrooted path with relation to my plan 9 (the remote server is mounted at /n/remote)
So in Acme I plumb the error message and Acme opens the file (if it isn't open) and scrolls to the appropriate line.
Ok this is nothing amazing in and of itself, other editors can do similar things - EditPlus on Windows can scan error messages) but combining simple things like this makes a bigger system.
Typing your own menus is also a great feature. You can whip up an awk script and apply it to selected text.
Here's a little one
http://plan9.bell-labs.com/sources/contrib/maht/rc/exe http://plan9.bell-labs.com/sources/contrib/maht/rc/exe
If I type 'exe doit' in the current window, select the text and middle click it creates the file (in the pwd of that window) , chmods it, adds the hash bang and opens it in new window.
Again, not amazing on it's own but one builds up such things over time and there is no restriction on what language to use, I even have a few that ssh into a remote server and run them there.
There is no best editor, but Acme is the best for me.
Oh and if you middle click Font it switches between the two specified fonts (sans and mono by default).