<chapter id="config-dialog">
<title>Configure &kappname;</title>
<para>
Selecting <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure
<replaceable>Application</replaceable>...</guimenuitem></menuchoice> from the menu brings up the
<guilabel>Configure</guilabel> dialog box.  This dialog can be
used to alter a number of different settings.  The settings available
for change vary according to which category the user chooses from a
vertical list on the left side of the dialog.  By means of three buttons
along the bottom of the box the user can control the process.
</para>

<para>
You may invoke the <guilabel>Help</guilabel> system, accept the
current settings and close the dialog by means of the
<guibutton>OK</guibutton> button, or <guibutton>Cancel</guibutton> the
process. The categories <guilabel>Appearance</guilabel>,
<guilabel>Fonts &amp; Colors</guilabel>, <guilabel>Editing</guilabel>,
<guilabel>Open/Save</guilabel> and
<guilabel>Extensions</guilabel> are detailed below.
</para>

<sect1 id="config-dialog-editor">
<title>The Editor Component Configuration</title>
<para>This group contains all pages related to the editor component of
&kappname;. Most of the settings here are defaults, they can be overridden by
<link linkend="pref-open-save-modes-filetypes">defining a filetype</link>,
by <link linkend="config-variables">Document Variables</link> or
by changing them per document during an editing session.</para>
<sect2 id="appearance">
<title>Appearance</title>

<sect3 id="appearance-general">
<title>General</title>

<variablelist>
<varlistentry>
<term><guilabel>Editor font</guilabel></term>
<listitem>
<para>
Here you can choose the font of the editor text.  You can choose from
any font available on your system, and set a default size. A sample text
is displayed at the bottom of the dialog, so you can see the effect of your choices.
</para>
<para>For more information about selecting a font, see the
<ulink url="help:/fundamentals/fonts.html"><emphasis>Choosing Fonts</emphasis>
section of the <emphasis>&kde; Fundamentals</emphasis> documentation</ulink>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Show whitespace indicators</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Never</guilabel></term>
<listitem><para>The editor will never display dots to indicate the presence of whitespace.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>At the end of a line</guilabel></term>
<listitem><para>The editor will display dots to indicate the presence of extra
whitespace at the end of lines.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Always</guilabel></term>
<listitem><para>The editor will always display dots to indicate the presence of whitespace.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Whitespace indicator size</guilabel></term>
<listitem><para>Use the slider to change the size of the visible indicator marker.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show tab indicators</guilabel></term>
<listitem><para>When checked the editor will display a &raquo; symbol to indicate the presence
  of a tab in the text.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Bracket matching
</guilabel></term>
<listitem><para>
<variablelist>
<varlistentry>
<term><guilabel>Highlight range between selected brackets
</guilabel></term>
<listitem><para>If this is enabled, the range between the selected matching brackets will be highlighted.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show preview of matching open bracket
</guilabel></term>
<listitem><para>When enabled, the editor will show a tooltip of the matching open bracket.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Flash matching bracket when cursor moves to other bracket in pair
</guilabel></term>
<listitem><para>If enabled, moving on the brackets (<keycap>{</keycap>, <keycap>[</keycap>,  
<keycap>]</keycap>, <keycap>}</keycap>,<keycap>(</keycap> or <keycap>)</keycap>) will
quickly flash the matching bracket.</para></listitem>
</varlistentry>
</variablelist>
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Show indentation lines
</guilabel></term>
<listitem><para>If this is checked, the editor will display
vertical lines to help identifying indent lines.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Counts
</guilabel></term>
<listitem><para>
<variablelist>
<varlistentry>
<term><guilabel>Show word count
</guilabel></term>
<listitem><para>Displays the number of words and characters in the document and
in the current selection in the status bar.
This option is also available in the status bar context menu.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show line count
</guilabel></term>
<listitem><para>Displays the number of total lines in the document in the status bar.
This option is also available in the status bar context menu.</para></listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Fold first line
</guilabel></term>
<listitem><para>If enabled, the first line is folded, if possible. This is useful, 
if the file starts with a comment, such as a copyright</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Dynamic Word Wrap</guilabel></term>
<listitem>
<para>If this option is checked, the text lines
will be wrapped at the view border on the screen.</para>
<para>
<variablelist>
<varlistentry>
<term><guilabel>Wrap dynamically at static word wrap marker
</guilabel></term>
<listitem><para>When checked, editor wraps lines dynamically at the <link linkend="pref-word-wrap">static word wrap position</link>.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Disregard word boundaries for dynamic wrapping
</guilabel></term>
<listitem><para>When checked, the editor does not take into account word boundaries when wrapping text lines.</para></listitem>
</varlistentry>
</variablelist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Dynamic word wrap indicators</guilabel></term>
<listitem><para>Choose when the Dynamic word wrap indicators
should be displayed, either <guilabel>Off</guilabel>, <guilabel>Follow Line
Numbers</guilabel> or <guilabel>Always on</guilabel>.
</para></listitem></varlistentry>
<varlistentry>
<term><guilabel>Indent wrapped lines
</guilabel></term>
<listitem><para>Additionally, this allows you to
set a maximum width of the screen, as a percentage,
after which dynamically wrapped lines will no longer be vertically aligned.
For example, at 50%, lines whose indentation levels are deeper than 50% of the
width of the screen will not have vertical alignment applied to subsequent
wrapped lines.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Line Height Multiplier
</guilabel></term>
<listitem><para>This value will be multiplied by the font's default line height. A value 
of 1.0 means that the default height will be used.</para></listitem></varlistentry>
</variablelist>
</sect3>

