Bluefish offers a wide range of find and replace methods in the Section 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 V.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.1, “Generating several bookmarks at once”.
You will find details on Find Again and Find from Selection in Section 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.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 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 5, “Find and Replace”.