medit has some editing options which can be set in the file 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).
Values can be strings, integer numbers, or boolean values. Boolean values may be specified
using yes
/no
,
true
/false
, 1
/0
.
The following options are available:
lang
: syntax highlighting language to use in this document.
strip
: a boolean value, whether trailing whitespace should be removed
from the document on saving.
add-newline
: a boolean value, whether the editor should ensure that saved files
have a trailing new line character.
tab-width
: displayed width of the Tab character.[2]
use-tabs
: whether the Tab character should be used for indentation.
indent-width
: an integer specifying indentation offset used when the
Tab key is pressed to indent text.
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.