<sect3 id="appearance-borders">
<title>Borders</title>

<variablelist>
<varlistentry>
<term><guilabel>Code block folding</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Show arrows to collapse code blocks
</guilabel></term>
<listitem><para>If this option is checked, the current view will display marks
for code folding, if code folding is available.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show preview of folded blocks on hover
</guilabel></term>
<listitem><para>If checked, hovering over a folded region shows a preview of the folded text
in a popup.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Folding arrows visibility</guilabel></term>
<listitem><para>Switch the folding arrows between <guimenuitem>Show on Hover</guimenuitem>
and <guimenuitem>Show Always</guimenuitem>.
</para></listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Left side</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Show marks
</guilabel></term>
<listitem><para>If this is checked, you will see an icon border on the left
hand side. The icon border shows bookmark signs for instance.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show line numbers
</guilabel></term>
<listitem><para>If this is checked, you will see line numbers on the left
hand side.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Highlight changed and unsaved lines
</guilabel></term>
<listitem><para>If this is checked, line modification markers will be visible.
For more information, see <xref linkend="kate-part-line-modification"/>.
</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Scrollbars</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Show marks
</guilabel></term>
<listitem><para>If this option is checked the current view
will show marks on the vertical scrollbar. These marks will
for instance show bookmarks.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show preview when hovering over scrollbar</guilabel></term>
<listitem><para>If this option is checked, and you hover the scrollbar with the mouse cursor
a small text preview with several lines of the current document around the cursor position will be displayed.
This allows you to quickly switch to another part of the document.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Minimap</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Show minimap</guilabel></term>
<listitem><para>If this option is checked, every new view will show a minimap of the 
document on the vertical scrollbar.</para>
<para>For more information on the scrollbar minimap, see
<xref linkend="kate-part-scrollbar-minimap"/>.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Minimap Width</guilabel></term>
<listitem><para>Adjusts the width of the scrollbar mini-map, defined in pixels.
</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Scrollbars visibility</guilabel></term>
<listitem><para>Switch the scrollbar on, off or show the scrollbar only when needed.
Click with the &LMB; on the blue rectangle to display the line number range of the document displayed on the screen.
Keep the &LMB; pressed outside the blue rectangle to automatically scroll through the document.
</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

<variablelist>
<varlistentry>
<term><guilabel>Sort bookmarks menu</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>By date created
</guilabel></term>
<listitem><para>Each new bookmark will be added to the bottom,
independently from where it is placed in the document.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>By line number
</guilabel></term>
<listitem><para>The bookmarks will be ordered by the line
numbers they are placed at.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>

</sect3>
</sect2>

<sect2 id="prefcolors">
<title>Color Themes</title>

<para>This section of the dialog lets you configure all colors in
any color theme you have, and create new themes, delete existing
ones or just <guilabel>Follow System Color Scheme</guilabel>.
Each scheme has settings for colors and normal and highlighted text
styles.
</para>

<para>&kappname; will preselect the currently active theme for you, if you want to
work on a different theme start by selecting that from the
<guilabel>Select theme</guilabel> combobox. With the <guibutton>Copy</guibutton> and <guibutton>Delete</guibutton>
 buttons you can create a new theme (copying an existing one) or delete existing ones.</para>

<para>This is described in detail in <xref linkend="color-themes-gui"/>.</para>

</sect2>

<sect2 id="pref-edit">
<title>Editing</title>

<sect3 id="pref-edit-general">
<title>General</title>
<variablelist>

<varlistentry>
<term id="pref-word-wrap"><guilabel>Word wrap</guilabel></term>
<listitem><para>
Word wrap is a feature that causes the editor to automatically start a new line
of text and move (wrap) the cursor to the beginning of that new line.  &kappname;
will automatically start a new line of text when  the current line reaches the
length specified by the <link linkend="pref-wrap-words-at">Wrap words
at:</link> option.</para>
<variablelist>
<varlistentry>
<term><guilabel>Wrap words at a fixed column</guilabel></term>
<listitem>
<para>Turns static word wrap on or off.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Draw vertical line at the word wrap column</guilabel></term>
<listitem>
<para>If this option is checked, a vertical line will be drawn at the word wrap
column as defined in the <menuchoice> <guimenu>Settings</guimenu>
<guimenuitem>Configure Editor...</guimenuitem></menuchoice> in the Editing tab.
Please note that the word wrap marker is only drawn if you use a fixed pitch
font.</para>
</listitem>
</varlistentry>
<varlistentry>
<term id="pref-wrap-words-at"><guilabel>Wrap words at:</guilabel></term>
<listitem>
<para>If the <link linkend="pref-word-wrap">Wrap words at a fixed column</link> option is selected
this entry  determines the length (in characters) at which the editor will
automatically start a new line.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Default input mode</guilabel></term> <listitem><para>
The selected input mode will be enabled when opening a new view.
You can still toggle the vi input mode on/off for a particular view in the
<guimenu>Edit</guimenu> menu.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Brackets</guilabel></term> <listitem>
<para>If the <guilabel>Automatically close brackets when opening bracket is typed</guilabel> option is selected when
the user types a left bracket (<keycap>[</keycap>, <keycap>(</keycap>, or <keycap>{</keycap>)
&kappname; automatically enters the right bracket (<keycap>}</keycap>, <keycap>)</keycap>, 
or <keycap>]</keycap>) to the right of the cursor.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Enclosing characters</guilabel></term> <listitem>
<para>It is possible to select the enclosing characters using the corresponding drop-down list.</para>
<para>When text is selected, typing one of these characters wraps the selected text.</para>
</listitem>
</varlistentry>

