medit has some editing options which can be set in the document text, or in the Preferences dialog for sets of files or for given syntax highlighting language.
To set the options in the document text, place the following on the first, second or the last line of the document:
-%- options
-%-
where options
is the option string
key
:value
;key
:value
; ...
(the latter is the format used also in the Preferences dialog).
For example, the following might be the first line in a C file:
/* -%- indent-width: 2; use-tabs: yes; strip: yes -%- */
Values can be strings, integers, or booleans.
Booleans are yes
, no
, true
, false
, 1
, 0
.
If a string value contains :
character, then the following syntax may be used:
. Any character may be used instead of slash (and it
must not occur in the key
=/value
/value
). Example: word-chars=@-/:@
The following options are available:
|
syntax highlighting language to use in this document. Special value |
|
a boolean value, whether trailing whitespace should be removed from the document on save. |
|
a boolean value, whether the editor should ensure that saved files have a trailing new line character. |
|
an integer specifying indentation offset used when the Tab key is pressed to indent text. |
|
displayed width of the tab character. Note that this is not the same as
|
|
whether tab character should be used for indentation. |
medit tries to understand modelines of Vim, Emacs, and Kate text editors, so chances are it will correctly pick up the conventional settings from source files.