zurücl | Inhalt | weiter

Kapitel 1: Der erste Start

Der Zweck dieses Kapitels ist, Dir eine kurze Einführung in die grundlegenden Funktionen zu geben, damit Du schnell beginnen kannst, mit Bluefish Deine Seiten zu designen. Unser Ziel ist es, dass Du mit der Umgebung und Benutzerführung von Bluefish vertraut wirst.

Dieses Kapitel zeigt nicht alle Funktionen von Bluesfish, sondern ist eine Einführung. Spätere Kapitel zeigen alles detailliert.

Starten des Programms

Nach der Installation, falls Du das Installationsverzeichnis nicht verändert hast, sollte sich die ausführbare Datei in /usr/local/bin/ befinden. Somit musst Du zum Starten nur

blashyrkh:~# bluefish

eingeben.

ACHTUNG: Aus Sicherheitsgründen kann der root-User Bluefish nicht benutzen. Falls Du root bist und bei der Eingabe von bluefish eine Fehlermeldung erscheint, musst Du bluefish -s eingeben um das Programm trotzdem starten zu können.

Das Logo von Bluefish erscheint kurz, und danach das Hauptfenster (siehe unten). Du kannst dieses Fenster natürlich in der Größe verändern, je nachdem welche Features Dein Windowmanager bietet (Die Screenshots wurden unter KDE aufgenommen).

Die Befehlszeilenoptionen können mit -h ausgegeben werden:

blashyrkh:~# bluefish -h
bluefish pre0.6 HTML editor
Usage: bluefish [options] [filename]

Derzeit zur Verfügung stehende Optionen:
-s           überspringe root Überprüfung
-v           derzeitige Version
-h           dieser Hilfebildschirm
-p dateiname Lade Projekt beim Start
TIP: Falls Du alle PHP-Dokumente in einem Verzeichnis und seinen Unterverzeichnissen öffnen möchtest, kannst Du Bluefish so starten:
bluefish `find -name '*.php'`.
Oder alle html-Dateien auf einer Maschine? (Achtung, das sind über 1100 auf einer Standard-Debian-Maschine!) Benutze
bluefish `find / -name '*.html'`.
Lies man find und man bash für mehr Infos.

Main screen

Oberfläche

Wir erklären nun einiges Grundlegende zum Interface von Bluefish, und am einfachsten machen wir das anhand des Fensters das wir oben gesehen haben.

Das Menü

Oben ist das Menü, wo alle Funktionen von Bluefish aufgeführt sind. Funktionen sind nach ihrer Funktion gruppiert, so enthält das Menü Datei Funktionen, die Dateien betreffen; Bearbeiten betrifft die Haupteditierfunktionen (Ausschneiden, Kopieren, Einfügen usw..), usw. Falls Du auf ein Menü klickst, erscheinen seine Untermenüs. Jedes Untermenühat links seinen Namen und rechts sein Tastaturkürzel stehen, was wir später erklären werden.

BEMERKUNG:Falls wir uns in diesem Handbuch auf einen Untermenübefehl beziehen, geben wir seinen Pfad folgenderweise an: Datei-->Neu bedeutet, dass Du im Dateimenü Neu auswählen musst.
Eine sehr nützliche Funktion von GTK+ sind tearoffs. Um zu sehen was das ist, wähle das Menü Datei und klicke auf die kleine gestrichelte Linie. Wie Du siehst, wird ein neues Fenster aufgemacht, das alle Untermenüs enthält. So kannst Du schneller auf diese Funktionen zugreifen, indem Du das Fenster einfach neben das Hauptfenster ziehst. Wenn Du wieder auf die gestrichelte Linie klickst oder das Fenster schließt, verschwindet es wieder. Das Menü ist währenddessen immer noch vom Hauptfenster aus möglich.

Was es also tatsächlich macht, ist das Menü auf den Bildschirm auszulagern. Unglücklicherweise kann man den Zustand nicht abspeichern, so dass bei einem Neustart die Menüs wieder nur im Hauptfenster sind.

