Editing
From E
Contents |
Editing
Navigating the text
The most obvious ways to navigate the text is just by pointing and clicking with the mouse or moving the caret with the arrow keys. But there are quite a few other shortcuts that can speed it up:
<table>
<tr><td>Home </td><td> Move cursor to the beginning of the line </td></tr> <tr><td>End </td><td> Move cursor to the end of the line </td></tr> <tr><td>Ctrl+Home </td><td> Move cursor to the beginning of the document </td></tr> <tr><td>Ctrl+End </td><td> Move cursor to the end of the document </td></tr> <tr><td>Ctrl+Up/Down </td><td> Scroll up/down, without moving the caret </td></tr> <tr><td>Ctrl+G </td><td> Go to Line </td></tr>
</table>
Symbols
Symbols are points of interests in files, like class definitions, which you would want to easily jump to. If you are editing in a language for which there are symbols defined in the bundle, you can show the symbol pane by selecting the menu item 'Navigation/Go to Symbol' or pressing Ctrl-L. This will set focus to the symbol search field so you can navigate between symbols. Pressing Ctrl-L again will return focus to the editor (hold down shift when selecting a symbol to also close the pane).
Selecting
There are many ways to use the mouse to make selections:
<table>
<tr><td>Alt-Drag </td><td> Column selection </td></tr> <tr><td>Ctrl-Drag </td><td> Multi selection </td></tr> <tr><td>Double-Click </td><td> Select word </td></tr> <tr><td>Triple-Click </td><td> Select line </td></tr> <tr><td>Alt-Double-Click </td><td> Select scope </td></tr> <tr><td>Click Linenumber</td><td> Select line </td></tr> <tr><td>Click Fold-line</td><td> Select fold </td></tr>
</table>
By holding down the alt key while selecting, you can make rectangular (column) selections. If you make a block selection after the end of the lines, just the line endings will be selected, which is very useful when you want to extend some lines.
Often the fastest way to make a selection is with the keyboard, since you don't have to waste time reaching for the mouse. There are many keyboard shortcuts to make this easier. The most used is holding down the shift key while using the arrow keys. As a general rule you can hold down the shift key on any command that moves the cursor to select to the new position.
You can also hold down the alt key while using the arrow keys to make column selections.
<table>
<tr><td>Ctrl+A </td><td> Select all </td></tr> <tr><td>Ctrl+Shift+Left/Right </td><td> Select to start/end of word </td></tr> <tr><td>Shift+Home </td><td> Selects to the first non-whitespace char on the line, second time the white spaces will be selected as well </td></tr> <tr><td>Shift+Ctrl+Home </td><td> Selects to the beginning of the document </td></tr> <tr><td>Shift+Ctrl+End </td><td> Selects to the end of the document </td></tr> <tr><td>Shift+Ctrl+L </td><td> Selects current line </td></tr> <tr><td>Shift+Ctrl+W </td><td> Selects current word </td></tr> <tr><td>Shift+Ctrl+Space </td><td> Selects current scope. If you keep hitting it, it will cycle through the available scopes. </td></tr> <tr><td>Shift+F1 </td><td> Select current fold </td></tr>
</table>
Multi-edit mode
If you have made multiple selections (or column selections) and start editing, the editor will go into multi-editing mode. In this mode all changes you make are reflected in all selections. You can both insert and delete text and move around in the selected area. When you move the caret outside the selected areas, the editor reverts to normal mode.
Tabs
You can change the tab settings by clicking on the tab entry in the statusbar. This gives you a menu where you can set the width of the tab (in spaces), and whether you want hard or soft tabs (soft tabs means that it will insert the appropriate number of spaces when you press the tab key).
Using hard tabs (not using soft tabs) <b>and</b> setting the tab width to something other than 8 will mess up the display of your source files when other tools are used. Many tools (linux cat and ed, windows notepad, print and type) <i>simply assume</i> tab characters indent 8 spaces. This fails if your source file contains a mix of hard and soft tabs. So-called "soft tabs" may be inserted by simply using the space bar.
Shifting Text
To shift text left or right via the keyboard:
<table>
<tr><td>Tab (while text is selected)</td><td>Shift text right</td></tr> <tr><td>Shift+Tab (while text is selected)</td><td>Shift text left</td></tr>
</table>
Search and Replace
To start a search you either select the Edit/Find menuitem, or you use the keyboard shortcut Ctrl-F. This will show the Search & Replace bar in the bottom of the window, and you can immediately start entering text. The search happens real time while you type, so you can instantly see the result as the selected text in the main text area. If you enter text that can not be found in the document, the search field will be colored red.
You can enable Regular Expressions and/or case sensitivity by clicking on the search icon in front of the search field.
You can find the next match by clicking the "Next" button, pressing Enter or pressing ctrl-F again. You can find previous match by clicking the "Previous" button or pressing Shift-Enter. You close the search bar by clicking the close button or pressing Esc.
To replace the found text, you enter the new text in the replace field (you can press Ctrl-R to go the replace field). You can then either click the "Replace" button or press ctrl-R again to do the replacement. After each replace, it will automatically try to find the next match.
To replace all occurrences of the search text in the document, you press the "All" button.
Replacement syntax
When searching with regular expressions, you have the option to use part of the match in the replacement. You can insert the result of the entire match by writing $0, and any captures (counted by the containing parenthesizes) by writing $n, where n is the capture number. You can also change case and do conditional insertions, that decide what to insert based on whether a numbered capture matches.
- <table>
<tr><td colspan=2> Captures </td></tr> <tr><td> $n </td><td> reference capture </td></tr>
<tr><td colspan=2> Case foldings </td></tr> <tr><td> \u </td><td> uppercase next char </td></tr> <tr><td> \U </td><td> uppercase following </td></tr> <tr><td> \l </td><td> lowercase next char </td></tr> <tr><td> \L </td><td> lowercase following </td></tr> <tr><td> \E </td><td> end case foldings </td></tr>
<tr><td colspan=2> Conditional insertions </td></tr> <tr><td colspan=2> (?n:insertion) </td></tr> <tr><td colspan=2> (?n:insertion:otherwise) </td></tr>
- </table>
Completion
You can press Ctrl+Space to make e try to auto-complete the current word. By default e will show a list of options based on other similar words in the same document, but depending on the current syntax and scope, bundles may supply word lists or run commands to generate the options.