<varlistentry>
<term ><guilabel>Copy and paste</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Move selected text when dragged</guilabel></term> <listitem>
<para>This option enables drag-and-drop of the selected text inside the editor window.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Copy/cut the current line if invoked without any text selected</guilabel></term> <listitem>
<para>If this option is enabled and the text selection is empty, copy and cut
action are performed for the line of text at the actual cursor position.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Don't move the text cursor when pasting by mouse</guilabel></term> <listitem>
<para>If this option is enabled and you paste some text in the editor window with the &MMB; clicking, &kappname;
will not move the text cursor into the clicked position.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="pref-edit-cursor-selection">
<title>Text Navigation</title>

<variablelist>

<varlistentry>
<term><guilabel>Text Cursor Movement</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Smart home and smart end</guilabel></term>
<listitem>
<para>When selected, pressing the home key will cause the cursor to
skip white space and go to the start of a line's text.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>PageUp/PageDown moves cursor</guilabel></term>
<listitem>
<para>This option changes the behavior of the cursor when the user presses
the &PgUp; or &PgDn; key. If unselected the text cursor will maintain its
relative position within the visible text in &kappname; as new text becomes
visible as a result of the operation.  So if the
cursor is in the middle of the visible text when the operation occurs it will
remain there (except when one reaches the beginning or end.)  With this option
selected, the first key press will cause the cursor to move to either the top or
bottom of the visible text as a new page of text is displayed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Enable camel case cursor movement</guilabel></term>
<listitem>
<para>This option changes the behavior of the cursor when the user presses
the <keycombo>&Ctrl;<keycap>Left arrow</keycap></keycombo> or
<keycombo>&Ctrl;<keycap>Right arrow</keycap></keycombo> shortcut. If unselected
the text cursor jumps over the full words. With this option
selected, the cursor jumps break at camel case humps.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Autocenter cursor:</guilabel></term>
<listitem>
<para>Sets the number of lines to maintain visible above and below the cursor
when possible.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Text Selection Mode</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Normal</guilabel></term>
<listitem>
<para>Selections will be overwritten by typed text and will be lost on
cursor movement.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Persistent</guilabel></term>
<listitem>
<para>Selections will stay even after cursor movement and typing.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Allow scrolling past the end of the document</guilabel></term> <listitem>
<para>This option lets you scroll past the end of the document. This can be used to vertically centre the bottom of the document, or put it on top of the current view.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Backspace key removes character’s base with its diacritics</guilabel></term> <listitem>
<para>When selected, composed characters are removed with their diacritics instead
of only removing the base character. This is useful for Indic locales.</para></listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

<varlistentry id="multicursor-modifier-configure">
<term><guilabel>Multicursor modifier</guilabel></term>
<listitem>
<para>This option lets you set the modifier that will be used to create multiple cursors with &LMB; click. You need to press the modifiers and click &LMB; to create a cursor at the desired location. See <link linkend="kate-part-create-multiple-cursors">Creating multiple cursors</link> to discover other ways to create multiple cursors.</para>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="pref-edit-indent">
<title>Indentation</title>

<variablelist>

<varlistentry>
<term><guilabel>Default indentation mode:</guilabel></term>
<listitem>
<para>Select the automatic indentation mode you want to use as default. It is
strongly recommended to use <userinput>None</userinput> or
<userinput>Normal</userinput> here, and use filetype configurations to set other
indentation modes for text formats like C/C++ code or &XML;.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Indent using</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Tabulators</guilabel></term>
<listitem>
<para>When this is enabled the editor will insert tabulator characters when you
press the &Tab; key or use <link linkend="kate-part-autoindent">automatic
indentation</link>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Spaces</guilabel></term>
<listitem>
<para>When this is enabled the editor will insert a calculated number of spaces
according to the position in the text and the <option>tab-width</option> setting
when you press the &Tab; key or use <link linkend="kate-part-autoindent">automatic
indentation</link>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Tabulators and Spaces</guilabel></term>
<listitem>
<para>When this is enabled, the editor will insert spaces as describe above when
indenting or pressing &Tab; at the beginning of a line, but insert tabulators when
the &Tab; key is pressed in the middle or end of a line.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Tab width:</guilabel></term>
<listitem>
<para>This configures the number of spaces that are displayed in place of a tabulator
character.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Indentation width:</guilabel></term>
<listitem>
<para>The indentation width is the number of spaces which is used to indent a line.
If configured to indent using tabulators, a tabulator character is inserted
if the indentation is divisible by the tab width.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Indentation Properties</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Keep extra spaces</guilabel></term>
<listitem><para>If this option is disabled, changing the indentation
level aligns a line to a multiple of the width specified in
<guilabel>Indentation width</guilabel>.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Adjust indentation of text pasted from the clipboard</guilabel></term>
<listitem>
<para>If this option is selected, text pasted from the clipboard is indented.
Triggering the <guimenuitem>Undo</guimenuitem> action removes the indentation.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Indentation Actions</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Backspace key in leading blank space unindents</guilabel></term>
<listitem>
<para>If this option is selected, the &Backspace; key decreases the indentation level
if the cursor is located in the leading blank space of a line.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Tab key action (if no selection exists)</guilabel></term>
<listitem>
<para>
If you want &Tab; to align the current line in the current code block
like in &Emacs;, make &Tab; a shortcut to the action <guimenuitem>Format Indentation</guimenuitem>.
</para>
<variablelist>
<varlistentry>
<term><guilabel>Always advance to the next tab position</guilabel></term>
<listitem>
<para>If this option is selected, the &Tab; key always inserts white space
so that the next tab position is reached. If the option <guilabel>Insert spaces instead of tabulators</guilabel>
on the <guilabel>General</guilabel> tab in the <guilabel>Editing</guilabel>
page is enabled, spaces are inserted; otherwise, a single tabulator is inserted.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Always increase indentation level</guilabel></term>
<listitem>
<para>If this option is selected, the &Tab; key always indents the current
line by the number of character positions specified in <guilabel>Indentation width</guilabel>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Increase indentation level if in leading blank space</guilabel></term>
<listitem>
<para>If this option is selected, the &Tab; key either indents the current line
or advances to the next tab position. If the insertion point is at or before the
first non-space character in the line, or if there is a selection, the current line
is indented by the number of character positions specified in <guilabel>Indentation width</guilabel>.
If the insertion point is located after the first non-space character in the line
and there is no selection, white space is inserted so that the next tab position is
reached: if the option <guilabel>Insert spaces instead of tabulators</guilabel>
on the <guilabel>General</guilabel> tab in the <guilabel>Editing</guilabel>
page is enabled, spaces are inserted; otherwise, a single tabulator is inserted.</para>
</listitem>
</varlistentry>
</variablelist>

</listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="pref-edit-autocompletion">
<title>Auto Completion</title>
<variablelist>
<varlistentry>
<term><guilabel>General</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Enable auto completion</guilabel></term>
<listitem>
<para>If enabled, a word completion box automatically pops up during typing
showing a list of text entries to complete the current text under the
cursor.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Auto select first completion entry</guilabel></term>
<listitem>
<para>If enabled, the first auto completion item is always preselected so you can insert it with
&Enter;. If you do not want such behavior, &eg; if you want pressing &Enter; to only insert a newline,
then disable this item.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Minimal word length to complete</guilabel></term>
<listitem><para>While typing text, the word completion searches for words in the
document starting with the already typed text. This option configures the minimal
amount of characters that are needed to make the word completion active and pop
up a completion box.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Remove tail on complete</guilabel></term>
<listitem><para>Remove the tail of a previous word when the completion item is chosen from a list.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Keyword completion
</guilabel></term>
<listitem><para>If enabled, the built-in autocompletion uses the keywords defined by the syntax highlighting.
</para></listitem>
</varlistentry>

</variablelist>

</sect3>

<sect3 id="pref-edit-spellcheck">
<title>Spellcheck</title>
<para>These configuration options are described in the documentation for the
&systemsettings; module <ulink url="help:/kcontrol/spellchecking">Spell Checker</ulink>.</para>
</sect3>

<sect3 id="pref-edit-vi-input-mode">
<title>Vi Input Mode</title>
<variablelist>
<varlistentry>
<term><guilabel>General</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Let Vi commands override Kate shortcuts</guilabel></term>
<listitem>
<para>When selected, Vi commands will override &kappname;'s built-in commands. For
example: <keycombo action="simul">&Ctrl;<keycap>R</keycap></keycombo> will redo,
and override the standard action (showing the search and replace dialog).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Display relative line numbers
</guilabel></term>
<listitem><para>if this is enabled, the current line always refers to line 0. 
Lines above and below increase the line number relatively.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Key Mapping</guilabel></term>
<listitem><para>
Key mapping is used to change the meaning of typed keys. This allows you to
move commands to other keys or make special keypresses for doing a series of
commands.</para>
<para>Example:</para>
<para><keycap>F2</keycap> -> <userinput>I--</userinput> &Esc;</para>
<para>This will prepend <userinput>I--</userinput> to a line when pressing <keycap>F2</keycap>.
</para>
</listitem>
<!-- Normal Mode Insert Mode Visual Mode 
Commands Repacement Recursuive?
Remove selected Add new mapping Import from vimrc file-->
</varlistentry>
</variablelist>

</sect3>

</sect2>

<sect2 id="pref-open-save">
<title>Open/Save</title>

<sect3 id="pref-open-save-general">
<title>General</title>

<variablelist>

