Modelines Plugin

The Modelines plugin allows you to set preferences for individual documents. A modeline is a line of text at the start or end of the document with settings that gedit recognises.

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

You can set the following preferences with modelines:

  • Tab width
  • Indent width
  • Insert spaces instead of tabs
  • Режим с пренасяне
  • Right margin width

The Modelines plugin supports a subset of the options used by other text editors Emacs, Kate and Vim.

10.8.1. Emacs Modelines

The first two lines of a document are scanned for Emacs modelines.

The Emacs options for tab-width, indent-offset, indent-tabs-mode and autowrap are supported. For more information, see the GNU Emacs Manual.

10.8.2. Kate Modelines

The first and last ten lines a document are scanned for Kate modelines.

The Kate options for tab-width, indent-width, space-indent, word-wrap and word-wrap-column are supported. For more information, see the Kate website.

10.8.3. Vim Modelines

The first and last three lines a document are scanned for Vim modelines.

The Vim options for et, expandtab, ts, tabstop, sw, shiftwidth, wrap, and textwidth are supported. For more information, see the Vim website.