The Editor menu lists commands for use with PowerGREP’s built-in file editor. See the Editor reference topic for more information on the file editor itself.
Start with a blank, untitled file.
Open a file in the file editor. You can quickly reopen a recently opened or saved results file by clicking the downward pointing arrow next to the Open button on the Results toolbar. Or, you can click the right-pointing arrow next to the Open item in the Results menu. A new menu listing the last 16 opened or saved files will appear. Select “Maintain List” to access the last 100 files.
Save the file you are editing in the file editor. The Save command only becomes enabled when you’ve modified the file.
Before saving, PowerGREP will create a backup copy of the file using the naming style you set in the Action & Results Preferences. The Undo History will keep track of the backup copy in a separate action.
Save the file you are editing under a new name. If you later save the file again, it will again be saved under the new name. The existing copy of the file under the old name will remain.
If a file with the new name already exists, PowerGREP will create a backup copy of the existing file using the naming style you set in the Action & Results Preferences. The Undo History will keep track of the backup copy in a separate action.
If you often open the same files, you should add them to your favorites for quick access. Before you can do so, you need to save the Editor to a file. PowerGREP’s window caption will then indicate the name of the Editor file. Click the downward pointing arrow next to the Favorites button on the Editor toolbar, or the right-pointing arrow next to the Editor item in the Editor menu. Then select “Add Current Editor” to add the current Editor file to the favorites. Pick a file from the menu to open it.
If you click the Favorites button or menu item directly, a window will pop up where you can organize your Editor favorites. If you have many favorites, you can organize them in folders for easier reference later.
By default, the Favorites button is not visible on the toolbar. To make it visible, use View|Lock Toolbars to unlock the toolbars if you haven’t already. Then click on the downward pointing arrow at the far right end of the File Selector toolbar. A menu will pop up where you can toggle the visibility of all toolbar buttons. When you’re done, you can lock the toolbars again to prevent accidental changes.
Print the file you are editing. A print preview will appear. The print preview allows you to configure the printer and page layout before printing. You can limit the printout to the selected part of the file, and/or to a particular range of pages.
Highlights the next search match in the file. If there are no further search matches after the cursor position, the cursor is moved to the end of the file.
Highlights the previous search match in the file. If there are no search matches before the cursor position, the cursor is moved to the start of the file.
Closes the file you are editing, prompting to save if needed, and then opens the next file with search results. The order of the files is determined by the “sort files” drop-down list on the Results panel.
Closes the file you are editing, prompting to save if needed, and then opens the previous file with search results. The order of the files is determined by the “sort files” drop-down list on the Results panel.
Replaces the search matches in the selected text or the search match that the text cursor is on with the replacement text that was prepared for each match while executing the last PowerGREP action. The color of the replaced matches changes to indicate they have been replaced.
You can only make replacements after previewing or executing a search-and-replace action, since PowerGREP needs to know which replacement text to use. Quick Replace does not allow you to replace individual matches, since Quick Replace discards information about individual matches.
Reverts the search matches in the selected text or the search match that the text cursor is on by replacing them with the original text that was matched while executing the last PowerGREP action. The color of the reverted matches changes to indicate they have been reverted.
You can only revert replacements after previewing or executing a search-and-replace action. Quick Replace does not allow you to revert individual replacements, since Quick Replace discards information about individual matches.
Replaces all the search matches in the file that you have open in the Editor with the replacement text that was prepared for each match while executing the last PowerGREP action. The color of the replaced matches changes to indicate they have been replaced.
Reverts all the search matches in the file that you have open in the Editor with the original text that was matched while executing the last PowerGREP action. The color of the reverted matches changes to indicate they have been reverted.
Folds the selected lines. The first line in the selection remains visible, while the others are hidden. They are “folded” underneath the first line. A square with a plus symbol in it appears to the left of the folded line.
If you did not select part of the text, and the text cursor is inside a foldable range indicated by a vertical line in the left margin, the Fold command folds that folding range.
While folded lines are invisible, they are still fully part of the file, and still take part in all editing actions. E.g. if you select a block that includes one or more folded sections and copy the block to the clipboard, all selected lines, including lines hidden by folding, are copied to the clipboard. Folding only affects the display.
In the editor preferences you can configure PowerGREP to add automatic folding points based on indentation and/or file navigation schemes. Automatic folding points appear as unfolded ranges that you can fold with the mouse or the Fold command.
The Unfold command only becomes enabled when you’ve placed the text cursor on the first (still visible) line of a folded section. It unfolds a section previously folded with the Fold command. Clicking the square with the plus symbol in it is another way of unfolding a folded section. The unfolded section remains marked as a folding point. A square with a minus marks the first line, with a vertical line extending down from it to mark the previously folded range. You can easily re-fold it by clicking the square with the minus.
If you’ve made a selection, then the Unfold command unfolds all folding points inside the selection.
Folds all folding ranges that you have previously unfolded or that were automatically added based on indentation and/or a file navigation scheme as configured in the editor preferences.
Unfolds all sections that you have folded with the Fold and Fold All commands.
Configure the text layout or select a previously configured text layout to change the font, text direction, cursor behavior, and spacing used by PowerGREP’s built-in editor. The Configure Text Layout topic in the reference section about PowerGREP’s Preferences screen has much more information on this.
Toggles word wrap on or off. When on, lines in the results that are too long to fit the width of the Results panel are wrapped across multiple lines. When off, you will need to use the horizontal scroll bar to see the remainder of long lines. Word wrap must be off to enable rectangular selections.
Toggles showing line numbers in the left margin on or off.
Turn on automatic indent if you want the next line to automatically start at the same column position as the previous line whenever you press Enter on the keyboard while in the editor. The editor will accomplish this by counting the number of spaces and tabs at the beginning of the previous line and inserting them at the beginning of the new line you created by pressing Enter. This is most useful when editing source code and other structured files.