There are a number of ways to search for text in Komodo:
To replace text, use the Find dialog with the Replace option enabled.
Additional features are available for:
When performing a search on the current buffer, all matching text strings will be highlighted. Press 'Esc' to clear the highlighting.
To guard against performance problems caused by slow searches, Komodo will stop highlighting matches after the timeout configured in the Find preferences.
Use the Fast Find bar to quickly find a word or string in the file you are currently editing.
The Find dialog box is a multi-purpose interface for finding and replacing text. It has the following options:
The interface changes as different options are selected, so that you only see fields and buttons that are relevant to your task.
To the right of the "Find what:" field are two buttons which can help you compose your regular expression:
The Smart case / Match case option is a three-way toggle:
Smart case (selected): Search strings containing capital letters are automatically case sensitive. When doing "Smart case" replacements, the case of the replaced strings will follow the case of the matched text if the following conditions hold:
For example, a smart-case replacement of "cat" to "dog" in the text would work like the following:
|cool cat fat CAT Top Cat||→||cool dog fat DOG Top Dog|
For those writing macros, you would set
With Word selected, search strings will only match if a whitespace occurs on either side of the string. For example, if the search string is "edit" and "Word" is selected, only occurrences of the word "edit" will be found. If it is not selected, "editing", "editor", "editorial" and "edited" could also be found.
Selecting Multiline changes the "Find what:" field (and the "Replace with:" field if Replace is selected) with larger, multiline text boxes.
This makes it easier to paste in multiline blocks of text in these fields. The search text will only match if the line breaks are the same. Line breaks in the "Replace with:" field are likewise respected.
The "Search in:" drop list defines where the find or replace will happen. It contains the following options:
Selecting Files from this list opens additional fields allowing you to set the scope of your search in directories on your filesystem:
See also the Replace in Files section for a description of the Confirm and Undo options.
Once all the options for the Find or Replace are set, choose the action you wish to perform. The action buttons available will depend on which options have been selected:
On Windows and Linux, keyboard shortcuts for the Find dialog are indicated by an underlined letter in the option, field and button labels. Hold down 'Alt' and press the underlined letter to toggle the option, jump to the field, or start the operation.
On Mac OS X, these keyboard shortcuts are accessed by holding down the 'Ctrl' key, but are not indicated in the interface. They are:
Globally replacing strings in multiple files can be daunting. Using a search string that matches more than what was intended, specifying an incorrect replacement string, or selecting the wrong starting directory for a recursive replacement can cause havoc.
Komodo's Replace in Files feature has a Confirm option which lets you check the substitutions before you apply them, and an Undo feature to revert the replacement if you make a mistake.
When "Search in: Files" is selected, the only action button available is Replace All. Beneath this button is a Confirm check box. This option adds an additional step to the replacement process which allows you to view changes before applying them, and "un-mark" specific changes you don't want to apply.
The Confirm Replacements dialog box shows a list of all pending replacements from the Replace in Files operation. Each line shows:
Show Selected Changes previews all selected changes in the list. Use 'Shift'+'Click' or 'Ctrl'+'Click' to select multiple items.
Show Marked Changes previews all marked changes.
The preview window has the same format and options as Compare Files. The preview is in unified diff format, so it can be copied and saved as a patch.
Once you have confirmed that all pending replacements are correct, or un-marked the changes you do not want to include, click Make Changes.
As Komodo makes the replacements, it outputs a log of the changes in a Find Results tab in the bottom pane. You can click on any of the changes to open the file in an editor tab at the appropriate line.
If you've made a mistake and would like to roll back all of the changes from the last Replace in Files operation, click the Undo Replacements button in the Find Results tab toolbar.
Find Results tabs are opened in the Bottom Pane to display matches from Find All, Find in Files or Replace in Files operations.
Komodo can open two tabs, Find Results 1 and Find Results 2, which can be locked using the Lock button in their respective toolbars. New find or replace operations will not overwrite contents in a locked tab.
Komodo uses the first available tab for output. If both tabs are locked during subsequent find or replace operations, Komodo prompts you to unlock one of the tabs or cancel the action.
The Find Results tabs display columns for:
Double-click on any output line to jump to the relevant file and line in an editor tab.
The Find Results toolbar has buttons to:
The Open/Find toolbar provides a quick way to open files and find strings. The toolbar is not displayed by default; to open it select View|Toolbars|Open/Find.
This toolbar has three fields:
The Find and in fields both keep a list of the most recently entered strings and file specifications.
If a file or directory is specified in the in field, matches will be displayed in a Find Results tab.
Press 'Esc' to return focus to the Komodo editor. All fields can be accessed via their associated key bindings.
The Function Search looks through the current document for the following constructs:
Use Navigation|Find Next Function or Navigation|Find Previous Function (or the associated key bindings) to cycle through the functions.
Use Navigation|Find All Functions to display a list of all functions in a Find Results tab. Double-click on any entry to jump to the relevant line.
Komodo IDE has a more powerful feature with the same default keybinding ('Ctrl'+'F8') called the Sections List.
© 2017 ActiveState Software Inc. All rights reserved. ActiveState®,
Komodo®, ActivePerl®, ActivePython®, and ActiveTcl® are registered
trademarks of ActiveState.
All other marks are property of their respective owners.