Download jEdit 4.2 User Manual

Transcript
Editing Source Code
lines of the buffer, where n is the desired tab width, and m is the desired indent width:
:tabSize=n:indentSize=m:
Edit>Indent>Shift Indent Left (shortcut: S+TAB or A+LEFT) adds one level of indent to each selected
line, or the current line if there is no selection.
Edit>Indent>Shift Indent Right (shortcut: A+RIGHT) removes one level of indent from each selected
line, or the current line if there is no selection. Pressing Tab while a multi-line selection is active has the
same effect.
Edit>Indent>Remove Trailing Whitespace (shortcut: C+e r) removes all whitespace from the end of
each selected line, or the current line if there is no selection.
Soft Tabs
Files containing hard tab characters may look less than ideal if the default tab size is changed, so some
people prefer using multiple space characters instead of hard tabs to indent code.
This feature is known as soft tabs. Soft tabs can be enabled or disabled in one of several ways:
•
On a global or mode-specific basis in the Editing pane of the Utilities>Global Options dialog box.
See the section called “The Editing Pane”.
•
In the current buffer for the duration of the editing session in the Utilities>Buffer Options dialog
box. See the section called “The Buffer Options Dialog Box”.
•
In the current buffer for future editing sessions by placing the following in one of the first or last 10
lines of the buffer, where flag is either “true” or “false”:
:noTabs=flag:
Changing the soft tabs setting has no effect on existing tab characters; it only affects
subsequently-inserted tabs.
Edit>Indent>Spaces to Tabs converts soft tabs to hard tabs in the current selection, or the entire buffer
if nothing is selected.
Edit>Indent>Tabs to Spaces converts hard tabs to soft tabs in the current selection, or the entire buffer
if nothing is selected.
Automatic Indent
The auto indent feature inserts the appropriate number of tabs or spaces at the beginning of a line by
looking at program structure.
In the default configuration, pressing ENTER will create a new line with the appropriate amount of
indent automatically, and pressing TAB at the beginning of, or inside the leading whitespace of a line
will insert the appropriate amount of indentation. Pressing it again will insert a tab character.
The behavior of the ENTER and TAB keys can be configured in the Shortcuts pane of the
Utilities>Global Options dialog. box, just as with any other key. The ENTER key can be bound to one
of the following, or indeed any other command or macro:
32