ISESteroids adds a secondary toolbar with many new settings. To display the toolbar, click the new arrow button in the original toolbar:
On the left side of the secondary toolbar you find these 12 new features:
- Align Braces (right-click for indentation settings like size and type)
- Current Line Highlight (including Advanced AST Highlight)
- Modification Bar
- Vertical Guides
- Real-Time Auto-Indentation
- Display (Visible) Whitespace
- Line Breaks for lines that exceed the current editor width
- Duplicate Selection or Line
- Move Line Up and Down
- Collapsible Regions: Toggle First/Second Level, Current Caret, Comments
- Comment/Uncomment Current Selection
On the right side of the toolbar, you find these 12 additional features:
- Open Snippet Editor
- Open Profile Script (Autostart Script). Creates profile script if it does not exist. Right-click to access other profile scripts.
- Insert/View Bookmarks
- Toggle LiteralView. Right-click to change fonts and sizes.
- Print current document
- Save current document to XPS
- Show Stopwatch Bar (for presentations and trainings)
- Show Help for selected code element
- Open Settings. Slides in a settings toolbar.
- Personalize User Interface
- Restart ISE. Saves your complete work environment, restarts ISE, then restores your saved environment (including any Untitled files and unsaved data). Hold CTRL to freeze environment and skip restart. Useful to continue in a fresh ISE, i.e. for testing purposes, or to release resources.
- Toggles ScriptMap.
Hover over a toolbar button to open a tooltip with quick infos and helpful hints like keyboard shortcuts. Below, some of the features are discussed in more detail. Other features are described in more details in other sections (follow their respective link in the description above).
Adjusting Indentation Size and Type and Visible Whitespace
The first button (1) in the secondary toolbar auto-indents code (align braces). Aligning braces makes code much more readable.
This button is enabled only when there is text in your editor.
- Click it to auto-indent code. Code that was manually indented will not be touched.
- Hold CTRL and click it to completely auto-indent your code.
When you right-click the button and choose “Indentation Settings”, you control width and type of indentations.
You can change the tab indent size, and the indentation type (space or tab). Click OK when you are done.
To see changes for existing code, click the toolbar button (ISESteroids recalculats indentation based on your new settings). The settings also apply immediately to new text.
You can better view the changes when you allow ISESteroids to visibly show whitespace (button 6). ISESteroids inserts different glyphs for spaces and for tabs:
Advanced AST Current Line Highlighting
A group of three buttons (marked (2) in the toolbar overview) controls current line highlighting. You can fall back to ISE default (no highlighting), display a textmarker highlighting, or turn on advanced AST-based highlighting.
Advanced AST Highlighting adds various adornments that help you understand the context of the currently selected item. For example, if your caret is inside a pipeline statement, a scriptblock, or another structure like a condition, ISESteroids draws a thin line around the entire structure.
This helps you better understand where a structure starts and ends, even if it spans multiple pages. When you scroll up or down, the line tells you exactly the start and end of it.
When you turn on the modification bar (button marked #3), ISESteroids paints a vertical color line. It indicates parts of your script that were modified since last save (orange color), and modifications that were saved since you initially opened or started the document (green color). This helps to find last edits in large documents.
Right-click the button and choose “Clear Trackings” to clear the colors.
When you click this button (#4), a context menu opens and lets you control three types of vertical guides:
Choose the type of guide to insert in the context menu. The result looks similar to this:
- Temporary Guide: enabled when the caret is positioned anywhere in your code. Inserts a temporary vertical guide that applies only to the current document. When your caret is located to the right of a temporary guide, and you press ENTER, then the caret will be placed on the temporary guide in the next line. Useful to keep custom indentations.
- Global Guide: opens a dialog and asks for a column number, for example 80. Places a red vertical guide into that column. This guide is global, applies to all documents, and persists. Useful to mark a recommended line width, so you get a clue when a code line exceeds a given length.
- Indentation Guides: draws vertical guides for the indents (the columns the caret is placed on when you press TAB)
In addition, the context menu lets you control the indentation size and type, as well as the colors used for the vertical guides:
- Indentation Settings: opens the dialog to control indentation size and type.
- Themes: lets you choose custom colors for the three guide types.
Advanced Outlining Toggle
When your code contains collapsible regions, press CTRL+M to toggle collapse state for all collapsible elements. Or use the buttons from button group #11 to toggle collapsing for just certain collapsible regions. Here is the description for all buttons in this group from left to right:
- Toggle collapsing for all
- Toggle only first level: Useful to get a high level structural overview
- Toggle only second level: Useful to get a high level structural overview
- Toggle collapsible element that has the caret in it
- Toggle collapsible comments only: Useful to temporarily collapse comments only