Buffer-Local Properties

The Buffer Options dialog box only changes settings for the duration of the editing session. It is also possible to change settings for all future editing sessions using buffer-local properties.

When jEdit loads a file, it checks the first 10 lines for colon-enclosed name/value pairs. The following example will set the tab size to 8 characters, enable soft tabs, and set the default edit mode of the file to Perl:

:noTabs=true:tabSize=8:mode=perl:

Buffer-local properties take effect the next time the file is opened. The following table lists all valid properties.

Table 9-1. Table of buffer-local properties

Property nameDescription
blockCommentThe block comment string. A block comment is one that extends to the end of the line. For example, in Java mode the default value is "//". See the section called Commenting Out Code in Chapter 6.
boxCommentThe box comment string. A box comment is one delimited by the wing comment strings, but with the box comment string also at the start of each line. For example, in Java mode the default value is "*". See the section called Commenting Out Code in Chapter 6.
commentEndThe wing comment end string. For example, in Java mode the default value is "*/". See the section called Commenting Out Code in Chapter 6.
commentStartThe wing comment start string. For example, in Java mode the default value is "/*". See the section called Commenting Out Code in Chapter 6.
doubleBracketIndent

If a line matches the indentPrevLine regular expression and the next line contains an opening bracket, a level of indent will not be added to the next line, unless this property is set to "true".

indentOnEnterIf set to "true", indentation will be performed when the Enter key is pressed. See the section called Tabbing and Indentation in Chapter 6.
indentOnTabIf set to "true", indentation will be performed when the Tab key is pressed. See the section called Tabbing and Indentation in Chapter 6.
indentCloseBracketsA list of characters (usually brackets) that subtract indent from the current line. For example, in Java mode the default value is "}".
indentOpenBracketsA list of characters (usually brackets) that add indent to the next line. For example, in Java mode the default value is "{".
indentPrevLineWhen indenting a line, jEdit checks if the previous line matches the regular expression stored in this property. If it does, a level of indent is added. For example, in Java mode this regular expression matches "if", "else", "while", etc.
modeThe default edit mode for the buffer. See Chapter 5.
noTabsIf set to "true", soft tabs (multiple space characters) will be used instead of "real" tabs. See the section called Tabbing and Indentation in Chapter 6.
noWordSepA list of non-alphanumeric characters that are not to be treated as word separators. For example, in Java mode the default value is "_" because the underscore can be used in Java identifiers, and it is useful to be able to select and complete them in one operation.
syntaxIf set to "true", syntax highlighting will be performed. See the section called Syntax Highlighting in Chapter 5.
tabSizeThe tab width. This must be an integer greater than 0. See the section called Tabbing and Indentation in Chapter 6.