Editing in CodeMix
The CodeMix Editor has a number of features that improve the coding experience, including formatting and code folding. You can set preferences for these features, along with IntelliSense and Navigation, for a workflow that best meets your needs. Another useful feature in each CodeMix editor is a context bar with a control panel that allows you to quickly access key functionality.
The CodeMix plugin is compatible with Eclipse-based IDEs and tools—like MyEclipse, Spring Tools Suite, and JBoss Tools—so you can continue working in the environment you are accustomed to.
Setting Editor Preferences
You can customize your experience in CodeMix editors by setting preferences. Most of these preferences are accessed from Window>Preferences>CodeMix>Editors.
Note: Some settings use Eclipse preferences. To select Displayed tab width and Insert space for tabs settings, go to General>Editors>Text Editors. To select auto save settings, go to General>Editors>Autosave.
Using the Context Bar and Control Panel in the Editor
CodeMix includes a context bar in the editor for quick access to key features. To access a feature, click the icon on the context bar. If you do not see an icon for the action, click the control panel drop-down arrow to view the control panel. The control panel defaults to commonly used actions; however, you can click See All Actions to view other available actions. Click a link from the control panel to immediately launch the feature.
Customizing the Context Bar
To customize the icons that appear on the context bar, click the control panel drop-down arrow and then click the See All Actions link. Each action that can be included on the context bar has a star to the right of the action. If the star is gold, the action is included on the context bar. Click the star to toggle your preference.
Customizing the Control Panel
To customize which items are visible on the primary drop-down, click the control panel drop-down arrow and then click the See All Actions link. The items on the left display on the primary drop-down. Drag the items to the appropriate column to customize the control panel to your liking. Or, click the Reset defaults link to return to the default layout.
Formatting Code
A formatter allows you to quickly format code to keep it consistent and easy to read. CodeMix includes built-in formatting for a number of file types, with the option to to install formatting extensions for greater control of formatting settings. Refer to Formatting in CodeMix for more information.
Code Folding
Code folding allows you to collapse and expand sections of code in the editor, making it easier to work with large files and focus on relevant code.
Setting the Code Folding Preference
Code folding is enabled by default. To change this preference, go to Preferences>CodeMix> Editors>Folding.
Using Code Folding
A minus icon to the left of the code indicates the start of a section that can be collapsed. Click the icon to hide the block of code. The first line in the block of code remains visible with a plus icon. Click the plus icon to expand the block of code.
Tip: Hover the plus icon to preview collapsed code.
You can also use the following shortcuts with the numeric keypad:
- Collapse All—
Ctrl+Shift+/
- Expand All—
Ctrl+Shift+*
- Collapse current—
Ctrl+-
(Ctrl key plus the minus key) - Expand Current—
Ctrl++
(Ctrl key plus the plus key)