Tastenkürzel

Beim Blick auf die Menüs ist Dir sicher aufgefallen, dass bei einigen Einträgen rechts Tastenkombinationen stehen. DIese werden Tastenkürzel genannt und sind eine Tastenkombination die mit Strg oder Alt beginnt. Falls diese Tastenkombination gedrückt wird, wird die Funktion ausgeführt. Falls Du z.B. eine neue Datei öffnen möchtest, kannst Du statt im Menü Datei-->Neu anzuwählen einfach Strg zusammen mit 'N' drücken.

Sehr nützlich ist, dass Du Dir Deine eigenen Tastenkürzel definieren kannst. Dazu bewegst Du die Maus einfach über den Menüeintrag und drückst das Tastenkürzel das Du gerne zugeordnet haben möchtest. Wie Du siehst, wird das Tastenkürzel hingeschrieben und ist sofort neu zugeordnet. Falls dieses Kürzel bei einem anderen Menüpunkt schon existierte, wird es dort gelöscht.

Falls Du ein Tastenkürzel löschen möchtest, fahre einfach über den Menüpunkt und drücke Backspace.

TIP:Ein Tastenkürzel kann auch die Kombination von Strg, Alt und Shift mit einer anderen Taste sein. Z.B. Strg-Shift-N. Nur die Shift-Taste alleine funktioniert nicht (die ist ja zur Groß-/Kleinschreibungsumschaltung).

Since short-cuts are used very frequently, you might want to save the changes you've made. Select Options-->Save Shortcut key settings to do that. This will also save any shortcuts you have set for the Custom menu (Bluefish 0.5 and later). Note that the short-cuts are NOT saved automaticly, so you need to select that sub-menu each time you want to save them.

Also, note that some short-cuts are reserved by the textbox and cannot be used. A listing of them can be found later on.

The toolbars

Below the menu are 3 toolbars (in the screen above, only the two of them appear); the main toolbar, the HTML toolbar and the custom menu.

Floating A great thing about toolbars is the fact that they can float as well. Note the left corner of each toolbar, which looks similar to the image at the left. Place the mouse over it, hold the left mouse button down and drag the toolbar to wherever you like and then release the mouse button. In this way, you can make a toolbar float as well.

When a toolbar floats, it doesn't appear in the main window, thus giving more space for the textbox.

If you drag the toolbar back to its original place, it will become part of the main window again. Note that the toolbars will be placed in the following order (from top to bottom): main toolbar, html toolbar, custom menu. So far, there's no way to place a toolbar above another.

A short description of what each button of the toolbar does can appear if you leave the mouse pointer for a few seconds over the button (these are called tool-tips).

As with the menus, you cannot store their position, so when Bluefish is re-started, they will appear in their normal position, as part of the main window.

The file editing area

The greatest part of the window is taken over the editing area. This is where the text of the files appears. Bluefish allows you to have as many documents opened simultaneously as you like.

