<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>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>
<variablelist>
<varlistentry>
<term><guilabel>Dynamic word wrap indicators (if applicable)</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>Align dynamically wrapped lines
to indentation depth:
</guilabel></term>
<listitem><para>Enables the start of dynamically wrapped
lines to be aligned  vertically to the indentation level of the first
line.  This can help to make code and markup more
readable.</para><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>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Whitespace Highlighting</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Highlight tabulators</guilabel></term>
<listitem><para>The editor will display a &raquo; symbol to indicate the presence
  of a tab in the text.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Highlight trailing spaces</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>Highlight marker size</guilabel></term>
<listitem><para>Use the slider to change the size of the visible highlight marker.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Advanced
</guilabel></term>
<listitem><para>
<variablelist>
<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>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>
</variablelist>
</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Animate bracket matching
</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 animate the matching bracket.</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>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>
</sect3>

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

<variablelist>
<varlistentry>
<term><guilabel>Borders</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Show folding markers
</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 code
</guilabel></term>
<listitem><para>If checked, hovering over a folded region shows a preview of the folded text
in a popup.</para></listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show icon border
</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>Show line modification markers
</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>
<varlistentry>
<term><guilabel>Show scrollbar 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 text preview on 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>
<varlistentry>
<term><guilabel>Show scrollbar mini-map</guilabel></term>
<listitem><para>If this option is checked, every new view will show a mini map 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>

<varlistentry>
<term><guilabel>Sort Bookmarks Menu
</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>By creation
</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 position
</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"><!-- checked for 4.7 + synced with kwrite -->
<title>Fonts &amp; Colors</title>

<para>This section of the dialog lets you configure all fonts and colors in
any color scheme you have, as well creating new schemes or deleting existing
ones. Each scheme has settings for colors, fonts and normal and highlight text
styles.
</para>

<para>&kappname; will preselect the currently active scheme for you, if you want to
work on a different scheme start by selecting that from the
<guilabel>Schema</guilabel> combobox. With the <guibutton>New</guibutton> and <guibutton>Delete</guibutton>
 button you can create a new scheme or delete existing ones.</para>
<para>At the bottom of the page you can select the <guilabel>Default schema for &kappname;</guilabel>.</para>

<para>By default, &kappname; will base its color scheme on the current &kde;
color scheme.  You can reset an individual color back to default by clicking the
reset arrow to the right of the entry in the color editor, or you can reset all
colors back to default by clicking the
<guibutton>Use &kde; Color Scheme</guibutton> at the bottom of the panel.</para>

<tip>
<para>You can adjust the &kde; color scheme in the
<ulink url="help:/kcontrol/colors/"><guilabel>Colors</guilabel> module in
&systemsettings;</ulink>.</para>
</tip>

<sect3 id="prefcolors-colors">
<title>Colors</title>

<variablelist>
<varlistentry id="variable-prefcolors-colors-text-background">
<term><guilabel>Editor Background Colors</guilabel></term>
<listitem>

<variablelist>

<varlistentry id="variable-pref-colors-normal-text">
<term><guilabel>Text Area</guilabel></term>
<listitem><para>This is the default background for the editor area, it will be
the dominant color on the editor area.</para></listitem>
</varlistentry>

<varlistentry id="variable-pref-colors-selected-text">
<term><guilabel>Selected Text</guilabel></term>
<listitem><para>This is the background for selected text. The default is
the global selection color, as set in your &kde; color preferences.
</para></listitem>
</varlistentry>

<varlistentry id="variable-pref-colors-current-line">
<term><guilabel>Current Line</guilabel></term>
<listitem><para>Set the color for the current line. Setting this a bit different
from the Normal text background helps to keep focus on the current line.
</para></listitem>
</varlistentry>

<varlistentry id="variable-pref-colors-search-highlight">
<term><guilabel>Search Highlight</guilabel></term>
<listitem><para>Set the color for the text that matches your last search.
</para></listitem>
</varlistentry>

<varlistentry id="variable-pref-colors-replace-highlight">
<term><guilabel>Replace Highlight</guilabel></term>
<listitem><para>Set the color for the text that matches your last replace
operation.</para></listitem>
</varlistentry>

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

<varlistentry id="variable-prefcolors-colors-icon-border">
<term><guilabel>Icon Border</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Background Area</guilabel></term>
<listitem><para>This color is used for the marks, line numbers and folding
marker borders in the left side of the editor view when they are displayed.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Line Numbers</guilabel></term>
<listitem><para>This color is used to draw the line numbers on the left side of
the view when displayed.</para></listitem>
</varlistentry>