<varlistentry>
<term><guilabel>File Format</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Encoding</guilabel></term>
<listitem>
<para>This defines the standard encoding to use to open/save files, if not changed
in the open/save dialog or by using a command line option.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Encoding Detection</guilabel></term>
<listitem>
<para>Select an item from the drop down box, either to disable autodetection or
use <guilabel>Universal</guilabel> to enable autodetection for all encodings. But as
this may probably only detect utf-8/utf-16, selecting a region will use custom heuristics
for better results.
If neither the encoding chosen as standard above, nor the encoding specified
in the open/save dialog, nor the encoding specified on command line match
the content of the file, this detection will be run.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Fallback Encoding</guilabel></term>
<listitem>
<para>This defines the fallback encoding to try for opening files if neither the
encoding chosen as standard above, nor the encoding specified in the open/
save dialog, nor the encoding specified on command line match the content of
the file.  Before this is used, an attempt will be made to determine the
encoding to use by looking for a byte order mark at start of file: if one
is found, the right unicode encoding will be chosen; otherwise encoding
detection will run, if both fail fallback encoding will be tried.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>End of line</guilabel></term>
<listitem>
<para>Choose your preferred end of line mode for your active
document. You have the choice between &UNIX;, DOS/&Windows; or Macintosh.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Automatic end of line detection</guilabel></term>
<listitem>
<para>Check this if you want the editor to autodetect the end of line
type. The first found end of line type will be used for the whole file.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Enable byte order mark (BOM)</guilabel></term>
<listitem>
<para>The byte order mark is a special sequence at the beginning of unicode
encoded documents. It helps editors to open text documents with the correct
unicode encoding. For more information see <ulink
url="https://en.wikipedia.org/wiki/Byte_order_mark">Byte Order Mark</ulink>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Line Length Limit</guilabel></term>
<listitem>
<para>Unfortunately, due to deficiencies in &Qt;, &kappname; experiences poor
performance when working with extremely long lines. For that reason, &kappname;
will automatically wrap lines when they are longer than the number of characters
specified here. To disable this, set this to <userinput>0</userinput>.</para>
</listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Automatic Cleanups on Save</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Remove trailing spaces</guilabel></term>
<listitem>
<para>The editor will automatically eliminate extra spaces at the ends of lines
of text while saving the file.  You can select <guilabel>Never</guilabel> to
disable this functionality, <guilabel>On Modified Lines</guilabel> to do so
only on lines that you have modified since you last saved the document, or
<guilabel>In Entire Document</guilabel> to remove them unconditionally from the
entire document.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Append newline at end of file on save</guilabel></term>
<listitem>
<para>The editor will automatically append a newline to the end of the file if
one is not already present upon saving the file.</para>
</listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Enable Auto Save (local files only)</guilabel></term>
<listitem>
<para>
Check this if you want the editor to autosave documents while you are working on them.
</para>
<variablelist>

<varlistentry>
<term><guilabel>Auto save document when focus leaves the editor</guilabel></term>
<listitem>
<para>The editor will automatically save documents when you switch to something outside the editor, &eg;, the terminal panel in &kate;.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Auto save interval</guilabel></term>
<listitem>
<para>You can determine the autosave interval in seconds here. If the interval is 0, the document will not be autosaved after intervals.</para>
</listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="pref-open-save-advanced">
<title>Advanced</title>
<variablelist>

<varlistentry>
<term><guilabel>Write a backup file on save for</guilabel></term>
<listitem><para>Backing up on save will cause &kappname; to copy the disk file
(the previously saved version of the file) to &lt;prefix&gt;&lt;filename&gt;&lt;suffix&gt;
before saving the new changes. A backup file can help you recover work if
something goes wrong while saving or if you later want to recover the previous
version of the file.  The suffix defaults to <emphasis role="bold">~</emphasis>
and prefix is empty by default. </para>
<variablelist>
<varlistentry>
<term><guilabel>Local files</guilabel></term>
<listitem>
<para>Check this if you want backups of local files when
saving.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Remote files</guilabel></term>
<listitem>
<para>Check this if you want backups of remote files when saving.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Prefix for backup files</guilabel></term>
<listitem>
<para>Enter the prefix to prepend to the backup file names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Suffix for backup files</guilabel></term>
<listitem>
<para>Enter the suffix to add to the backup file names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Swap file mode</guilabel></term>
<listitem>
<para>&kappname; is able to recover (most) unsaved work in the case of a
crash or power failure. A swap file (.&lt;filename&gt;.kate-swp) is created
when a document is edited. If the user doesn’t save the
changes and &kappname; crashes, the swap file remains on the disk. When opening a
file, &kappname; checks if there is a swap file for the document and if it is, it asks
the user whether he wants to recover the lost data or not. The user has the
possibility to view the differences between the original file and the recovered
one, too. The swap file is deleted after every save and on normal exit.</para>
<para>&kappname; syncs the swap files on the disk every 15 seconds, but only if they
have changed since the last sync. The user can disable the swap files syncing if
he wants, by selecting <guilabel>Disable</guilabel>,
but this can lead to more data loss.</para>
<para>When the swap file is enabled, it is possible to switch between two modes, namely <guilabel>Enabled, Store in Default Directory</guilabel> and <guilabel>Enabled, Store in Custom Directory</guilabel>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Store swap files in</guilabel></term>
<listitem><para>By default, the swap files are saved in the same folder as the file. 
When <guilabel>Enabled, Store in Custom Directory</guilabel> is chosen for the swap file mode, swap files are created in the specified folder.
This is useful for network file systems to avoid unnecessary network traffic.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Save swap files every</guilabel></term>
<listitem><para>&kappname; syncs the swap files on the disk every 15 seconds, but only if they
have changed since the last sync. You can change the sync interval as you like.</para></listitem>
</varlistentry>

</variablelist>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="pref-open-save-modes-filetypes">
<title>Modes &amp; Filetypes</title>
<para>This page allows you to override the default configuration for documents
of specified &MIME; types. When the editor loads a document, it will try if it
matches the file masks or &MIME; types for one of the defined filetypes, and if so
apply the variables defined. If more filetypes match, the one with the highest
priority will be used.
</para>
<variablelist>
<varlistentry>
<term><guilabel>Filetype:</guilabel></term>
<listitem><para>The filetype with the highest priority is the one displayed in
the first drop down box. If more filetypes were found, they are
also listed.</para>
<variablelist>
<varlistentry>
<term><guilabel>New</guilabel></term>
<listitem><para>This is used to create a new filetype. After
you click on this button, the fields below get empty and you
can fill the properties you want for the new filetype.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Delete</guilabel></term>
<listitem><para>To remove an existing filetype, select it from the drop down
box and press the Delete button.</para></listitem>
</varlistentry>
</variablelist>
</listitem> </varlistentry>

