Buffer-local properties provide an alternate way to change editor settings on a per-buffer basis. While changes made in the
dialog box are lost after the buffer is closed, buffer-local properties take effect each time the file is opened, because they are embedded in the file itself.When jEdit loads a file, it checks the first and last 10 lines for colon-enclosed name/value pairs. For example, placing the following in a buffer changes the indent width to 4 characters, enables soft tabs, and activates the Perl edit mode:
:indentSize=4:noTabs=true:mode=perl:
Adding buffer-local properties to a buffer takes effect after the the buffer is saved and loaded again.
The following table describes each buffer-local property in detail.
Property name | Description |
---|---|
collapseFolds | Folds with a level of this or higher will be collapsed when the buffer is opened. If set to zero, all folds will be expanded initially. See Section 7.6, “Folding”. |
deepIndent | When set to “true”, multiple-line
expressions delimited by parentheses are aligned like
so: retVal.x = (int)(horizontalOffset + Chunk.offsetToX(info.chunks, offset));With this setting disabled, the text would look like so: retVal.x = (int)(horizontalOffset + Chunk.offsetToX(info.chunks, offset)); |
folding | The fold mode; one of “none”, “indent”, “explicit”, or the name of a plugin folding mode. See Section 7.6, “Folding”. |
indentSize | The width, in characters, of one indent. Must be an integer greater than 0. See Section 7.2, “Tabbing and Indentation”. |
maxLineLen | The maximum line length and wrap column position. Inserting text beyond this column will automatically insert a line break at the appropriate position. See Section 6.4, “Inserting and Deleting Text”. |
mode | The default edit mode for the buffer. See Section 7.1, “Edit Modes”. |
noTabs | If set to “true”, soft tabs (multiple space characters) will be used instead of “real” tabs. See Section 7.2, “Tabbing and Indentation”. |
noWordSep | A list of non-alphanumeric characters that are not to be treated as word separators. Global default is “_”. |
tabSize | The tab width. Must be an integer greater than 0. See Section 7.2, “Tabbing and Indentation”. |
wordBreakChars | Characters, in addition to spaces and tabs, at which lines may be split when the word wrap mode is set to “hard”. See Section 6.9, “Wrapping Long Lines”. |
wrap | The word wrap mode; one of “none”, “soft”, or “hard”. See Section 6.9, “Wrapping Long Lines”. |
autoIndent | The automatic indentation scheme; one of “none”, “full”, or “simple”. See Section 7.2.3, “Automatic Indent”. |
You may see :encoding=XXX:
in a file
as it is a buffer-local property and specifying the character encoding
for the file. But it is not really a buffer-local property, and behaves
differently.
It is detected by buffer-local-property
detector
only if the detector is selected in encoding options. Thus, it works
only at loading, and it must appear near the top of the file.
See Section 5.5, “Character Encodings”.