<info> <desc>Emacs, Kate and Vim-style modelines support for gedit.</desc> </info>

The <app>Modelines</app> plugin allows <app>gedit</app> to analyze the lines of text at the start and end of a file, and then apply a set of document preferences to the file. The <app>Modelines</app> plugin supports a subset of the options used by the <app>Emacs</app>, <app>Kate</app> and <app>Vim</app> text editors.

To enable the <app>Modelines</app> plugin, select <guiseq>gedit Preferences<gui>Plugins<gui>Modelines</guiseq>.

General Modeline Options

The following options can be set using <app>gedit</app> modelines:

<list> <item>

Tab width

</item> <item>

Indent width

</item> <item>

Inserting spaces instead of tabs

</item> <item>

Text Wrapping

</item> <item>

Right margin width

</item> </list>

<note>

Preferences set using modelines take precedence over the ones specified in the preference dialog.

</note>
Emacs Modelines

The first two lines of a document are scanned for <app>Emacs</app> modelines, and <app>gedit</app> supports the following <app>Emacs</app> modeline options:

<list> <item>

Tab-width

</item> <item>

Indent-offset

</item> <item>

Indent-tabs-mode

</item> <item>

Text auto-wrap

</item> </list>

For more information on <app>Emacs</app> modelines, visit the GNU Emacs Manual.

Kate Modelines

The first and last ten lines a document are scanned for <app>Kate</app> modelines, and <app>gedit</app> supports the following <app>Kate</app> modeline options:

<list> <item>

tab-width

</item> <item>

indent-width

</item> <item>

space-indent

</item> <item>

word-wrap

</item> <item>

word-wrap-column

</item> </list>

For more information about <app>Kate</app> modelines, visit the Kate website.

Vim Modelines

The first and last three lines a document are scanned for <app>Vim</app> modelines, and <app>gedit</app> supports the following <app>Vim</app> modeline options:

<list> <item>

et (expandtab)

</item> <item>

ts (tabstop)

</item> <item>

sw (shiftwidth)

</item> <item>

wrap

</item> <item>

textwidth

</item> </list>

For more information on <app>Vim</app> modelines, visit the Vim website.