Bluefish 2.0: Slim but powerful
Long-time Linux users, especially those with a penchant for Web development, are probably familiar with the venerable Bluefish editor. The Bluefish team released 2.0 in mid-February, and it brings with it a number of subtle improvements and enhancements for managing projects, custom code, and crash recovery.
![[Bluefish 2.0]](https://static.lwn.net/images/2010/bluefish-2.0-sm.png)
Bluefish 2.0 is released under the GPLv2, and packages are available for Debian, Ubuntu, Fedora, OpenSolaris, and AltLinux. The Bluefish team also provides a Windows port, but it lacks some of the features found in Bluefish 2.0 for the Unix family. For example, the remote file support via GVFS is absent, and external filters are not supported.
At its heart, Bluefish is a over-competent text editor. Bluefish is a first-class HTML editor, but also provides support for a number of other languages and markup formats. Bluefish supports C/C++, ASP, Ada, Java, SQL, PHP, Perl, Python, Ruby, shell scripts, Mediawiki markup, and several others. HTML, CSS, and JavaScript are where the editor really shines, however.
![[Cherokee support]](https://static.lwn.net/images/2010/bluefish-cherokee-sm.png)
Not much has changed in the 2.0 release on the surface. Bluefish 2.0 doesn't look much different than its predecessor. It adheres to the tab-based toolbars, with entries for "Standard" HTML features, fonts, tables, frames, forms, and CSS. 2.0; adds a character map so it's trivial to insert accented characters, symbols like the copyright character, and a wide range of language support. Bluefish is the editor to choose for any developer creating a site that uses the Cherokee syllabary or any of the dozens of character/symbol sets. Bluefish also gives the option of inserting characters directly, or as HTML entities.
![[Bluefish 1.x]](https://static.lwn.net/images/2010/bluefish-1.x-sm.png)
The 2.0 Bluefish release replaces Bluefish's 1.x series custom menu with a snippets sidebar. The previous release of Bluefish had a custom menu that allowed the creation of additional dialogs that would insert user-defined code fragments and help automate tasks. For instance, a user could define a custom search and replace function that would go through a document and swap out curly quotes for straight quotes, or otherwise clean up bad text to help conform to a style guide. It was a little complex to get started with, but otherwise a useful feature.
![[Snippet dialog]](https://static.lwn.net/images/2010/bluefish-snippet-sm.png)
The Snippets sidebar is perhaps more conveniently placed, but not as intuitive when creating new functions. To add a new item, right-click on the snippets sidebar and select "New Snippet." You'll be asked for the name of the "branch," which is actually the name of the top-level menu that will be defined. After providing the "branch" name, the dialog closes and you'll see an entry in the Snippets sidebar that does nothing. After defining the top-level menu, click on that and select New Snippet again. This time the user is allowed to define the type of entry that will be added: Another branch (sub-menu), a string to be inserted, or a search and replace pattern.
The dialogs are a bit arcane, but once one stumbles on the trick to adding new snippets, it's a bit more user-friendly than the 1.x series. It's a good feature, but perhaps not as well implemented as it could be. The primary problem is the lack of accompanying documentation. The only docs to be found on creating Snippets that seems to be available is in one of the Bluefish 2.0 movies found on the Screenshots page. The Bluefish Manual looks to be a bit outdated and only covers up to version 1.6.
If it sounds like Bluefish is not user-friendly, that's far from the case. This release packs in some really helpful features that make using Bluefish a joy. For example, the autocompletion feature. When you start typing an HTML tag or function for one of the supported languages, Bluefish will start offering possible tags or functions. Type "<a" and Bluefish will supply a context menu with the possible tags that begin with "<a" and help text that spells out what each tag is. It's not limited to HTML, it also works with CSS, JavaScript, etc. It doesn't include tags or other snippets that are user-defined, but it seems to be very comprehensive with the built-in autocompletion for supported languages.
Another friendly feature in 2.0 is automatic document recovery. If a session crashes for some reason, when re-starting Bluefish it will open all of the previous unsaved documents with all changes intact. To make sure that this worked as advertised, I used xkill to force Bluefish 2.0 to crash several times because it was uncooperatively stable during testing, and forced my hand to test this feature. The only problem is that Bluefish only recovers documents that were unsaved. Documents that were saved when a Bluefish session crashed are not automatically reopened. But, since Bluefish doesn't have a habit of crashing, it shouldn't be an issue very often.
For tasks that require working on multiple files at the same time, Bluefish 2.0 has support for saving the group of files as a project. When files are saved together as a project, users can open one or fifty (or more) files at the same time and keep all of a project's work together as a group. Project support isn't new to 2.0, but it does advance the feature by letting users set many more preferences for the project. For instance, users can specify on a per-project basis the template to use, the default MIME type for new files, tab width in the documents, and if a project should support block folding.
Bluefish supports syncing files between local directories or from a local directory to a remote host over SFTP, FTP, HTTP, HTTPS, WebDAV, or CIFS depending on which GVFS virtual file systems are supported on your system. This is slightly inconvenient, as it requires mounting the remote filesystem through Nautilus before being able to access it in Bluefish. Once it's set up, if you have a project configured it will store the configuration and let you sync the local and remote files with just a few clicks. So it's only necessary to set this up once when it's stored as part of a project.
Like any good Unix tool, Bluefish plays well with others. Files in Bluefish can be processed through commands and filters like HTML Tidy, make, xmllint, sort, uniq, or other scripts or tools specified by the user. Additional tools can be added via Bluefish's preferences. It's possible to filter just a section of a file, or the entire file that's being edited.
The Bluefish team calls the editor a "what you see is what you need," tool as opposed to What You See Is What You Get (WYSIWYG) editors that attempt to hide some of the complexity of developing a Web site. Bluefish gives users bare-metal access to the toolset without any frills. It does, however, give the ability to feed pages to Firefox or other browsers for rendering so that it's possible to see how a site is coming together.
For users who know their way around the languages and markup they'll be using, Bluefish is a really useful tool that helps support the user's expertise and makes it easy to pull together assorted free software tools for developing Web sites. It might not be very well-suited for users who are accustomed to heavy duty tools like DreamWeaver or even Kompozer that provide WYSIWYG editing and do a lot of behind-the-scenes work for the user. The trade-off is that Bluefish provides a great deal of control and flexibility and is likely to be preferred by users who have advanced Web development chops already.
Index entries for this article | |
---|---|
GuestArticles | Brockmeier, Joe |
Posted Mar 11, 2010 12:05 UTC (Thu)
by epa (subscriber, #39769)
[Link] (1 responses)
Posted Mar 12, 2010 6:47 UTC (Fri)
by thedevil (guest, #32913)
[Link]
Which HTML editor to use?
I would like it to generate valid HTML and to be able to round-trip a valid
HTML input file (so changing one word should be a one-line diff, apart maybe
from whitespace). Most editors like Bluefish are quite frightening, with
hundreds of different buttons and toolbars, when I was hoping for a few
simple 'new paragraph', 'insert image', and perhaps a dropdown list of
styles to apply based on a pre-written CSS file. Ideally it would have
a WYSIWYG style of editing (as far as that is possible on the web) rather
than editing the raw HTML code. Any suggestions?
Which HTML editor to use?