Customization For MacOS X: Difference between revisions
m CustomizationForMacOSX moved to Customization For MacOS X |
|||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Here you will find some additions to Preferences. They may be also useful on other systems. | Here you will find some additions to Preferences. They may be also useful on other systems. | ||
== Editor == | |||
If you want to compare several versions of the same file on different locations (even remote ones), choose full path in Bookmarks filename display pop-up menu. | |||
== Files == | |||
In the Misc section, check Allow multi instances of a file, this way you can open several instances of bluefish and edit an instance of a given file, while having at hand the original in another instance of bluefish. | |||
== File types == | |||
If you are using the Apache web server provided by the system with SSI directives and language negotiation, you may want to add some extensions to html types. For example, if you serve French and English shtml pages and the language is located at the end of the full path, use: | |||
<code>.html:.htm:.shtml:.shtm:.shtml.fr:.shtml.en</code> | <code>.html:.htm:.shtml:.shtm:.shtml.fr:.shtml.en</code> | ||
If you write sgml code, add the extension to xml types: | |||
<code>.xml:.sgml</code> | <code>.xml:.sgml</code> | ||
== External programs == | |||
You may want to add browsers available on Mac OS X for checking your files or some others available via Fink. To do this, you may have to install launch via Fink for some browsers. | |||
Then if you want to check normal files and files served via the Apache web server, you will need to give different names to the browsers (for example ~[[BrowserNormal]] for normal files and Browser for files served via Apache). This way, all the variables, scripts and so on initialized by the web server will be processed before displaying the page. | |||
If your files are not those under ~Library/~[[WebServer]]/~Documents (i.e. not linked to a domain name): | |||
Browsers available under Mac OS X:<br> | |||
~[[SafariNormal]]: <code>open -a 'Safari' %s</code><br> | ~[[SafariNormal]]: <code>open -a 'Safari' %s</code><br> | ||
~[[FireFoxNormal]]: <code>launch -a 'Firefox' %s</code> (you should install launch via Fink)<br> | ~[[FireFoxNormal]]: <code>launch -a 'Firefox' %s</code> (you should install launch via Fink)<br> | ||
Line 28: | Line 31: | ||
~[[OperaNormal]]: <code>launch -a 'Opera' %s</code><br> | ~[[OperaNormal]]: <code>launch -a 'Opera' %s</code><br> | ||
Browsers available under Fink:<br> | |||
~[[DilloNormal]]: <code>dillo %s</code> | ~[[DilloNormal]]: <code>dillo %s</code> | ||
If your files are linked to a domain name under Apache (say ~http://foo.domain.org): | |||
Browsers available under Mac OS X:<br> | |||
Safari: <code>open -a 'Safari' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | Safari: <code>open -a 'Safari' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | ||
Firefox: <code>launch -a 'Firefox' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | Firefox: <code>launch -a 'Firefox' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | ||
Line 39: | Line 42: | ||
Opera: <code>launch -a 'Opera' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | Opera: <code>launch -a 'Opera' `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code><br> | ||
Browsers available under Fink:<br> | |||
Gnome: <code>gnome-moz-remote --newwin `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'` &</code><br> | Gnome: <code>gnome-moz-remote --newwin `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'` &</code><br> | ||
Mozilla: <code>mozilla -remote 'openURL(`echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)' || mozilla `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)'</code><br> | Mozilla: <code>mozilla -remote 'openURL(`echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)' || mozilla `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)'</code><br> | ||
Line 45: | Line 48: | ||
Dillo: <code>dillo `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code> | Dillo: <code>dillo `echo file\://%s | sed 's;^file\:///Library/~[[WebServer]]/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`</code> | ||
== External commands == | |||
If you use Perl: <br> | |||
perlTidy filter: <code>cat '%s' | perltidy -b >'%f' 2>/dev/null</code> | perlTidy filter: <code>cat '%s' | perltidy -b >'%f' 2>/dev/null</code> | ||
If you need to make a file executable: <br> | |||
Chmod: <code>chmod +x '%s'</code> | Chmod: <code>chmod +x '%s'</code> | ||
If you want to open an xterm from within Bluefish: <br> | |||
Xterm: <code>xterm -fn lucidasanstypewriter-11 &</code> | Xterm: <code>xterm -fn lucidasanstypewriter-11 &</code> | ||
And if you need to execute a series of command within an xterm, you may use: <br> | |||
Mycommand: <code>xterm -e 'mycommand1; mycommand2' &</code> | Mycommand: <code>xterm -e 'mycommand1; mycommand2' &</code> | ||
== Output parsers == | |||
If you want to make a patch between foo and foo-patched: | |||
Diff: <br> | |||
Model: <code>(~[[a-zA-Z0-9~/_.-~]]+):(~[[0-9~]]+):(.*)</code> <br> | Model: <code>(~[[a-zA-Z0-9~/_.-~]]+):(~[[0-9~]]+):(.*)</code> <br> | ||
File #: 1 Line #: 2 Output #: 3 <br> | File #: 1 Line #: 2 Output #: 3 <br> | ||
Command: <code>diff -Naur '%s' '%s'-patched | tee '%s'.patch</code> | Command: <code>diff -Naur '%s' '%s'-patched | tee '%s'.patch</code> | ||
If you work with sgml files, add onsgml to validate the files: | |||
Onsgml:<br> | |||
Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code> <br> | Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code> <br> | ||
File #: 1 Line #: 2 Output #: 3 <br> | File #: 1 Line #: 2 Output #: 3 <br> | ||
Command: <code>onsgmls -s -c /sw/etc/sgml/catalog '%s'</code> | Command: <code>onsgmls -s -c /sw/etc/sgml/catalog '%s'</code> | ||
If you work with ruby files, you may want to run them from within Bluefish. | |||
Runruby:<br> | |||
Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code><br> | Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code><br> | ||
File #: 1 Line #: 2 Output #: 3 <br> | File #: 1 Line #: 2 Output #: 3 <br> | ||
Command: ruby '%s' | Command: ruby '%s' | ||
If you work with perl files, you may want to run them from within Bluefish. | |||
Runperl:<br> | |||
Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code><br> | Model: <code>(~[[a-zA-Z0-9~/_.-~]]+)\:(~[[0-9~]]+)\:(.*)</code><br> | ||
File #: 1 Line #: 2 Output #: 3 <br> | File #: 1 Line #: 2 Output #: 3 <br> | ||
Command: ./'%s' | Command: ./'%s' | ||
If you use Makefile files, you may want to add: | |||
Make-check:<br> | Make-check:<br> |
Latest revision as of 12:13, 14 March 2010
Here you will find some additions to Preferences. They may be also useful on other systems.
Editor
If you want to compare several versions of the same file on different locations (even remote ones), choose full path in Bookmarks filename display pop-up menu.
Files
In the Misc section, check Allow multi instances of a file, this way you can open several instances of bluefish and edit an instance of a given file, while having at hand the original in another instance of bluefish.
File types
If you are using the Apache web server provided by the system with SSI directives and language negotiation, you may want to add some extensions to html types. For example, if you serve French and English shtml pages and the language is located at the end of the full path, use:
.html:.htm:.shtml:.shtm:.shtml.fr:.shtml.en
If you write sgml code, add the extension to xml types:
.xml:.sgml
External programs
You may want to add browsers available on Mac OS X for checking your files or some others available via Fink. To do this, you may have to install launch via Fink for some browsers.
Then if you want to check normal files and files served via the Apache web server, you will need to give different names to the browsers (for example ~BrowserNormal for normal files and Browser for files served via Apache). This way, all the variables, scripts and so on initialized by the web server will be processed before displaying the page.
If your files are not those under ~Library/~WebServer/~Documents (i.e. not linked to a domain name):
Browsers available under Mac OS X:
~SafariNormal:open -a 'Safari' %s
~FireFoxNormal:launch -a 'Firefox' %s
(you should install launch via Fink)
~CaminoNormal:launch -a 'Camino' %s
(you should install launch via Fink)
~OperaNormal:launch -a 'Opera' %s
Browsers available under Fink:
~DilloNormal: dillo %s
If your files are linked to a domain name under Apache (say ~http://foo.domain.org):
Browsers available under Mac OS X:
Safari:open -a 'Safari' `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`
Firefox:launch -a 'Firefox' `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`
Camino:launch -a 'Camino' `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`
Opera:launch -a 'Opera' `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`
Browsers available under Fink:
Gnome:gnome-moz-remote --newwin `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'` &
Mozilla:mozilla -remote 'openURL(`echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)' || mozilla `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`, new-window)'
Galeon:galeon -x `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'` &
Dillo:dillo `echo file\://%s | sed 's;^file\:///Library/~WebServer/Documents/\\(.*\\)$;http\://foo.domain.org/\\1;'`
External commands
If you use Perl:
perlTidy filter: cat '%s' | perltidy -b >'%f' 2>/dev/null
If you need to make a file executable:
Chmod: chmod +x '%s'
If you want to open an xterm from within Bluefish:
Xterm: xterm -fn lucidasanstypewriter-11 &
And if you need to execute a series of command within an xterm, you may use:
Mycommand: xterm -e 'mycommand1; mycommand2' &
Output parsers
If you want to make a patch between foo and foo-patched:
Diff:
Model:(~a-zA-Z0-9~/_.-~+):(~0-9~+):(.*)
File #: 1 Line #: 2 Output #: 3
Command:diff -Naur '%s' '%s'-patched | tee '%s'.patch
If you work with sgml files, add onsgml to validate the files:
Onsgml:
Model:(~a-zA-Z0-9~/_.-~+)\:(~0-9~+)\:(.*)
File #: 1 Line #: 2 Output #: 3
Command:onsgmls -s -c /sw/etc/sgml/catalog '%s'
If you work with ruby files, you may want to run them from within Bluefish.
Runruby:
Model:(~a-zA-Z0-9~/_.-~+)\:(~0-9~+)\:(.*)
File #: 1 Line #: 2 Output #: 3
Command: ruby '%s'
If you work with perl files, you may want to run them from within Bluefish.
Runperl:
Model:(~a-zA-Z0-9~/_.-~+)\:(~0-9~+)\:(.*)
File #: 1 Line #: 2 Output #: 3
Command: ./'%s'
If you use Makefile files, you may want to add:
Make-check:
Model:(~a-zA-Z0-9~/_.-~+)\:(~0-9~+)\:(.*)
File #: 1 Line #: 2 Output #: 3
Command: make check
Show results: 1
Make-clean:
Model:(~a-zA-Z0-9~/_.-~+)\:(~0-9~+)\:(.*)
File #: 1 Line #: 2 Output #: 3
Command: make clean
Show results: 1