<varlistentry>
<term><guilabel>Properties of <replaceable>current filetype</replaceable></guilabel></term>
<listitem><para>The filetype with the highest priority is the one displayed in
the first drop down box. If more filetypes were found, they are also
listed.</para>
<variablelist>
<varlistentry>
<term><guilabel>Name:</guilabel></term>
<listitem><para>The name of the filetype will be the text of the corresponding
menu item. This name is displayed in the
<menuchoice><guimenu>Tools</guimenu><guimenuitem>Filetypes</guimenuitem>
</menuchoice> menu.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Section:</guilabel></term>
<listitem><para>The section name is used to organize the file types in
menus. This is also used in the
<menuchoice><guimenu>Tools</guimenu><guimenuitem>Filetypes</guimenuitem>
</menuchoice> menu.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Variables:</guilabel></term>
<listitem><para>This string allows you to configure &kappname;'s settings for the
files selected by this &MIME; type using &kappname; variables. You can set almost any
configuration option, such as highlight, indent-mode, &etc;</para>
<para>Press <guibutton>Edit</guibutton> to see a list of all available variables
and their descriptions.  Select the checkbox on the left to enable a particular
variable and then set the value of the variable on the right.  Some variables
provide a drop-down box to select possible values from while others require you
to enter a valid value manually.</para>
<para>For complete information on these variables, see
<link linkend="config-variables">Configuring with Document
Variables</link>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Highlighting:</guilabel></term>
<listitem><para>If you create a new file type, this drop down box allows you to
select a filetype for highlighting.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Indentation Mode:</guilabel></term>
<listitem><para>The drop down box specifies the indentation mode for new
documents.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>File extensions:</guilabel></term>
<listitem><para>The wildcards mask allows you to select files by filename. A
typical mask uses an asterisk and the file extension, for example
<filename>*.txt; *.text</filename>. The string is a semicolon-separated list of
masks.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>MIME types:</guilabel></term>
<listitem><para>Displays a wizard that helps you easily select
&MIME; types.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Priority:</guilabel></term>
<listitem><para>Sets a priority for this file type. If more than one file type
selects the same file, the one with the highest priority will be
used.</para></listitem>
</varlistentry>

</variablelist>
</listitem> </varlistentry>

</variablelist>
</sect3>

</sect2>

</sect1>

<sect1 id="config-variables">
<title>Configuring With Document Variables</title>

<para>&kappname; variables is &kappname;'s implementation of document variables, similar
to &Emacs; and vi modelines. In katepart, the lines have the following format:

<userinput>kate: VARIABLENAME VALUE; [ VARIABLENAME VALUE; ... ]</userinput>

The lines can of course be in a comment, if the file is in a format with comments.
Variable names are single words (no whitespace), and anything up to the next
semicolon is the value. The semicolon is required.</para>

<para>Here is an example variable line, forcing indentation settings for a C++,
&Java; or &javascript; file:

<programlisting>// kate: replace-tabs on; indent-width 4; indent-mode cstyle;</programlisting>
</para>

<note><para>Only the first and last 10 lines are searched for variable lines.</para></note>

<para>Additionally, document variables can be placed in a file called
<filename>.kateconfig</filename> in any directory, and the configured settings will
be applied as if the modelines were entered on every file in the directory and its
subdirectories. Document variables in <filename>.kateconfig</filename> use the same syntax as
in modelines, but with <link linkend="kateconfig-extended-options">extended options</link>.</para>

<para>There are variables to support almost all configurations in &kappname;, and
additionally plugins can use variables, in which case it should be documented in
the plugin's documentation.</para>

<para>&kappname; has support for reading configurations from <filename>.editorconfig</filename>
files, when the <ulink url="https://editorconfig.org/">editorconfig</ulink> library is installed.
&kappname; automatically searches for a <filename>.editorconfig</filename>
whenever you open a file. It gives priority to <filename>.kateconfig</filename> files, though.
</para>

<sect2 id="config-variables-howto">
<title>How &kappname; uses Variables</title>

<para>When reading configuration, katepart looks in the following places
(in that order):

<itemizedlist>
<listitem><para>The global configuration.</para></listitem>
<listitem><para>Optional session data.</para></listitem>
<listitem><para>The "Filetype" configuration.</para></listitem>
<listitem><para>Document variables in <filename>.kateconfig</filename>.</para></listitem>
<listitem><para>Document variables in the document itself.</para></listitem>
<listitem><para>Settings made during editing from menu or command line.</para></listitem>
</itemizedlist>

As you can see, document variables are only overridden by changes made at runtime.
Whenever a document is saved, the document variables are reread, and will
overwrite changes made using menu items or the command line.</para>

<para>Any variable not listed below is stored in the document and can be queried
by other objects such as plugins, which can use them for their own purpose.
For example, the variable indent mode uses document variables for its
configuration.</para>

