Customization For MacOS X

From Bluefish Wiki
Revision as of 13:13, 14 March 2010 by OlivierSessink (talk | contribs) (→‎External programs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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