<!--FIXME: Missing Separator - not sure what that is-->

<varlistentry>
<term><guilabel>Word Wrap Marker</guilabel></term>
<listitem><para>This color is used to draw a pattern to the left of dynamically
wrapped lines when those are aligned vertically, as well as for the static word
wrap marker.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Code Folding</guilabel></term>
<listitem><para>This color is used to highlight the section of code that would
be folded when you click on the code folding arrow to the left of a document.
For more information, see
<link linkend="advanced-editing-tools-code-folding">the code
folding documentation</link>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Modified Lines</guilabel></term>
<listitem><para>This color is used to highlight to the left of a document lines
that have been modified but not yet saved.  For more information, see
<xref linkend="kate-part-line-modification"/></para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Saved Lines</guilabel></term>
<listitem><para>This color is used to highlight to the left of a document lines
that have been modified this session and saved.  For more information, see
<xref linkend="kate-part-line-modification"/></para></listitem>
</varlistentry>

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

<varlistentry id="variable-prefcolors-colors-text-decorations">
<term><guilabel>Text Decorations</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Spelling Mistake Line</guilabel></term>
<listitem><para>This color is used to indicate spelling mistakes.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Tab and Space Markers</guilabel></term>
<listitem><para>This color is used to draw white space indicators, when they are
enabled.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Indentation Line</guilabel></term>
<listitem><para>This color is used to draw a line to the left of indented blocks,
if <link linkend="appearance-general">that feature is enabled</link>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Bracket Highlight</guilabel></term>
<listitem><para>This color is used to draw the background of matching brackets.
</para></listitem>
</varlistentry>

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

<varlistentry id="variable-prefcolors-colors-marker-colors">
<term><guilabel>Marker Colors</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Bookmark</guilabel></term>
<listitem><para>This color is used to indicate bookmarks.  For more information,
see <xref linkend="kate-part-bookmarks"/>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Active Breakpoint</guilabel></term>
<listitem><para>This color is used by the GDB plugin to indicate an active
breakpoint.  For more information, see
<ulink url="help:/kate/kate-application-plugin-gdb.html">the GDB Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Reached Breakpoint</guilabel></term>
<listitem><para>This color is used by the GDB plugin to indicate a breakpoint
you have reached while debugging.  For more information, see
<ulink url="help:/kate/kate-application-plugin-gdb.html">the GDB Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Disabled Breakpoint</guilabel></term>
<listitem><para>This color is used by the GDB plugin to indicate an inactive
breakpoint.  For more information, see
<ulink url="help:/kate/kate-application-plugin-gdb.html">the GDB Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Execution</guilabel></term>
<listitem><para>This color is used by the GDB plugin the line presently being
executed.  For more information, see
<ulink url="help:/kate/kate-application-plugin-gdb.html">the GDB Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Warning</guilabel></term>
<listitem><para>This color is used by the build plugin to indicate a line that
has caused a compiler warning.  For more information, see
<ulink url="help:/kate/kate-application-plugin-build.html">the Build Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Error</guilabel></term>
<listitem><para>This color is used by the build plugin to indicate a line that
has caused a compiler error.  For more information, see
<ulink url="help:/kate/kate-application-plugin-build.html">the Build Plugin
documentation</ulink>.</para></listitem>
</varlistentry>

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

<varlistentry id="variable-prefcolors-colors-text-templates-snippets">
<term><guilabel>Text Templates &amp; Snippets</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Background</guilabel></term>
<listitem><para>This color is used by the &kate; Snippets plugin to mark the
background of a snippet.  <!--For more information, see
<ulink url="help:/kate/kate-application-plugin-snippets.html">the &kate; Snippets
documentation</ulink>.--></para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Editable Placeholder</guilabel></term>
<listitem><para>This color is used by the &kate; Snippets plugin to mark a
placeholder that you can click in to edit manually.  <!--For more information, see
<ulink url="help:/kate/kate-application-plugin-snippets.html">the &kate; Snippets
documentation</ulink>.--></para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Focused Editable Placeholder</guilabel></term>
<listitem><para>This color is used by the &kate; Snippets plugin to mark the
placeholder that you are presently editing.  <!--For more information, see
<ulink url="help:/kate/kate-application-plugin-snippets.html">the &kate; Snippets
documentation</ulink>.--></para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Not Editable Placeholder</guilabel></term>
<listitem><para>This color is used by the &kate; Snippets plugin to mark a
placeholder that cannot be edited manually, such as one that is automatically
populated.  For more information, see
<ulink url="help:/kate/kate-application-plugin-snippets.html">the &kate; Snippets
documentation</ulink>.</para></listitem>
</varlistentry>

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