<para>The variables listed here documents &kappname; version 5.38. More variables
may be added in the future. There are 3 possible types of values for variables,
with the following valid expressions:
<itemizedlist>
<listitem><para>BOOL - on|off|true|false|1|0</para></listitem>
<listitem><para>INTEGER - any integer number</para></listitem>
<listitem><para>STRING - anything else</para></listitem>
</itemizedlist>
</para>

</sect2>

<sect2 id="config-variables-list">
<title>Available Variables</title>

<variablelist>

<varlistentry id="variable-auto-brackets">
<term><cmdsynopsis><command>auto-brackets</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Enable automatic insertion of brackets.</para></listitem>
</varlistentry>

<varlistentry id="variable-auto-center-lines">
<term><cmdsynopsis><command>auto-center-lines</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the number of autocenter lines.</para></listitem>
</varlistentry>

<varlistentry id="variable-background-color">
<term><cmdsynopsis><command>background-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the document background color. The value must be something
that can be evaluated to a valid color, for example <userinput>#ff0000</userinput>.
</para></listitem>
</varlistentry>

<varlistentry id="variable-backspace-indents">
<term><cmdsynopsis><command>backspace-indents</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Enable or disable unindenting when &Backspace; is pressed.</para></listitem>
</varlistentry>

<varlistentry id="variable-block-selection">
<term><cmdsynopsis><command>block-selection</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Turn <link linkend="kate-part-selection-block">block selection</link>
on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-byte-order-mark">
<term><cmdsynopsis><command>bom | byte-order-mark | byte-order-marker</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Enable/disable the byte order mark (BOM) when saving files in Unicode format
(utf8, utf16, utf32).</para>
<para>Since: &kate; 3.4 (&kde; 4.4)</para></listitem>
</varlistentry>

<varlistentry id="variable-bracket-highlight-color">
<term><cmdsynopsis><command>bracket-highlight-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the color for the bracket highlight. The value must be
something that can be evaluated to a valid color, for example <userinput>#ff0000</userinput>.
</para></listitem>
</varlistentry>

<varlistentry id="variable-current-line-color">
<term><cmdsynopsis><command>current-line-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the color for the current line. The  value must be
something that can be evaluated to a valid color, for example <userinput>#ff0000</userinput>.
</para></listitem>
</varlistentry>

<varlistentry id="variable-default-dictionary">
<term><cmdsynopsis><command>default-dictionary</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Sets the default dictionary used for spellchecking.</para>
<para>Since: &kate; 3.4 (&kde; 4.4)</para></listitem>
</varlistentry>

<varlistentry id="variable-dynamic-word-wrap">
<term><cmdsynopsis><command>dynamic-word-wrap</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Turns <link linkend="kate-part-auto-wrap">dynamic word wrap</link> on or
off.</para></listitem>
</varlistentry>

<varlistentry id="variable-end-of-line">
<term><cmdsynopsis><command>eol | end-of-line</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the end of line mode. Valid settings are
<userinput>unix</userinput>, <userinput>mac</userinput> and <userinput>dos</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-folding-markers">
<term><cmdsynopsis><command>folding-markers</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set the display of
<link linkend="advanced-editing-tools-code-folding">folding markers</link>
on or off.
</para></listitem>
</varlistentry>

<varlistentry id="variable-folding-preview">
<term><cmdsynopsis><command>folding-preview</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Enable folding preview in the editor border.</para></listitem>
</varlistentry>

<varlistentry id="variable-font-size">
<term><cmdsynopsis><command>font-size</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the point size of the document font.</para></listitem>
</varlistentry>

<varlistentry id="variable-font">
<term><cmdsynopsis><command>font</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the font of the document. The value should be a valid font
name, for example <userinput>courier</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-syntax">
<term><cmdsynopsis><command>hl | syntax</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the syntax highlighting. Valid strings are all the names available
in the menus.  For instance, for C++ simply write <userinput>C++</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-icon-bar-color">
<term><cmdsynopsis><command>icon-bar-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the icon bar color. The  value must be something that can
be evaluated to a valid color, for example <userinput>#ff0000</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-icon-border">
<term><cmdsynopsis><command>icon-border</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set the display of the icon border on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-indent-mode">
<term><cmdsynopsis><command>indent-mode</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the auto-indentation mode. The options <userinput>none</userinput>,
<userinput>normal</userinput>, <userinput>cstyle</userinput>, <userinput>haskell</userinput>,
<userinput>lilypond</userinput>, <userinput>lisp</userinput>, <userinput>python</userinput>,
<userinput>ruby</userinput> and <userinput>xml</userinput> are recognized. See the section
<xref linkend="kate-part-autoindent"/> for details.</para></listitem>
</varlistentry>

<varlistentry id="variable-indent-pasted-text">
<term><cmdsynopsis><command>indent-pasted-text</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Enable/disable adjusting indentation of text pasted from the clipboard.</para>
<para>Since: &kate; 3.11 (&kde; 4.11)</para></listitem>
</varlistentry>

<varlistentry id="variable-indent-width">
<term><cmdsynopsis><command>indent-width</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the indentation width.</para></listitem>
</varlistentry>

<varlistentry id="variable-keep-extra-spaces">
<term><cmdsynopsis><command>keep-extra-spaces</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set whether to keep extra spaces when calculating indentation width.</para></listitem>
</varlistentry>

