Most of the file operations are accessible from the
menu. Using this menu, a new file can be created, existing files opened, and opened files saved or renamed.You may also insert a file into another one, and revert a modified file to its previously saved state.
You may also add directories, delete files, and refresh the file browser in the side panel using its contextual menu.
Apart from using Ctrl-N) or the New icon to create a new file, you may also use → (Shift-Ctrl-N).
→ (Those methods create an untitled file of type text
with default permissions and the default character encoding defined in the Files tab in the → menu option. You will further have to save it under the desired name.
To spare yourself the bother of saving, right click on the desired directory in the directory list of the file browser in the side panel and select New File. You will be presented with a File name dialog, where you will enter the desired name:
To create a new directory, right click on the desired parent directory in the directory list of the file browser in the side panel and select New Directory.
Then enter the desired name in the Directory name dialog. Bluefish will create the named directory with the default permissions.
Note that you cannot delete directories within Bluefish, but you can refresh the view with the Refresh contextual menu item of the file browser. This is especially useful when you add files and directories or delete files.
Through Ctrl-O), one or more files can be opened. When creating new files, you may want to open the files in a new window. In this case, use → to first open the new window and then open the desired files as usual.
→ (![]() | |
The most recently opened directories appear in the upper part of the side panel, while the lower part contains user-defined locations. To add a new directory to the list, click on Add. You can also filter the file list by file type using the pop menu located on the right side. The list of file types in the filter menu is provided through the Filetypes tab found in Bluefish's → menu option. |
Recently opened files can be opened by selecting them from the list within Files.
→ . The number of files in this menu can be set in the preferences underThe file browser in the side panel can also be used to open files. It supports filtering files, by right clicking the contextual menu in the file browser.
The available filters may be modified in Preferences. For more information, see Section 6.11, “Modifying the files filters”.
If you right click a directory, you can make this directory the base directory for the file browser using the
option. Then you can access it directly from the pop up menu in the upper part of the file browser.By default the file browser follows the document focus. If you change to a different document, the file browser will show the contents of the directory where this document is located. This behaviour can be changed on the bottom of the file browser.
Information about currently opened files can be seen if you move the mouse over the document tab (by default on the bottom of the screen). A so called tool tip will be shown with information about the full path, size, permissions, file type and encoding of the file.
An interesting feature of Bluefish is the ability to open files by selecting the text of a currently opened file. For example, if a filename is shown in say a terminal application, you can select the filename, and use
→ to open that file. The file, if it exists, will be opened in another tab within Bluefish.Finally, files can be opened via the command line by feeding filenames to Bluefish as arguments. This can even be done while Bluefish is running and the resulting file will then show up in its own tab.
Files can also be opened by clicking on the Open... icon in the main tool bar.
![]() | |
If you have installed gnome-vfs or gnome-vfs2 before installing Bluefish, you will be able to open files on remote desktop. |
Be aware that if the file is huge it may take a very long time to get the rendering if syntax highlighting is enabled. The GTK editing widget used in Bluefish, furthermore, is not very good at handling files with very long lines, and that could also slow down Bluefish considerably.
If a document is modified, the filename is shown in red in the document tabs, and also if you right click on the tabs, the full path is shown in red in the list that will pop up.
To save a document, you can use the Save icon in the tool bar, or press the shortcut key combination Ctrl-S. By default a backup is made during save. The original file is copied to the same filename with a tilde ~ appended. This suffix and the backup behaviour can be changed in the preferences under Files.
menu, theBefore saving the file, Bluefish will check if the original file was changed on disk, using the last modified time and the file size. On some file systems the last modified time is sometimes not very precise (most notably on samba mounts). This makes Bluefish think the file is modified when it is not. This check can be changed in the preferences under Files.
You can also save a document under a different name, using the Shift-Ctrl-S) menu entry, or the Save As... icon in the main tool bar. The original file will still exist.
(To save all modified files, you can use the
→ menu entry. This will save all documents that have been modified and present you with a save dialog if some files are new files.It is also possible to move or rename a document, using the F2) menu item, or right-clicking the file name in the side panel and choosing the item.
→ (To delete a file, right click on it in the file browser within the side panel. You will be asked either to confirm the deletion or to cancel the process, if you have the right permissions for it.
![]() | |
Be cautious with this feature, there is no easy way to recover the deleted file. |
When you want to close a file quickly, click on the close icon in the document tab. You may also use the Close icon in the main tool bar, or the → (Ctrl-W) menu item.
If the file is unchanged, it is merely closed. If the file has been modified, you will be presented with a save dialog.
![]() | |
Use it to save and close a file in one step. |
When dealing with multiple files, you may want to use the Shift-Ctrl-W) menu item.
→ (For each modified file, you will be presented with a save dialog, where you can choose to save the changes, close the file (i.e. discarding any change), or cancel the operation.
![]() | |
Say you have a number of open files, and only a few of them have been changed. To quickly close the unchanged files, and remain with the modified ones, use it answering cancel for the latter ones. |
Note that the
→ menu item offers the same behaviour.You can insert any file into the current document with the
→ menu item. The file will be inserted at the cursor location.For more in-depth information about dealing with files, see Section 3.12, “More on files”.
The undo and redo functionalities are available from the
menu, the main tool bar, and the keyboard shortcuts.Ctrl-Z)
(Shift-Ctrl-Z)
(The functions
and in the menu will undo or redo all of the stored changes. The maximum number of changes can be configured in the preferences, by default Bluefish will remember the last 100 changes per document. It is possible to clear the changes after the document is saved, an option in the preferences which is disabled by default.The functions
, , and are available from the menu, the main tool bar, and the keyboard shortcuts.Ctrl-X)
(Ctrl-C)
(Ctrl-V)
(On X Windows Systems, you can also paste the current selected text using the middle mouse button. First select some text (in Bluefish or in any other X application), then press the middle mouse button where you want to paste the selected text.
Cut or copy and then paste can also be done by selecting some text and dragging it to the destination. If the text is dragged to another document (or another application), it is copied. If the text is dragged within one document it is moved. Dragging highlighted text from one application to another may or may not work. However, most GNOME and GTK programs support this feature.
Bluefish handles a number of input methods, available from the contextual menu within a given document.
The default mode switches all input methods off.
The Amharic mode is used for the most popular Ethiopian language.
The Cedilla mode is used for languages such as French, which uses the cedilla.
The Cyrillic mode is used to enter Russian with Roman letters. The transliteration occurs immediately.
The Inukitut mode works the same as Cyrillic mode.
The IPA mode is used for International phonetic alphabet.
Other modes are used for Erythrean, Ethiopian, Thai and Vietnamese languages.
The X Input method relies on a client-server input system, and an input server.
For Japanese, Chinese, and Korean documents, you may have to install and launch the correct input system, such as canna, and the appropriate input server, such as kinput2.
Here is how to write a Japanese document on a non-Japanese system.
Procedure III.1. Writing in Japanese with Bluefish on a non-Japanese system
Launch the canna server if it is not running already
Set the encoding to Japanese, for example: export LANG=ja_JP.UTF-8
Set the Xinput method with export XMODIFIERS="@im=kinput2"
Launch kinput2 as a background process with kinput2 &
Launch bluefish as a background process with bluefish &
To activate the Xinput method within bluefish, use Shift-Space. A small window with a Japanese glyph will appear at one of the corner of the Bluefish window. Once the desired glyph has been composed, press Space, and hit enter to validate it.
Here, you can see the small Xinput method window, at the bottom left corner of the window and the first Japanese word not already validated in the Bluefish window launched on a French system.
For an in-depth discussion on that subject, see Inputting from the keyboard.
Bluefish offers a wide range of find and replace methods in the Section 4.5, “Find and Replace”.
menu, also available through the contextual menu within a document. Here we will explore the most basic ones. For advanced find and replace methods, seeChoose the Ctrl-F) menu item. A Find dialog will be displayed. Enter the word to search for in the Search for: field. Then click .
→ (If the word does not exist in the document, a small window pops up.
If the search is successful, the document window scrolls up to the first occurrence of the string in the document and highlights it.
Below is an example of a search applied to a shell script.
To find a subsequent occurrence of the string, use the Ctrl-G) menu item. If no further occurrence is found, a dialog will be displayed notifying you that no match was found.
→ (You may want to search for a string from the cursor location till the end of the document. Here is an example to search all name ==
occurrences within a python script from a given location.
Procedure III.2. Searching from selection
Put the cursor where you want to start the search from in the document window
Open the Find... dialog
Enter your search string in the Search for: field
Choose Current position till end from the Starts at: pop up menu
Click OK.
Here is the result:
Notice that the search does not take into account the occurrence of the same string at line 50, since it is outside the search scope.
You can also limit the search scope to a selection range. In that case, highlight the selection before the search, and choose Beginning of selection till end of selection from the Starts at: pop up menu in the Find dialog.
By default, the search process is case insensitive. If you want to make it case sensitive, just check the Match case box in the Find dialog.
Here is the result applied to a ruby script:
Notice again that the result does not catch the XML string at line 45, since the search string was xml and case sensitive search was requested.
It may occur that the document contains some kind of palindrome you want to search for. The "normal" find process does not retrieve all occurrences of that kind of string.
In this case, you have to check the Overlap searches box in the Find dialog to retrieve all occurences of the string.
Applied to a shell script, the second search (with Ctrl-F, then Ctrl-G) will give the following result:
Notice that the pop up menu to the right of the Search for field in the Find dialog allows you to retrieve previous search strings. They are listed in reverse order by search history, providing quicker access to the most recent searches.
For an explanation of the Bookmark results box of the Find dialog, see Section 4.4.1, “Generating several bookmarks at once”.
You will find details on Find Again and Find from Selection in Section 4.5, “Find and Replace”.
For a quick way of switching from HTML entities to other types of encoding and changing letter cases, see Section 5.5.1, “Special find and replace features”.
The Ctrl-H) menu item works the same way and has all the features, the → (Ctrl-F) menu item offers.
→ (The Replace dialog is also accessible through the contextual menu within a document.
For the features common to the Find dialog, see Section 3.10.1, “Searching for a word within a whole document”.
Here we will explain the features unique to the Replace dialog.
As for the Search for field's pop up menu, the Replace with field's pop up menu allows you to retrieve previous strings used for replace, the most recent ones being at the top of the list.
If you want to change letter case when replacing, use the Replace type pop up menu.
The default choice is Normal, that is the case is not changed.
With the Uppercase replace type, the search string will be replaced with its uppercase translation.
Likewise, with the Lowercase replace type, the search string will be replaced with its lowercase translation.
Notice that in this case, the Replace with field is deactivated, thus not taken into account even if you have entered some string in it.
It may occur that you do not want to replace all search strings retrieved by the search process, but only some of them. In this case, check the Prompt before replace box. A Confirm replace dialog will appear for each retrieved string where you can choose to Skip this string, i.e. leave it as it is, Replace it, Replace all strings within the search scope, or Close the dialog, i.e. cancel the process.
If you want to replace only the first occurrence of a search string, check the Replace once box instead.
For further explanation on replace features within Bluefish, see Section 4.5, “Find and Replace”.
Different file types can change the behaviour of Bluefish. File types are recognized by their extension, or by the beginning of the file's contents. The current document type is shown in the far right of the status bar. If the type of a file is not properly detected, you can change the type using the Section 6, “Customising Bluefish” to change these extensions.
→ menu. SeeSyntax highlighting is the coloring of words that have special meaning for a language. The patterns can vary: for example, "<title>" means "start of title" in HTML, "function" means "start of function" in PHP.
While editing, Bluefish will only update the highlighting patterns in the block of text around the cursor. The number of lines (the size) of this block can be adjusted in the preferences under Editor. The syntax highlighting for the total document can be refreshed using the → (F5) menu. It can be disabled in the preferences under Editor. For more information about adding or modifying syntax highlighting for existent or new languages, see here.
Assuming a working Internet connection, files can also be opened from the web using
→ . This feature depends on your gnome_vfs setup. If it is installed and working, http://, sftp://, smb:// and possibly more types of remote services should be supported by Bluefish. Depending on your gnome_vfs version, some of these protocols are not yet fully stable, which can crash Bluefish!Here you can see the style sheet of an Apache web site, nicely highlighted after its opening via the Bluefish
→ menu.There are many different standards for character encoding of text files. Most well known is the ASCII standard, which describes only 127 characters, and is supported by every text editor in the world. The most common standard nowadays is UTF-8, which describes thousands of characters, and is backwards compatible with ASCII.
Internally, Bluefish will always work with UTF-8. When opening a file, Bluefish has to detect the correct encoding for the file. For HTML files, the encoding should be present in a <meta name="encoding"> tag. Bluefish will always use this tag if it is available in the file. If this tag has an encoding that is not present in the Bluefish config file, this encoding is automatically added to the Bluefish config file.
The locale also defines a default encoding. If you are using a locale (a local setting, defining language, time format, currency format, number formatting etc.), Bluefish will try to load the file using the encoding defined in the locale.
Bluefish itself also has a setting for a default encoding. This is the next encoding Bluefish will try. This is also the encoding Bluefish will use for files created by Bluefish (UTF-8 by default).
If these steps fail, Bluefish will simply try every encoding defined in the Bluefish config file.
Filenames on disk can also contain non ASCII characters. All GNOME and GTK programs (including Bluefish) assume that filenames are in UTF-8 encoding. If you have filenames in the encoding of your locale on your disk, you have to set G_BROKEN_FILENAMES=1
in the environment to make GNOME and GTK programs detect this encoding.
For information about writing documents in 16-bits encoded languages, such as Japanese, see Section 3.9.3, “Input methods”.
You can open multiple files at once with the Shift-Ctrl-O) menu item from a directory based on their extension or their contents. The same functionality is available from the file browser in the side panel by right-clicking a directory. This feature is available only when the find and grep utilities are installed on your system.
→ (To open all files by extension, enter the extension in the dialog, and leave the search pattern empty. Check the recursive option if you want to include all subdirectories in the search. To open files by content, leave the extension at *, and enter a search pattern in the dialog. You can use regular expression patterns if you check the Is regex option.
You may also combine both methods. Here we open recursively all Chinese XML files in a given tree, whose contents contain the word packaging.