The tab menu shows the files that have been opened. In the image above, we have two files: preface.html, a file that we opened from disk and Untitled which is a new unsaved file. New files are always named "Untitled". The currently selected is "Untitled". This tab allows you to switch through files. If you press on another tab, it switches to the file with the selected filename. Go ahead and try it, by clicking on File-->New twice and then switch the tabs. Another way to change the documents (if you haven't changed the short-cuts) is with F1 to select the next document and F2 to select the previous document (these shortcuts are in View menu).

The appearance of the editing area can be changed in Options-->Preferences as we will see later on.

Statusbar

Finally, at the bottom corner of the screen is the status bar, which is used in order to show messages about actions that have been taken. To understand its usage, observe whatever appears there while you're pressing different buttons, etc.

Moving to more important stuff

Now that we've explained the basic stuff about the interface, let's continue with using Bluefish.

I believe that the first basic things we need to explain is how you could create new documents, as well as open and save files. Not only will we explain these functions but also help you realize a few features of Bluefish that will make things easier and quicker for you (like Quickstart...).

Creating a new file

In order to create a new untitled empty file, there are 3 ways:

As you will see, a new tab will appear in the editing area and the text will be totally empty.

But it doesn't look good being empty. Wouldn't it be wonderful if you had the basic HTML tags written for you (e.g. the DTD, the title, etc.). Bluefish has a good way to help you write the basic stuff with ease.

This will pop up a number of windows, in which you can select the DTD, page title and META tags, as well as set the Body variables.

Editing text

Apparently, you can edit the file using the editing area. In writing tags, the HTML toolbar can appear very useful, since it contains all the basic tags. Some buttons (as well as the functions under the Dialogs menu) show windows in which you can easily set the tag parameters, making things faster. In case you want a description of what each button the HTML toolbar does, move the mouse over it and wait until its tool-tip appears.

By default, word-wrap is used (you can disable it at Options-->Preferences). In case a line is wrapped, a small icon appears at the right of the line, indication which lines are wrapped. If there are many such icons in a row, this means that a line has been wrapped to many other lines.

I believe this is a good time to pay attention to the Edit menu, as it contains some very interesting functions.

TIP: Regular expressions are a powerful tool. Suppose you want to lowercase all HTML tags in a document. Without regular expressions you can't do one search and replace. The pattern <[^>]*> wil find anything between a < and a >, which does not have a > in between. Now select Replace uppercase and your done! The drawback: this simple pattern will of course also lowercase the alt description of an image etc. so it's not perfect.
TIP: You've ever seen a HTML document created using Frontpage? These sometimes include hundreds of empty lines and spaces. It is possible to search and replace newlines in Bluefish. But you have to copy and paste them into the entry in the search dialog. So now select two lines, paste the selection into the find: entry in the search dialog, replace with a single line, and select overlapping searches. All the multiple empty lines will be reduced to a single empty line.

Another interesting feature is the pop-up menu that appears if you press the right mouse button. This is a quick way to use some basic functions, like 'Cut' and 'Copy'. The functions here work exactly as their correspodant functions in the menu and toolbars. As far as the latest item of this pop-up menu is concerned, the 'Edit tag', we will talk about it later on.

Opening a file (from a disk or the web)

To open a file from a disk:

A 'select file' dialog will appear, from which you can choose the file you want to open. A very useful feature is that in that menu you can select to open more than one file at the same time (only that all files opened must be in the same directory). In fact, we have successfully tried to open 1000 documents at the same time!

Another very useful feature is that you can open a file directly taken from the web. In order to do that, select File-->Open from the web. In the window that appears, write the full adress of the document (e.g. 'http://jmk.simplenet.com/prod/download.htm'). Of course, adresses like 'http://jmk.simplenet.com/' are accepted and the file opened will be the one just like if you had selected that URL from a web browser.

Finally, a thing you should note is that if you have just opened the program and there's just one untitled file, it will disappear when a file is opened and will be replaced with the file you opened. If however you've changed it even a bit, it will stay.

Saving files

If you want to save a file, you must first select its name from the tab of files in the editing area (i.e. it must be the one that appears in the main window), and then:

By pressing 'Save', the file that is currently viewed is saved. In case the file is unssaved to disk (i.e. if it had been opened from the web or is an untitled file), 'Save' acts like 'Save As'. By pressing 'Save as' you can save it with a different name than the one it already has.

In case you want to save all opened files, select File-->Save All. This saves all files, examining each time if the file is untitled or opened from the web. Then the 'Save as' dialog appears for that specific file.

Closing a file

In order to close a file, you must first select it so that it is viewed in the editing area, then:

In case the file has been changed since the last time it was saved, then you will be prompted whether to save it before you close it. In that dialog, by selecting 'Close', the file closes without saving it. If you select 'Save', the file is first saved, and if you press 'Cancel' the file isn't closed at all.

If you want to close all files that have been opened, select File-->Close All. In case they are not saved, the former dialog will appear.

Quiting Bluefish

In order to close Bluefish, you can either close the main window or select File-->Quit, which has the short-cut Ctrl-Q.

In case there are unsaved files, before the application closes, a similar dialog to the one explained above will appear.

Working with HTML

So far, we've seen how you can create, open, edit and save a file. Though this is enough to start working, don't forget this is an HTML editor, not simple a text editor. This means that special attention is given to using HTML, thus a few special tools (that you won't find on a simple text editor) have been implemented, to help you in using tags and organising your documents.

Tags and Dialogs

You may have noticed two menus, Tags and Dialogs. Most functions on these menus can be also found in the HTML toolbar together.

The Tags menu contains a few HTML tags, most of which don't have parameters. These tags include text-formatting tags (Bold, Italic, Strikethrough, etc.), headings, lists, etc. Also, pay attention at the Tags-->Special menu which contains a list of special characters.

Let's try to press a sub-menu (make sure that no text is selected). The tag described appears and the cursor is placed between the start (<>) and end (</>) tag, so that you can write the text that belongs in that tag.

Another interesting way that these menus function is you have text selected. For example, write 'Hello World' and then select it. Press Tags-->Headings-->H1 and the text will be covered with a H1 tag. This is very useful since you can change the formatting (e.g. make it look bold or itallic) of an already-written text quickly.

The Tags-->replace ascii chars will replace all occurences of HTML special chars like <>&" with their HTML entities &lt;&gt;&amp;&quot; within the current selection.

The Dialogs menu almost has the same usage, but instead of simply writing text, a window is popped up, in which you can place the parameters of the tags. If you leave a field blank, then that parameter won't appear in the text.

Editing tags

Remember when we mentioned about the pop-up menu that appears when we press the right mouse button on the text area? The last item was Edit Tag. Time to explain what it does.

As you've seen, with Dialogs menu you can easily insert parameterized tags. Once they are inserted, you can always edit them manually, by simply editing the text. But, as you've seen, it is easier to adjust the parameters of a tag through the dialogs, rather than writing text. This is where 'Edit Tag' comes in.

From the Dialogs menu, select a tag (e.g. Dialogs-->Table-->Table, adjust its parameters and insert the tag. Then, place the cursor over the tag, press the right mouse button and select 'Edit Tag'. As you will see, the same window in which you created the tag appears (this time, not all fields are blank, but instead they are set to fit the tag's parameters). Now, you can edit the tags through this menu easier and more automaticly.

Note that this works only with tags that have been inserted from Dialogs or the correspodant buttons in the HTML toolbar.

Syntax highlighting

This feature will be explained in detail at the second chapter, but here is a synopsis of its usage.

In order to easily identify the tags and distinguish them from the normal text, tags can be highlighted (actually, the text is colored differently from the normal text in order to be distinguishable, whereas a normal-life highlighter changes the color of the background).

To set this feature on, check View-->Highlight syntax. Each time you want the tags to be colored, select View-->Refresh highlighting, default shortcut F5, or this can be done continuously if you adjust the Preferences menu, as you will see later on.

Projects

Projects in Bluefish will remember some history for you. If you have a couple of files open that are related, choose Project->add all open documents. Now save the project (usually located in ~/.bluefish/projects/). Any color you use, or any font, any targets, url's etc. are recorded in the project, and if you save the project they are saved as well. The values can be edited using Project->edit, the menu contains files and lists, where you can access the contents of a project.

When you open a project, all files in that project are opened. If you preview a file which is in a project, the basedir is removed from the filename and replaced by the webdir. So /home/olivier/public_html/index.html can be replaced into http://localhost/~olivier/index.html if you want to. This is very useful when programming dynamic (PHP, SSI, RXML) websites on a local server.

prev | contents | next