<varlistentry id="variable-line-numbers">
<term><cmdsynopsis><command>line-numbers</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set the display of line numbers on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-newline-at-eof">
<term><cmdsynopsis><command>newline-at-eof</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Add an empty line at the end of the file (EOF) when saving the document.</para>
<para>Since: &kate; 3.9 (&kde; 4.9)</para></listitem>
</varlistentry>

<varlistentry id="variable-overwrite-mode">
<term><cmdsynopsis><command>overwrite-mode</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set overwrite mode on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-persistent-selection">
<term><cmdsynopsis><command>persistent-selection</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set <link linkend="kate-part-selection-persistent">persistent selection</link>
on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-replace-tabs-save">
<term><cmdsynopsis><command>replace-tabs-save</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set tab to space conversion on save on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-replace-tabs">
<term><cmdsynopsis><command>replace-tabs</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set dynamic tab to space conversion on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-remove-trailing-spaces">
<term><cmdsynopsis><command>remove-trailing-spaces</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Removes trailing spaces when saving the document. Valid options are:</para>
<itemizedlist>
<listitem><para><userinput>none</userinput>, <userinput>-</userinput> or <userinput>0</userinput>: never remove trailing spaces.</para></listitem>
<listitem><para><userinput>modified</userinput>, <userinput>mod</userinput>, <userinput>+</userinput> or <userinput>1</userinput>: remove trailing spaces only in
modified lines. The modified lines are marked by the line modification system.</para></listitem>
<listitem><para><userinput>all</userinput>, <userinput>*</userinput> or <userinput>2</userinput>: remove trailing spaces in the entire document.</para></listitem>
</itemizedlist>
</listitem>
</varlistentry>

<varlistentry id="variable-scrollbar-minimap">
<term><cmdsynopsis><command>scrollbar-minimap</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Show scrollbar minimap.</para></listitem>
</varlistentry>

<varlistentry id="variable-scrollbar-preview">
<term><cmdsynopsis><command>scrollbar-preview</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Show scrollbar preview.</para></listitem>
</varlistentry>

<varlistentry id="variable-scheme">
<term><cmdsynopsis><command>scheme</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the color scheme. The string must be the name of a color
scheme that exists in your configuration to have any effect.</para></listitem>
</varlistentry>

<varlistentry id="variable-selection-color">
<term><cmdsynopsis><command>selection-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the selection color. The  value must be something that can
be evaluated to a valid color, for example <userinput>#ff0000</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-show-tabs">
<term><cmdsynopsis><command>show-tabs</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set the visual tab character on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-smart-home">
<term><cmdsynopsis><command>smart-home</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set <link linkend="pref-edit-cursor-selection">smart home navigation</link>
on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-tab-indents">
<term><cmdsynopsis><command>tab-indents</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set &Tab; key indentation on or off.</para></listitem>
</varlistentry>

<varlistentry id="variable-tab-width">
<term><cmdsynopsis><command>tab-width</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the tab character display width.</para></listitem>
</varlistentry>

<varlistentry id="variable-undo-steps">
<term><cmdsynopsis><command>undo-steps</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the number of undo steps to remember.</para>
<para>Note: Deprecated since &kate; 3 in &kde;4. This variable is ignored. The maximal count of undo steps is unlimited.</para></listitem>
</varlistentry>

<varlistentry id="variable-word-wrap-column">
<term><cmdsynopsis><command>word-wrap-column</command><arg>INT</arg></cmdsynopsis></term>
<listitem><para>Set the <link linkend="kate-part-auto-wrap">static word wrap</link>
width. </para></listitem>
</varlistentry>

<varlistentry id="variable-word-wrap-marker-color">
<term><cmdsynopsis><command>word-wrap-marker-color</command><arg>STRING</arg></cmdsynopsis></term>
<listitem><para>Set the word wrap marker color. The value must be something
that can be evaluated to a valid color, for example <userinput>#ff0000</userinput>.</para></listitem>
</varlistentry>

<varlistentry id="variable-word-wrap">
<term><cmdsynopsis><command>word-wrap</command><arg>BOOL</arg></cmdsynopsis></term>
<listitem><para>Set static word wrapping on or off.</para></listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="kateconfig-extended-options">
<title>Extended Options in <filename>.kateconfig</filename> files</title>

<para>&kappname; always search for a <filename>.kateconfig</filename> file for local files (not remote files).
In addition, it is possible to set options based on wildcards (file extensions) as follows:</para>

<programlisting>kate: tab-width 4; indent-width 4; replace-tabs on;
kate-wildcard(*.xml): indent-width 2;
kate-wildcard(Makefile): replace-tabs off;
</programlisting>

<para>In this example, all files use a tab-width of 4 spaces, an indent-width of 4 spaces,
and tabs are replaced expanded to spaces. However, for all <filename class="extension">*.xml</filename>
files, the indent width is set to 2 spaces.
And Makefiles use tabs, &ie; tabs are not replaced with spaces.</para>

<para>Wildcards are semicolon separated, &ie; you can also specify multiple file extensions as follows:
</para>

<programlisting>kate-wildcard(*.json;*.xml): indent-width 2;</programlisting>

<para>Further, you can also use the &MIME; type to match certain files, &eg; to indent
all C++ source files with 4 spaces, you can write:
</para>

<programlisting>kate-mimetype(text/x-c++src): indent-width 4;</programlisting>

<note><para>Next to the support in <filename>.kateconfig</filename> files, wildcard and &MIME; type
dependent document variables are also supported in the files itself as comments.
</para></note>

</sect2>

</sect1>

</chapter>