<varlistentry id="prefcolors-colors-use-kde-color-scheme">
<term><guibutton>Use &kde; Color Scheme</guibutton></term>
<listitem>
<para>Clicking this button will set all the above defined colors to match the 
current color scheme defined in &kde;'s &systemsettings;.  For more information,
see <ulink url="help:/kcontrol/colors/">the documentation for the Colors &kde; 
Control Module</ulink>.</para>
<para>If you do not use the &kde; &plasma; Workspaces, this button will have no
effect, and may not be present.</para>
</listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="prefcolors-fonts">
<title>Font</title>
<para>
Here you can choose the font for the schema.  You can choose from
any font available on your system, and set a default size. A sample text
displays 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>
</sect3>

<sect3 id="prefcolors-normal-text-styles">
<title>Default Text Styles</title>
<para>The default text styles are inherited by the highlight text styles,
allowing the editor to present text in a very consistent way, for example comment
text is using the same style in almost all of the text formats that &kappname; can
highlight.</para>
<para>The name in the list of styles is using the style configured for
the item, providing you with an immediate preview when configuring a style.
</para>
<para>Each style lets you select common attributes as well as foreground
and background colors. To unset a background color, right-click to use the
context menu.</para>
</sect3>

<sect3 id="prefcolors-highlighting-text-styles">
<title>Highlighting Text Styles</title>
<para>Here you can edit the text styles used by a specific highlight definition.
The editor preselects the highlight used by your current document. To work on a
different highlight, select one in the <guilabel>Highlight</guilabel> combobox
above the style list.
</para>
<para>The name in the list of styles is using the style configured for
the item, providing you with an immediate preview when configuring a style.
</para>
<para>Each style lets you select common attributes as well as foreground
and background colors. To unset a background color, right-click to use the
context menu. In addition you can see if a style is equal to the default style
used for the item, and set it to that if not.</para>
<para>You will notice that many highlights contain other highlights represented
by groups in the style list. For example most highlights import the Alert
highlight, and many source code formats imports the Doxygen highlight. Editing
colors in those groups only affects the styles when used in the edited highlight
format.
</para>
</sect3>

</sect2>

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

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

<varlistentry>
<term id="pref-word-wrap"><guilabel>Static 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>Enable static word wrap</guilabel></term>
<listitem>
<para>Turns static word wrap on or off.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Show static word wrap marker
(if applicable)</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">Enable static word wrap</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>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>Auto brackets</guilabel></term> <listitem><para>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>
<para>When text is selected, typing one of the characters wraps the selected text.</para>
</listitem>
</varlistentry>


<varlistentry>
<term ><guilabel>Copy and Paste</guilabel></term>
<listitem>
<variablelist>
<varlistentry>
<term><guilabel>Copy/Cut the current line if no selection</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>
</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 <keycap>Page Up</keycap> or <keycap>Page Down</keycap> 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>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>

</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>Align</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>
</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="http://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>

</variablelist>
</sect3>

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

<varlistentry>
<term><guilabel>Backup on Save</guilabel></term>
<listitem><para>Backing up on save will cause &kappname; to copy the disk file to
&lt;prefix&gt;&lt;filename&gt;&lt;suffix&gt; before saving changes.
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</guilabel></term>
<listitem>
<para>Enter the prefix to prepend to the backup file names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Suffix</guilabel></term>
<listitem>
<para>Enter the suffix to add to the backup file names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><guilabel>Swap file options</guilabel></term>
<listitem>
<para>&kappname; is able to recover (most of) what was written after last save in case
of a crash or power failure. A swap file (.swp.&lt;filename&gt;) is created
after the first editing action on a document. 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 enabled, the swap files are saved in the same folder as the file. 
When <guilabel>Alternative Directory</guilabel> is chosen, swap files are created in the specified folder.
This is useful for network file systems to avoid unnecessary network traffic.</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 mimetypes. When the editor loads a document, it will try if it
matches the file masks or mimetypes 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 ></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 mimetype 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
mimetypes.</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="http://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>
<para>Since: &kde; 4.10.
</para></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 mimetype 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 mimetype
dependent document variables are also supported in the files itself as comments.
</para></note>

</sect2>

</sect1>

</chapter>
