(→Indenting New Lines) |
(→Indenting New Lines) |
||
| Line 43: | Line 43: | ||
#If no block is highlighted, they decrease or increase the left margin. If the cursor is at the beginning of a line, the line will be indented to the new left margin. | #If no block is highlighted, they decrease or increase the left margin. If the cursor is at the beginning of a line, the line will be indented to the new left margin. | ||
| − | ''If you notice that new lines are being indented and you don’t want | + | ''If you notice that new lines are being indented and you don’t want them to be, simply hold down <kbd>F7</kbd> for a bit. This will reset the left margin back to column 1.'' |
| − | them to be, simply hold down | + | |
| − | <F7> | + | vEdit has another mode of indentation called “Auto-indent”. It is primarily intended for editing structured programming languages such as “C”. In auto- indent mode, each new line will be indented the same amount as the previous text line. You can then change the indentation of the new line with <kbd>F7</kbd> and <kbd>F8</kbd>. The main advantage of auto-indent mode is that you can jump around in a program and newly entered instructions will automatically fit the indentation of the current block of instructions. Auto-indent is enabled with {CONFIG, Programming, Auto-indent mode}. It is typically enabled for selected file types (filename extensions) by using the “File-open configuration” feature. |
| − | for a bit. This will reset the left | + | |
| − | margin back to column 1.'' | + | |
You can easily change the indentation of an entire block of text or just new lines. This is especially useful when editing structured programming languages such as C and Pascal. VEDIT both follows the common Windows conventions for indenting and un-indenting blocks, and has additional functions for indenting blocks and lines.
By Windows conventions, when an entire line or more is highlighted, you can indent all lines in the block by pressing Tab , and un-indent all lines by pressing Shift-Tab or Backspace.
Assuming “Persistent blocks” are enabled, you must explicitly clear the block highlighting. There are many ways to do this:
Double-tap the Ctrl key, press Ctrl-\, right-click and select Clear markers, or select BLOCK > Clear markers ( Shift-F9) to clear the block highlighting.
Indenting/undenting with Tab and Shift-Tab assumes the “Normal” keyboard layout and that CONFIG > Emulation > [TAB CHARACTER] emulation mode is set to “2” or “3”. The default is “3”.
The amount of each indent/undent is typically 4 columns. It can be changed with CONFIG > Programming > indent increment.
The indentation is created by inserting spaces and, optionally, Tab characters. The optimum number of tabs and spaces will be used and depends upon the currently set tab stops. To create the indentation with only spaces, disable CONFIG > Tab/Fill > Expand Tab key with spaces.
You can indent new text by setting a left margin with F7 and F8. F8 increases the left margin, causing new text to be indented further. Similarly, F7 reduces the left margin. When a left margin is set, each new line is indented to the left margin. E.g. when you press Enter, vEdit inserts a Carriage-Return and Line-Feed, and the optimal number of Tabs characters and spaces to reach the left margin. The hot-keys <F7> and <F8> perform these functions:
If you notice that new lines are being indented and you don’t want them to be, simply hold down F7 for a bit. This will reset the left margin back to column 1.
vEdit has another mode of indentation called “Auto-indent”. It is primarily intended for editing structured programming languages such as “C”. In auto- indent mode, each new line will be indented the same amount as the previous text line. You can then change the indentation of the new line with F7 and F8. The main advantage of auto-indent mode is that you can jump around in a program and newly entered instructions will automatically fit the indentation of the current block of instructions. Auto-indent is enabled with {CONFIG, Programming, Auto-indent mode}. It is typically enabled for selected file types (filename extensions) by using the “File-open configuration” feature.