<chapter id="plugins">

<chapterinfo>
<authorgroup>
<author>&Anders.Lund; &Anders.Lund.mail;</author>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>
</chapterinfo>

<title>Working with Plugins</title>

<para>&kate; offers several plugins. There are two types of these plugins:
some are written in native C++, while others are written in the Python programming
language. There are subtle differences in these, described below.</para>

<para>You can enable any type of plugin in the <link
linkend="configuring-kate-configdialog">configuration dialog</link>, which also
provides access to additional configuration options for plugins that require
it.</para>

<sect1 id="kate-application-plugins">
<title>&kate; Application Plugins</title>

<!-- from doc/kate-addons/index.docbook -->
<para>
&kate; plugins are additional functions for the &kate; editor.  They can
add extra menus and shortcuts, and extend &kate;'s features.  You can
install as many or as few as you like, from within &kate;.
Open &kate;'s configuration dialog with
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem></menuchoice>
Select <menuchoice><guimenu>Application</guimenu><guimenuitem>Plugins</guimenuitem></menuchoice> to
choose the wanted plugins.
</para>

<para>
The available application plugins are:
</para>
<itemizedlist>
<listitem>
<para><link linkend="kate-application-plugin-backtracebrowser">Backtrace Browser</link>
- Backtrace navigation tool view</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-build">Build Plugin</link> - Compile or Make and parse error messages</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-closeexceptlike">Close Except/Like</link>
- Close group of documents based on a common path or file extension</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-ctags">CTags</link> -
Look up definitions/declarations with CTags</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-documentswitcher">Document switcher</link> -
Quick document switching with <keycombo action="simul">&Alt;&Tab;</keycombo> behavior</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-fsbrowser">File system browser</link> -
  File system browser tool view</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-documents">Documents</link> - Displays the open files in a file tree</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-gdb">&gdb;</link> - Provides a
simple &gdb; frontend</para>
</listitem>
<!--from workspace/plasma-sdk, why picked up here?
<listitem>
<para>Icon picker - Invokes Cuttlefish icon picker</para>
</listitem>
-->
<listitem>
<para><link linkend="kate-application-plugin-lumen">Lumen</link> - Lumen
is a Autocompletion Plugin for D, using the DCD autocompletion server</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-openheader">Open Header</link>
- Opens the corresponding .h/[.cpp|.c] file</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-projects">Project Plugin</link> - Project plugin for kate</para>
</listitem>
<listitem>
<para>Replicode</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-rust">Rust code completion</link>
- Code completion for Rust source code</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-searchinfiles">Search &amp; Replace</link> -
Search or replace patterns in opened documents or in files on disk</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-snippets">Snippets tool view</link> - Tool view embedding the snippets management</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-sql">SQL Plugin</link> - Execute
query on SQL databases</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-symbolviewer">Symbol Viewer</link>
- Extract and show reference symbols from source</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-konsole">Terminal tool view</link> - Tool view embedding a terminal widget</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-textfilter">Text Filter</link> - Easy text filtering</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-xmltools">&XML;Completetion</link> - Lists &XML; elements,
attributes, attribute values and entities allowed by DTD</para>
</listitem>
<listitem>
<para><link linkend="kate-application-plugin-xmlcheck">&XML; Validation</link>- Validates &XML; files using xmllint</para>
</listitem>
</itemizedlist>
</sect1>

<sect1 id="kate-application-plugin-backtracebrowser">
<!--https://kate-editor.org/2008/08/12/kate-fast-backtrace-navigation/-->
<title>Backtrace Browser Plugin</title>

<sect2 id="backtracebrowser-using">
<title>Using the Backtrace Browser Plugin</title>

<para>This plugin is meant for developers and probably of little use for users.
It shows a backtrace delivered by gdb in a listview in a &kate; toolview.
Clicking on an item opens the selected file and jumps to the correct line number.
It works for backtraces generated on your own machine, but it will also work for
backtraces from other people, &ie; with <filename>/home/dummy/qt-copy/…/qwidget.cpp</filename>
will still be found on other machines. For that to work, you have to index the
directories where the source code is located.
</para>

<para>Sometimes there are several files with the same name, &eg;</para>

<simplelist>
<member><filename>kdegraphics/okular/generators/dvi/config.h</filename></member>
<member><filename>kdepim-runtime/resources/gmail/saslplugin/config.h</filename></member>
</simplelist>

<para>To pick the right choice, the plugin picks the last two parts of the url,
in this case this would be</para>

<simplelist>
<member><filename>dvi/config.h</filename></member>
<member><filename>saslplugin/config.h</filename></member>
</simplelist>

<para>And then usually the plugin finds the correct one.</para>

<para>Indexing master and a branches of course will lead to a clash.</para>

</sect2>

<sect2 id="backtracebrowser-config">
<title>Configuration</title>

<para>On the configuration page add the directories containing the source code.</para>

<screenshot id="screenshot-backtrace-settings">
<screeninfo>Backtrace Browser</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="backtrace-settings.png" format="PNG"/></imageobject>
<caption>Configure Paths in Backtrace browser tool view</caption>
</mediaobject>
</screenshot>

<para>Clicking <guibutton>OK</guibutton> will start indexing.
When indexing is finished, open the toolview <guilabel>Backtrace Browser</guilabel>.</para>
<para>Now you can load a backtrace from the clipboard (&eg;, when you clicked
<guibutton>Copy to Clipboard</guibutton> in DrKonqi) or from a file.</para>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-build">
<!--http://kate-editor.org/2011/06/21/kate-plugin-updates-part-1/ -->
<sect1info>
<authorgroup>
<author><firstname>Salma</firstname> <surname>Sultana</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>Build Plugin</title>

<sect2 id="build-intro">
<title>Introduction</title>

<para>The Build plugin allows you to run actions like build, clean and compile
on a project.</para>

</sect2>

<sect2 id="build-using">
<title>Using the Build Plugin</title>

<para>The Build plugin adds a <guilabel>Build Output</guilabel> tool view at the
bottom and a <guimenu>Build</guimenu> menu on the menubar. The tool view can be used to configure
build target settings, while the menu can be used to perform build, clean and
compile actions.</para>

<screenshot id="screenshot-build-output">
<screeninfo>Build Output</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="build-output.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>The <guilabel>Build Output</guilabel> tool view has two tabs:</para>

<itemizedlist>
<listitem><para><guilabel>Target Settings</guilabel></para></listitem>
<listitem><para><guilabel>Output</guilabel></para></listitem>
</itemizedlist>

<sect3 id="build-using-target-settings">
<title>Target Settings tab</title>

<para>The target settings tab can be used to configure various build targets and define targets sets.</para>

<para>To change the names or commands double click on the entries in the table and use the
dropdown box to select the active target set. Use the checkbox in front of each target to define a default.</para>

<para>A new target set contains several configuration options:</para>

<variablelist>
<varlistentry>
<term><guilabel>Working Directory</guilabel></term>
<listitem><para>You can set the path to the project here. Leave this empty to
use the directory the current document is located in.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Build</guilabel></term>
<listitem><para>This option lets you define the build command. It is set to
<command>make</command> by default.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Clean</guilabel></term>
<listitem><para>The option lets you define the clean command. It is set to
<command>make clean</command> by default.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Config</guilabel></term>
<listitem><para>This option lets you define the config command. It is set
to <command>cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ../</command>
by default.</para></listitem>
</varlistentry>
</variablelist>

<para>On the top this plugin has a toolbar with the following buttons :</para>

<simplelist>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="dialog-ok-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Build the selected target</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="list-add-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Add a new build target</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Create a new build target set</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-copy-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Copy a command or target set</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-delete-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Delete the current command or target set</member>
</simplelist>

</sect3>

<sect3 id="build-using-output">
<title>Output tab</title>

<para>The <guilabel>Output</guilabel> tab shows the console output generated by
the last command.</para>

<para>Use the slider at the top to show or hide categories of output:</para>

<para><guilabel>Full Output</guilabel>, <guilabel>Parsed Output</guilabel>,
<guilabel>Errors and Warnings</guilabel> or <guilabel>Only Errors</guilabel>
</para>

<para>Each line contains a message and the file name and line number if available.
Clicking on the error or warning takes you to the appropriate file and places
the cursor on the corresponding line number.</para>

<!--FIXME: These shortcuts now seem to be used by the Project plugin as well.
            https://bugs.kde.org/show_bug.cgi?id=328170 -->
<para>To navigate to the previous error, press
<keycombo action="simul">&Ctrl;&Alt;<keysym>Left</keysym></keycombo>.
To navigate to the next error, press
<keycombo action="simul">&Ctrl;&Alt;<keysym>Right</keysym></keycombo>.</para>

</sect3>
</sect2>

<sect2 id="build-menu">
<title>Menu Structure</title>

<variablelist id="build-build">
<varlistentry>
<term><menuchoice id="build-targets">
<guimenu>Build</guimenu><guisubmenu>Select Target</guisubmenu>
</menuchoice></term>
<listitem><para>Select from a list of targets configured by the user.</para></listitem>
</varlistentry>

<varlistentry id="build-default">
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Build Default Target</guimenuitem>
</menuchoice></term>
<listitem><para>Builds the target defined as default in the active target set.</para></listitem>
</varlistentry>

<varlistentry id="build-previous">
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Build Previous Target</guimenuitem>
</menuchoice></term>
<listitem><para>Switch to the previous target configured by the user.</para></listitem>
</varlistentry>

<varlistentry id="build-stop">
<term><menuchoice>
<guimenu>Build</guimenu><guimenuitem>Stop</guimenuitem>
</menuchoice></term>
<listitem><para>Stop building a target.</para></listitem>
</varlistentry>

<varlistentry id="build-previous-error">
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;&Alt;<keysym>Left</keysym></keycombo></shortcut>
<guimenu>Build</guimenu><guimenuitem>Previous Error</guimenuitem>
</menuchoice></term>
<listitem><para>Moves the cursor to the location of the previous error in the
document.</para></listitem>
</varlistentry>

<varlistentry id="build-next-error">
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;&Alt;<keysym>Right</keysym></keycombo></shortcut>
<guimenu>Build</guimenu><guimenuitem>Next Error</guimenuitem>
</menuchoice></term>
<listitem><para>Moves the cursor to the location of the next error in the
document.</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="build-ack">
<title>Thanks and Acknowledgments</title>
<para>The &kate; Build Plugin was written by Kåre Särs.</para>
<para>Special thanks to Google Code-In 2011 participant Salma Sultana for
writing much of this section.</para>
</sect2>
</sect1>

<sect1 id="kate-application-plugin-closeexceptlike">

<title>Close Except/Like Plugin</title>

<sect2 id="closeexceptlike-intro">
<title>Introduction</title>

<para>This plugin allows you to close a group of documents based on their extension and path.</para>

</sect2>

<sect2 id="closeexceptlike-using">
<title>Using the Close Except/Like Plugin</title>

<para>Assumed you have these documents opened in &kate;:</para>

<simplelist>
<member>/tmp/subfolder/test.h</member>
<member>/tmp/test.cpp</member>
<member>/tmp/test.txt</member>
</simplelist>

<para>Then you have the following options to close documents as displayed in the screenshot:</para>

<screenshot id="screenshot-closeexceptlike">
<screeninfo>Close Except</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="close-except-like.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Use the checkbox in the last item of the list to enable or disable a confirmation dialog.
The selected option will be applied to both close actions.
</para>

</sect2>

<sect2 id="closeexceptlike-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry id="file-close-except">
<term><menuchoice>
<guimenu>File</guimenu>
<guisubmenu>Close Except</guisubmenu>
</menuchoice></term>
<listitem>
<para><action>Close</action> all open documents, <emphasis>except</emphasis>
those which match the path or file extension selected from the submenu.</para>
</listitem>
</varlistentry>

<varlistentry id="file-close-like">
<term><menuchoice>
<guimenu>File</guimenu>
<guisubmenu>Close Like</guisubmenu>
</menuchoice></term>
<listitem>
<para><action>Close</action> all open documents
which match the path or file extension selected from the submenu.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

</sect1>


<sect1 id="kate-application-plugin-ctags">
<!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate/-->
<title>CTags Plugin</title>

<sect2 id="ctags-intro">
<title>Introduction</title>

<para><ulink url="https://en.wikipedia.org/wiki/Ctags">CTags</ulink> generates an
index (or tag) file of language objects found in source files that allows these
items to be quickly and easily located using this plugin in &kate;.
</para>
<para>A tag signifies a language object for which an index entry is available
(or, alternatively, the index entry created for that object).</para>

<para>Tag generation is supported for these
<ulink url="http://ctags.sourceforge.net/languages.html">programming languages</ulink>.
</para>
</sect2>

<sect2 id="ctags-config">
<title>Configuration</title>

<para>The CTags plugin uses two different database files for the index.</para>

<para>On the CTags settings page in &kate;'s configuration you can add or remove
directories containing the source code and regenerate the common CTags database.</para>

<sect3 id="ctags-config-common">
<title>Common Index</title>

<screenshot id="screenshot-ctags-global-settings">
<screeninfo>CTags Settings</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="ctags-global-setting.png" format="PNG"/></imageobject>
<caption>Configure CTags Global Database</caption>
</mediaobject>
</screenshot>

<para>At the bottom of the settings page you can adapt the <guilabel>CTags command</guilabel>.
</para>

<para>For more information about all available options please read the CTags man page. This man page
is available in &khelpcenter; and you can also enter the &URL; <emphasis>man/:ctags</emphasis>
directly into &konqueror;
</para>

<para>Clicking <guibutton>Update</guibutton> will start indexing.
When indexing is finished, close the dialog.</para>
</sect3>

<sect3 id="ctags-config-session">
<title>Session Index</title>

<para>To configure the session index open the <guilabel>CTags</guilabel> view.</para>

<variablelist>
<varlistentry>
<term><menuchoice>
<guimenu>Index Targets</guimenu>
</menuchoice></term>
<listitem>
<para>On this tab you can add or remove directories containing the source code and manually
regenerate the session specific CTags database.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>Database</guimenu>
</menuchoice></term>
<listitem>
<screenshot id="screenshot-ctags-session-settings">
<screeninfo>Database Settings</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="ctags-session-setting.png" format="PNG"/></imageobject>
<caption>Configure CTags Session Database</caption>
</mediaobject>
</screenshot>
<para>Select another CTags database file, configure the CTags command or revert
to the default command.</para>
</listitem>
</varlistentry>

</variablelist>

</sect3>

</sect2>

<sect2 id="ctags-using">
<title>Using the CTags Plugin</title>

<para>
You place the mouse cursor on the language object like function, symbol &etc;
that you are interested in and then select one of the actions in the
<guimenu>CTags</guimenu> menu to jump to the line and file where the object is
defined or declared.</para>
<para>By default the actions in the <guimenu>CTags</guimenu> menu have no shortcuts assigned.
Use the <ulink url="help:/fundamentals/shortcuts.html">keyboard shortcut editor</ulink>
to configure your own shortcuts.</para>

<para>Alternatively use the search field on the <guilabel>Lookup</guilabel> tab of the
CTags view.</para>
<para>Entering characters into the search field will start the search and display matching names
of language objects like functions, classes, symbols &etc; together with type and filename.</para>
<para>Select an item in the list to jump to the corresponding line in the source file.</para>
<!--FIXME why Tag Type here but Name Kind in Project plugin, is there really any difference?-->

<!--FIXME completion as in Project plugin? -->

</sect2>

<sect2 id="ctags-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="ctags-jumpback">
<term><menuchoice>
<guimenu>CTags</guimenu>
<guisubmenu>Jump back one step</guisubmenu>
</menuchoice></term>
<listitem>
<para>Navigate back in the history to the last visited tag.</para>
</listitem>
</varlistentry>

<varlistentry id="ctags-lookup">
<term><menuchoice>
<guimenu>CTags</guimenu>
<guisubmenu>Lookup Current Text</guisubmenu>
</menuchoice></term>
<listitem>
<para>Opens the <guilabel>Lookup</guilabel> tab of the CTags view and displays all
language objects matching the current text selection in the list.</para>
</listitem>
</varlistentry>

<varlistentry id="ctags-gotodeclaration">
<term><menuchoice>
<guimenu>CTags</guimenu>
<guisubmenu>Go to Declaration</guisubmenu>
</menuchoice></term>
<listitem>
<para>If the cursor is in a definition object this will open the document
containing the corresponding declaration if needed, activate its view and
place the cursor at the start of the declaration.</para>
</listitem>
</varlistentry>

<varlistentry id="ctags-gotodefinition">
<term><menuchoice>
<guimenu>CTags</guimenu>
<guisubmenu>Go to Definition</guisubmenu>
</menuchoice></term>
<listitem>
<para>If the cursor is in a declaration object this will open the document
containing the corresponding definition if needed, activate its view and
place the cursor at the start of the definition.</para>
</listitem>
</varlistentry>

</variablelist>

<!--context menu with Lookup Current Text, Goto Declaration, Goto Definition -->

</sect2>

</sect1>

<sect1 id="kate-application-plugin-documentswitcher">

<title>Document Switcher Plugin</title>

<sect2 id="documentswitcher-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="view-documentswitcher">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;&Tab;</keycombo>
</shortcut>
<guimenu>View</guimenu>
<guisubmenu>Last Used Views</guisubmenu>
</menuchoice></term>
<listitem>

<para><action>Opens</action> a list with the last viewed documents:</para>

<screenshot id="screenshot-documentswitcher">
<screeninfo>Last viewed documents</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="documentswitcher.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Keep the shortcut <keycombo action="simul">&Ctrl;&Tab;</keycombo> pressed and
can use the <keysym>Up</keysym>, <keysym>Down</keysym>, <keycap>Home</keycap> or
<keycap>End</keycap> keys to navigate in the list. Pressing a char key consecutively
will cycle through all items with the first matching in the list.
If you release the shortcut keys the view will switch to the selected document in the list.
</para>
</listitem>
</varlistentry>
</variablelist>

</sect2>

</sect1>


<sect1 id="kate-application-plugin-fsbrowser">

<title>Filesystem Browser</title>

<para>The Filesystem Browser is a folder viewer, allowing you to open
files from a displayed folder in the current frame.</para>

<sect2 id="fsbrowser-menu">
<title>Menu Structure</title>
<variablelist>

<varlistentry id="view-toolviews-show-filebrowser">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Filesystem Browser</guimenuitem>
</menuchoice></term>
<listitem>
<para>Toggle the display of &kate;'s Filesystem Browser.</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="fsbrowser-interface">
<title>Interface</title>

<para>From the top down, the Filesystem Browser consists of the following
elements:</para>

<variablelist>
<varlistentry>
<term>A Toolbar</term>
<listitem>
<para>This contains standard navigations tool buttons:</para>
<variablelist>
<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-previous-22.png" format="PNG"/></imageobject></inlinemediaobject> Back</guiicon></term>
<listitem><para>Causes the folder view to <command>cd</command> to the previously displayed folder in the history.
This button is disabled, if there is no previous item.</para></listitem>
</varlistentry>
<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-next-22.png" format="PNG"/></imageobject></inlinemediaobject> Forward</guiicon></term>
<listitem><para>Causes the folder view to <command>cd</command> to the next folder in the history.
This button is disabled, if there is no next folder.</para></listitem>
</varlistentry>
<!--varlistentry>
<term><guibutton>Parent Folder</guibutton></term>
<listitem><para>This will cause the folder view to <command>cd</command> to the immediate parent of the currently displayed
folder if possible.</para></listitem>
</varlistentry-->
<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="bookmarks-22.png" format="PNG"/></imageobject></inlinemediaobject> Bookmarks</guiicon></term>
<listitem><para>Opens a submenu to edit or add bookmarks and to add a new bookmark folder.</para></listitem>
</varlistentry>
<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="system-switch-user-22.png" format="PNG"/></imageobject></inlinemediaobject> Current Document Folder</guiicon></term>
<listitem><para>This button will cause the folder view to
<command>cd</command> to the folder of the currently active
document if possible. This button is disabled, if the active document
is a new, unsaved file, or the folder in which it resides can not
be decided.</para></listitem>
</varlistentry>
<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject> Options</guiicon></term>
<listitem>
<variablelist>
<varlistentry>
<term><guimenuitem>Short View</guimenuitem></term>
<listitem><para>Displays only the filenames.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Detailed View</guimenuitem></term>
<listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel> and
<guilabel>Size</guilabel> of the files.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Tree View</guimenuitem></term>
<listitem><para>Like Short View, but folders can be expanded to view their contents.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Detailed Tree View</guimenuitem></term>
<listitem><para>This also allows folders to be expanded, but displays the additional columns
available in Detailed View.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Show Hidden Files</guimenuitem></term>
<listitem><para>Displays files normally hidden by your &OS;.</para></listitem>
</varlistentry>
<varlistentry>
<term><guimenuitem>Automatically synchronize with current document</guimenuitem></term>
<listitem><para>When this option is enabled the filesystem browser will automatically <command>cd</command>
to the folder of the document currently open in the editing area every time it changes.</para></listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>

<varlistentry>
<term>A Location Entry</term>
<listitem>
<para>This displays a breadcrumb navigation to the currently open folder, similarly to
&dolphin;.  You can click on a any folder to browse to it, or click on one of the
arrows to the left of a folder to select any folders beneath it.  You may also
select from your list of Places by clicking the leftmost icon in the breadcrumb
navigation, which displays an icon that represents your current Place.</para>

<para>You can also click to the right of the breadcrumbs to change them to a text box
where you can type the path of a folder to browse. The &URL;
entry maintains a list of previously typed paths. To choose one, use
the arrow button to the right of the entry.</para>
<tip><para>The &URL; entry has folder auto-completion. The completion
method can be set using the &RMB; menu of the text
entry.</para></tip>
</listitem>
</varlistentry>

<varlistentry>
<term>A Folder View</term>
<listitem><para>This is a standard &kde; folder view.</para></listitem>
</varlistentry>

<varlistentry>
<term>A Filter Entry</term>
<listitem>
<para>The Filter entry allows you to enter a filter for the files
displayed in the folder view. The filter uses standard globs; patterns
must be separated by white space. Example: <userinput>*.cpp *.h
*.moc</userinput></para>
<para>To display all files, enter a single asterisk
<userinput>*</userinput>.</para>
<para>The filter entry saves the last 10 filters entered between
sessions.  To use one, press the arrow button on the right of the entry
and select the desired filter string.  You can disable the filter by pressing
the <guibutton>Clear text</guibutton> button to the left of the autocompletion
arrow button.</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>


<sect2 id="fsbrowser-config">
<title>Configuration</title>

<para>This plugin can be configured on the <guilabel>Filesystem Browser</guilabel> page
of <link linkend="configuring-kate-configdialog">&kate;'s configuration</link>.</para>

<variablelist>
<varlistentry>
<term><guilabel>Toolbar</guilabel></term>
<listitem><para>Configure the buttons on the Filesystem Browser toolbar
by moving the ones you want enabled to the <guilabel>Selected Actions</guilabel>
list, and order them using the arrow buttons at the side of the list.</para>
 </listitem>
</varlistentry>

</variablelist>
</sect2>
</sect1>

<sect1 id="kate-application-plugin-documents">
<title>The Documents List</title>
<!-- https://kate-editor.org/2010/09/12/kate-tree-view-plugin-update/-->
<sect2 id="documents-intro">
<title>Introduction</title>

<para><indexterm><primary>Documents list</primary></indexterm>
The documents list displays a list of all documents currently open in
&kate;. Modified files will have a small <guiicon>floppy
disk</guiicon> icon on their left to indicate that state.</para>

<para>On the top the Documents list has a toolbar with the following buttons:</para>

<simplelist>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Create new document</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-open-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Open an existing document</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Previous Document</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="go-down-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Next Document</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Save the current document</member>
<member>
<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-as-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
Save the current document under a new name</member>
</simplelist>

<para>By default, the Documents list appears in
<guimenuitem>Tree Mode</guimenuitem>, which displays the folder structure
surrounding all currently open documents. Also available is
<guimenuitem>List Mode</guimenuitem>, which displays a simple list of all
open documents. You can switch modes by right-clicking on the list and selecting
from the <guisubmenu>View Mode</guisubmenu> menu.</para>

<para>If two or more files with the same name (located in different
folders) are open in <guimenuitem>List Mode</guimenuitem>, the names of the second will be prepended
<quote>(2)</quote> and so on. The tool-tip for the file will
display its full name including the path, allowing you to choose the
desired one.</para> <para>To display a document in the currently
active frame, click the document name in the list.</para>

<para>The context menu has some common actions from the <guimenu>File</guimenu> menu.</para>

<para>Additionally there are filemanager actions to rename or delete the file. With
<guimenuitem>Copy Filename</guimenuitem> you can copy the full path of the document
to the clipboard.</para>

<para>You can sort the list in a few different ways by right clicking the
list and selecting from the <guisubmenu>Sort By</guisubmenu> menu.

The options are:
<variablelist>

<varlistentry>
<term><guimenuitem>Document Name</guimenuitem></term>
<listitem><para>Lists the documents alphabetically by their name.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>Document Path</guimenuitem></term>
<listitem><para>Lists the documents alphabetically by the path to them.</para></listitem>
</varlistentry>

<varlistentry>
<term><guimenuitem>Opening Order</guimenuitem></term>
<listitem><para>Lists the documents in the order of opening.</para></listitem>
</varlistentry>

</variablelist>

</para>

<para>The document list will per default visualize your history by shading the
entries for the most recent documents with a background color. If the document
was edited, an extra color is blended in. The most recent document has the
strongest color, so that you can easily find the documents you are working on.
This feature can be disabled in the
<link linkend="config-dialog-documents">Documents</link> page
of the configuration dialog.</para>
<para>The default location of the document list in the &kate; window is to the left of the
editing area.</para>

</sect2>

<sect2 id="documents-menus">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="view-document-previous">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Alt;<keysym>Up</keysym></keycombo>
</shortcut>
<guimenu>View</guimenu>
<guimenuitem>Previous Document</guimenuitem>
</menuchoice></term>
<listitem>
<para>Opens the document displayed above the currently open document in the Documents list.</para>
</listitem>
</varlistentry>

<varlistentry id="view-document-next">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Alt;<keysym>Down</keysym></keycombo>
</shortcut>
<guimenu>View</guimenu>
<guimenuitem>Next Document</guimenuitem>
</menuchoice></term>
<listitem>
<para>Opens the document displayed below the currently open document in the Documents list.</para>
</listitem>
</varlistentry>

<varlistentry id="view-active">
<term><menuchoice>
<guimenu>View</guimenu>
<guimenuitem>Show Active</guimenuitem>
</menuchoice></term>
<listitem>
<para>Displays the currently open document in the Documents list.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="config-dialog-documents">
<title>Configuration</title>

<variablelist>
<varlistentry>
<term><guilabel>Background Shading</guilabel></term>
<listitem><para>This section allows you to enable or disable the background
shading visualization of your recent activity, and choose which colors to use if
enabled.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Sort By</guilabel></term>
<listitem><para>Set how you want the document list sorted. This can be set
from the &RMB; menu in the document list as well.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>View Mode</guilabel></term>
<listitem><para>This provides two options that effect the display of the
Documents tool view.  The <guilabel>Tree View</guilabel> option will display
the documents in a tree underneath the folders they are in, while the
<guilabel>List View</guilabel> option will display a flat list of documents.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Show Full Path</guilabel></term>
<listitem><para>When Tree View and this option are enabled, the folder entries
displayed in the Documents tool view will display the full filesystem path to
the folder in addition to the name of the folder.  It has no effect in List
View.</para></listitem>
</varlistentry>

</variablelist>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-gdb">
<!--http://kate-editor.org/2011/06/23/kate-plugin-updates-part-2/-->
<sect1info>
<authorgroup>
<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>&gdb; Plugin</title>

<sect2 id="gdb-intro">
<title>Introduction</title>

<para>&kate;'s &gdb; plugin provides a simple frontend to the popular &GNU;
Project Debugger.</para>

<important>
<para>Previous experience with &gdb; is strongly recommended.  For more
information on using &gdb;, visit <ulink url="http://www.gnu.org/s/gdb/">the
&gdb; website</ulink>.</para>
</important>

<para>You can enable the &gdb; plugin in
<link linkend="config-dialog-plugins">the Plugins section of &kate;'s
configuration</link>.</para>

<para>For the plugin to work properly, you must have a source file (of any type
supported by &gdb;) and an executable.</para>

<tip>
<para>If you compile using &gcc;/<command>g++</command> you might want to use
the <command><parameter>-ggdb</parameter></command> command line argument.
</para>
</tip>

<para>After these preparations are made, open the source file in &kate;,
enter the path to the executable in the <guilabel>Settings</guilabel> tab of the
<guilabel>Debug View</guilabel> tool view, and select
<menuchoice><guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem></menuchoice>
from the menu to get started.</para>

</sect2>

<sect2 id="gdb-menus">
<title>Menu and Toolbar Structure</title>

<para>All of these options are available in &kate;'s menus, and many are
available on the Debug toolbar as well.</para>

<variablelist>

<varlistentry id="gdb-menus-show-debug-view">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Debug View</guimenuitem>
</menuchoice></term>
<listitem><para>Shows a tool view containing &gdb; output, the &gdb; command
line used, and other settings.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-show-locals-and-stack">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Locals and Stack</guimenuitem>
</menuchoice></term>
<listitem><para>Shows a list of all currently loaded variables and their values and a &gdb; backtrace.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-targets">
<term><menuchoice>
<guimenu>Debug</guimenu><guisubmenu>Targets</guisubmenu>
</menuchoice></term>
<listitem><para>A submenu containing a list of targets (executables).
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-start">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Starts &gdb; with a target.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-kill">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Kill / Stop Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Stops &gdb;.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-restart">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Restart Debugging</guimenuitem>
</menuchoice></term>
<listitem><para>Restarts &gdb;.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-break">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Toggle Breakpoint / Break</guimenuitem>
</menuchoice></term>
<listitem><para>Set a breakpoint at the current cursor position.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-in">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step In</guimenuitem>
</menuchoice></term>
<listitem><para>Execute the present statement (function call will be debugged).
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-over">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step Over</guimenuitem>
</menuchoice></term>
<listitem><para>Execute the present statement (function call will not be
debugged).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-step-out">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Step Out</guimenuitem>
</menuchoice></term>
<listitem><para>Resumes execution until the program that is executing
terminates.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-move-pc">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Move PC</guimenuitem>
</menuchoice></term>
<listitem><para>Move program counter (next execution).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-run-to-cursor">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Run To Cursor</guimenuitem>
</menuchoice></term>
<listitem><para>Runs the program until it reaches current cursor position.
</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-continue">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Continue</guimenuitem>
</menuchoice></term>
<listitem><para>Ignores any breakpoints and executes program until it terminates
(successfully or not).</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-print-value">
<term><menuchoice>
<guimenu>Debug</guimenu><guimenuitem>Print Value</guimenuitem>
</menuchoice></term>
<listitem><para>Prints the value of the variable that the cursor is currently
pointing to.</para></listitem>
</varlistentry>

<varlistentry id="gdb-menus-toolbar">
<term><menuchoice>
<guimenu>Settings</guimenu><guisubmenu>Toolbars Shown</guisubmenu><guimenuitem>&gdb; Plugin</guimenuitem>
</menuchoice></term>
<listitem><para>Display the debugging toolbar.</para></listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="gdb-debug-view">
<title>Debug View</title>

<para>The <guilabel>Debug View</guilabel> tool view consists of several tabs:
</para>

<variablelist>

<varlistentry>
<term><guilabel>&gdb; Output</guilabel></term>
<listitem>
<para>Contains output from &gdb; and a &gdb; command line.</para>

<screenshot id="screenshot-gdb-output">
<screeninfo>The Output Tab</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-output.png" format="PNG"/></imageobject>
<textobject><phrase>The Output tab.</phrase></textobject>
<caption><para>The <guilabel>Output</guilabel> tab displaying the output from a
debugging session.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Settings</guilabel></term>
<listitem>
<variablelist>

<varlistentry>
<term><guilabel>Executable</guilabel></term>
<listitem><para>Path to the target (executable) for debugging.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Working Directory</guilabel></term>
<listitem><para>The current working directory provided to the target.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Arguments</guilabel></term>
<listitem><para>Arguments passed to the program.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Keep focus</guilabel></term>
<listitem><para>Keeps focus on the &gdb; command line.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Redirect IO</guilabel></term>
<listitem><para>Opens a new <guilabel>IO</guilabel> tab in the <guilabel>Debug
View</guilabel> where you can view output and provide input to the running
program.</para></listitem>
</varlistentry>

</variablelist>

<screenshot id="screenshot-gdb-settings">
<screeninfo>The Settings dialog</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-settings.png" format="PNG"/></imageobject>
<textobject><phrase>The Settings dialog</phrase></textobject>
<caption><para>The <guilabel>Settings</guilabel> dialog displaying the configuration
of a debugging session.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>IO</guilabel></term>
<listitem>
<para>Contains an area that displays output from the running program and a
command line where you may provide input to it.</para>

<screenshot id="screenshot-gdb-io">
<screeninfo>The IO Tab</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-io.png" format="PNG"/></imageobject>
<textobject><phrase>The IO tab.</phrase></textobject>
<caption><para>The <guilabel>IO</guilabel> tab displaying output from a simple
test program.</para></caption>
</mediaobject>
</screenshot>

</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="gdb-other">
<title>Call Stack and Locals</title>

<para>The <guilabel>Call Stack</guilabel> tool view contains a list of the formatted
backtrace returned from &gdb;.</para>

<screenshot id="screenshot-gdb-call-stack">
<screeninfo>The &gdb; Call Stack Tool View</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-call-stack.png" format="PNG"/></imageobject>
<textobject><phrase>The Call Stack tool view.</phrase></textobject>
<caption><para>The &gdb; Plugin's <guilabel>Call Stack</guilabel> tool view.
</para></caption>
</mediaobject>
</screenshot>

<para>The <guilabel>Locals</guilabel> tool view contains a list of all currently
loaded variables from the program and their corresponding values.</para>

<screenshot id="screenshot-gdb-locals">
<screeninfo>The &gdb; Locals Tool View</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="gdb-locals.png" format="PNG"/></imageobject>
<textobject><phrase>The Locals tool view.</phrase></textobject>
<caption><para>The &gdb; Plugin's <guilabel>Locals</guilabel> tool view.
</para></caption>
</mediaobject>
</screenshot>

</sect2>

<sect2 id="gdb-ack">
<title>Thanks and Acknowledgments</title>

<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
writing much of this section.</para>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-lumen">
<!-- https://kate-editor.org/2014/02/20/lumen-a-code-completion-plugin-for-the-d-programming-language/ -->
<title>Lumen Plugin</title>

<para>Lumen is a plugin providing code-completion for the <ulink url="https://en.wikipedia.org/wiki/D_(programming_language)">
D programming language</ulink>. It is just a connection between the editor and the D Completion
Daemon (a server providing all the information) called DCD. The plugin currently supports
all major features of the completion server: feeding the server with import files,
displaying documentation and several types of completion:
</para>

<para>Imports:</para>
<screenshot id="screenshot-lumen-import">
<screeninfo>Imports</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="lumen-import.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Basic Completion:</para>
<screenshot id="screenshot-lumen-completion">
<screeninfo>Basic Completion</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="lumen-completition.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Completion (overloaded Function):</para>
<screenshot id="screenshot-lumen-completitionoverload">
<screeninfo>Completion (overloaded Function)</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="lumen-completition-overload.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Calltips:</para>
<screenshot id="screenshot-lumen-calltips">
<screeninfo>Calltips</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="lumen-calltips.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>To make Lumen work you have to install DCD, using the information provided by
the <ulink url="https://dlang.org/">D community</ulink>.
</para>

<para>After installing DCD edit <filename>~/.config/dcd/dcd.conf</filename> (create if it does not exist already)
and add a path to your D include/import files &eg; <filename class="directory">/usr/include/dlang/dmd</filename>
or <filename class="directory">/usr/include/d</filename>.
</para>

<para>Furthermore Lumen will try to read a <filename>.lumenconfig</filename> in every parent folder
of the currently opened D source file and add every line in this file as include path to the
DCD server. Add all dependencies of your current project to this file.
</para>

<para>Now start the completion server with <command>dcd-server</command>, enable the Lumen
plugin in your settings and you will have code completion for the D programming
language in &kate;
</para>

</sect1>


<sect1 id="kate-application-plugin-openheader">

<title>Open Header Plugin</title>

<sect2 id="openheader-using">
<title>Using the Open Header Plugin</title>

<para>When editing C or C++ code, this command will switch between a header file and
its corresponding C/C++ file or vice versa.</para>

<para>For example, if you are editing <filename>myclass.cpp</filename>, this action will change
to <filename>myclass.h</filename> if this file is available in the same folder.</para>

<para>Pairs of the following filename extensions will work:</para>

<simplelist>
<member>Header files: h, H, hh, hpp</member>
<member>Source files: c, cpp, cc, cp, cxx</member>
</simplelist>

</sect2>

<sect2 id="openheader-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="file-openheader">
<term><menuchoice>
<shortcut>
<keycap>F12</keycap>
</shortcut>
<guimenu>File</guimenu>
<guisubmenu>Open .h/.cpp/.c</guisubmenu>
</menuchoice></term>
<listitem>
<para><action>Open</action> the corresponding header or source files for the active document.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

</sect1>


<sect1 id="kate-application-plugin-projects">
<!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate -->

<title>Project Plugin</title>

<sect2 id="project-intro">
<title>Introduction</title>

<para>The basic idea of the Project plugin is to have a structured list of
files belonging to the project with the following properties:</para>

<orderedlist>
<listitem><para>Provide a structured view of the files</para></listitem>
<listitem><para>Make it easy and very fast to open and switch projects</para></listitem>
<listitem><para>Support search and replace for a project</para></listitem>
<listitem><para>Provide simple auto completion</para></listitem>
<listitem><para>Make it simple to quickly open files in the project</para></listitem>
<listitem><para>Support for building the project</para></listitem>
</orderedlist>
</sect2>

<sect2 id="project-view">
<title>Structured View of the Files</title>

<para>Once the Project plugin is loaded in the &kate; configuration page, open a file
in a project and a sidebar
appears that lists all projects as well as the project files as follows:</para>

<screenshot id="screenshot-project-view">
<screeninfo>Project View</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-view.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>As you can see, the currently active project is <quote>Kate</quote>, and its contents is
listed in the tree view. Clicking on files in the tree view opens the file in the
editor. Further, a context menu is provided with which you can open files with
other applications, such as a <filename class="extension">.ui</filename> file with Qt Designer.</para>
<para>You can filter the items by typing parts of the file name you are looking for into the search bar
at the bottom of the list.</para>
</sect2>

<sect2 id="project-switch">
<title>Switching Projects</title>

<para>The idea is that you never have to open a project manually, this is even not
supported at all. Hence, what happens if you open a file, the Project plugin quickly
scans the folder and its parent folders for a <filename>.kateproject</filename> file. If found, the project
is automatically loaded.</para>

<para>Furthermore, if you open another document in &kate;, that belongs to another project,
the Project plugin automatically switches the current project. So intuitively, always the
correct project is active. Of course, you can also switch the currently active project
using the combo box.</para>

</sect2>

<sect2 id="project-search-replace">
<title>Search and Replace in Projects</title>

<para>&kate; has a Search and Replace plugin that shows up in the
bottom sidebar. If a project is loaded, open the Search and Replace sidebar,
and switch to the mode to search and replace in the current project:</para>

<screenshot id="screenshot-projects-search">
<screeninfo>Search in Projects</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-search.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

</sect2>

<sect2 id="project-autocompletition">
<title>Simple Auto Completion</title>

<para>With the knowledge of all files belonging to a project, the Project plugin provides
simple auto completion facilities based on CTags. If a project is initially opened, CTags
parses all project files in a background thread and saves the CTags information to
<filename class="directory">/tmp</filename>. This file then is used to populate the auto
completion popup in &kate;.</para>

<para>In contrast, without this auto completion, &kate; is only capable of showing auto
completion items based on the words in the current file. So the auto completion provided
by the Project plugin is much more powerful.</para>

<screenshot id="screenshot-completion-search">
<screeninfo>Completion in Projects</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-completition.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>If CTags is missing, a passive popup warns you about this issue. It is also noteworthy,
that the CTags file in <filename class="directory">/tmp</filename> is cleaned up when &kate;
exits, so the plugin does not pollute any folder with unwanted files.</para>

</sect2>

<sect2 id="project-quickopen">
<title>Quick Opening Files</title>

<para>As clicking on files in the tree view is not the fastest way to open a file, &kate;
provides a built-in quick open mechanism you can activate with
<keycombo action="simul">&Ctrl;&Alt;<keycap>O</keycap></keycombo>.
What you the get is a list like this:</para>

<screenshot id="screenshot-project-quickopen">
<screeninfo>Quick Open</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-quickopen.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>You can filter by typing parts of the file name you are looking for, and you can
also navigate with the arrow keys and page up/down through the list.
Hitting &Enter; activates the selected file, while &Esc; hides the quick open view again.</para>

<para>Further, the quick open remembers the previous file. So when you change to the
quick open view the previously activated file is automatically selected and you just
need to hit &Enter;, which comes very handy at times.</para>

</sect2>

<sect2 id="project-build">
<title>Support for Building the Project</title>

<para>Another feature is to have support for the <link linkend="projects-build-support">Build Plugin</link>,
so that it automatically is configured correctly.</para>

</sect2>

<sect2 id="project-create">
<title>Creating Projects</title>

<sect3 id="project-autoload">
<!--https://kate-editor.org/2014/10/12/autoloading-projects-plugin-kate-5/-->
<title>Loading Projects Automatically</title>

<para>The Project plugin has an auto-loading feature. You can read the file list from
the version control system. To this end, auto-loading for the respective version control
system needs to be enabled in the settings (enabled by default):
</para>

<screenshot id="screenshot-project-configure">
<screeninfo>Project Plugin Configuration</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-configure.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

</sect3>

<sect3 id="project-manual">
<title>Creating Projects Manually</title>
<para>
You just have to create a <filename>.kateproject</filename> file in the root folder of the project.
For instance, the <quote>Kate</quote> <filename>.kateproject</filename> file looks like this:
</para>

<screen>
{
  "name": "Kate"
, "files": [ { "git": 1 } ]
}
</screen>

<para>The file content is written in JSON syntax. The project name is <quote>Kate</quote>, and
the files contained in should be read from git.
</para>

<para>
Also supported instead of <literal>git</literal> is subversion through <literal>svn</literal> and
mercurial through <literal>hg</literal>.
If you do not want to read from a version control system, you can tell it to recursively
load files from directories as follows:
</para>

<screen>
{
  "name": "Kate"
, "files": [ { "directory": "kate", "filters": ["*.cpp", "*.h", "*.ui", "CMakeLists.txt", "Find*.cmake"], "recursive": 1 } ]
}
</screen>

<para>
Here, subfolders and filters define what’s part of the project.
You can also mix version control and files based on filters.
</para>

<para id="projects-build-support">If you want to add support for the Build plugin, you could write a
<filename>.kateproject</filename> like this:</para>

<screen>
{
  "name": "Kate"
, "files": [ { "git": 1 } ]
, "build": {
    "directory": "build"
  , "build": "make all"
  , "clean": "make clean"
  , "install": "make install"
  }
}
</screen>

</sect3>

</sect2>

<sect2 id="project-current">
<title>Current Project</title>

<para>Using <menuchoice><shortcut><keycombo action="simul">&Alt;<keycap>1</keycap></keycombo></shortcut>
<guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem></menuchoice> you can open the
<guilabel>Current Project</guilabel> view at the bottom of the editor window with four tabs:</para>

<screenshot id="screenshot-project-current">
<screeninfo>Current Project</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="project-current-analysis.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<variablelist>

<varlistentry>
<term>
<guimenu>Terminal</guimenu>
</term>
<listitem>
<para>A <link linkend="kate-application-plugin-konsole">Terminal emulator</link> starting in the
root folder of the project.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<guimenu>Code Index</guimenu>
</term>
<listitem>
<para>Entering characters into the search bar will start the search and display matching names
of functions, classes, symbols &etc; together with kind, filename and line number.</para>
<para>Select an item in the list to jump to the corresponding line in the source file.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>
<guimenu>Code Analysis</guimenu>
</term>
<listitem>
<para>Click <guilabel>Start Analysis</guilabel> to run a static code analysis for the C and C++
using <command>cppcheck</command> and to generate a report showing filename, line number, severity
(style, warning &etc;) and the issue found.</para>
<para>Select an item in the list to jump to the corresponding line in the source file.</para>
</listitem>
</varlistentry>
<!--FIXME options for cppcheck? configurable?-->
<varlistentry>
<term>
<guimenu>Notes</guimenu>
</term>
<listitem>
<para>Text entered in this tab will be saved in the file
<filename><replaceable>projectname</replaceable>.kateproject.notes</filename>.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="projects-menu">
<title>The Projects Menu</title>

<para>The <guimenu>Projects</guimenu> menu allows you to switch between
currently open projects.  It is displayed by the Project plugin.</para>

<variablelist>

<!--FIXME: these shortcuts conflict with the preexisting Build plugin
            https://bugs.kde.org/show_bug.cgi?id=328170 -->

<varlistentry id="projects-back">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;&Alt;<keysym>Left</keysym></keycombo>
</shortcut>
<guimenu>Projects</guimenu>
<guimenuitem>Back</guimenuitem>
</menuchoice></term>
<listitem>
<para>Switch to the previous project.</para>
</listitem>
</varlistentry>

<varlistentry id="projects-forward">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;&Alt;<keysym>Right</keysym></keycombo>
</shortcut>
<guimenu>Projects</guimenu>
<guimenuitem>Forward</guimenuitem>
</menuchoice></term>
<listitem>
<para>Switch to the next project.</para>
</listitem>
</varlistentry>

<varlistentry id="projects-goto">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Alt;<keycap>1</keycap></keycombo>
</shortcut>
<guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem>
</menuchoice></term>
<listitem>
<para>Open the <guilabel>Current Project</guilabel> view at the bottom of the editor window.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>
<!--
context menu Project->Lookup:xxx
-->

</sect1>

<!--FIXME Replicode
Projects Replicode run / stop-->

<sect1 id="kate-application-plugin-rust">
<!--https://blogs.kde.org/2015/05/18/basic-code-completion-rust-kdes-kate-and-later-kdevelop
https://blogs.kde.org/2015/05/22/updates-kates-rust-plugin-syntax-highlighting-and-rust-source-mime-type-->
<title>Rust code completion Plugin</title>

<para>This plugin provides code completion for the <ulink url="https://www.rust-lang.org/">Rust</ulink>
programming language.</para>

<para>Once you have enabled the Rust code completion item in the plugin page, a new
page will appear in your &kate; configuration dialog.
</para>

<screenshot id="screenshot-rust-configuration">
<screeninfo>Rust Configuration</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="rust-configuration.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Edit the command to run <ulink url="https://github.com/phildawes/racer">Racer</ulink>,
an utility intended to provide Rust code completion for editors.</para>

<para>You also need the Rust source code and have to provide the path to the source tree.
</para>

<para>While typing code a popup list appears with items for completion:
</para>

<screenshot id="screenshot-rust-completion">
<screeninfo>Rust Completion</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="rust-completion.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>In addition to code completion popups, the plugin also installs
a <guimenuitem>Go to Definition</guimenuitem> action in the <guimenu>Edit</guimenu> menu and
in the context menu. You can configure a keyboard shortcut for it as well.
</para>

<para>This action will open the document containing the definition if needed, activate
its view and place the cursor at the start of the definition.
</para>

</sect1>

<sect1 id="kate-application-plugin-searchinfiles">
<sect1info>
<authorgroup><author>
&TC.Hollingsworth; &TC.Hollingsworth.mail;
</author></authorgroup>
</sect1info>
<title>Search &amp; Replace</title>

<sect2 id="searchinfiles-intro">
<title>Introduction</title>
<para>&kate;'s Search &amp; Replace plugin allows you to search for text or
<ulink url="help:/katepart/regular-expressions.html">regular expressions</ulink>
in many different files at once.  You can search all open files, all the files
in one directory and optionally its subdirectories, or in the active file.
You can even filter by filename, for instance searching only files
that end with a particular file extension.</para>

</sect2>

<sect2 id="searchinfiles-ui">
<title>Interface</title>

<sect3 id="searchinfiles-ui-query">
<title>Search Query</title>

<para>The following options are always displayed at the top of the Search in
Files tool view:</para>

<variablelist>

<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="tab-new-22.png" format="PNG"/>
</imageobject></inlinemediaobject></guiicon></term>
<listitem><para>
You can have as many searches as you want open at the same time.  Simply click
the new tab button at the top-left corner of the Search
tool view and a new results tab will open permitting you to perform another
search.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
</imageobject></inlinemediaobject></guiicon></term>
<listitem><para>
The button in the top right-corner of the Search in Files tool view will
toggle the bottom half of the tool view between displaying additional options
for the Search in Folder mode and the results of your search.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Find</guilabel></term>
<listitem><para>
This is where you type in what you want to find.  You may enter standard text,
or a regular expression if enabled.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Replace</guilabel> (text box)</term>
<listitem><para>
Replacement text that will be added to file(s) in place of the text in the
<guilabel>Find</guilabel> text box.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Search</guibutton></term>
<listitem><para>
When you've finished configuring everything, just press the
<guibutton>Search</guibutton> button to perform your search.  You may also press
&Enter; in the <guilabel>Find</guilabel> text box to do the same.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Replace</guibutton></term>
<listitem><para>
When you've finished configuring everything, just press the
<guibutton>Replace</guibutton> button to replace the text entered in the
<guilabel>Find</guilabel> text box with that of the <guilabel>Replace</guilabel>
text box.  You may also press &Enter; in the <guilabel>Replace</guilabel> text
box to do the same.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Next</guibutton></term>
<listitem><para>
Go to the next match of your search query, switching files if necessary.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Replace Checked</guibutton></term>
<listitem><para>
The same as <guibutton>Replace</guibutton>, but will only perform replacements
in files that are checked in the pane below.
</para></listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="searchinfiles-ui-folder">
<title>Search in Folder Options</title>

<para>These options are displayed below the aforementioned query options. If search
results are being displayed instead, press the <guiicon><inlinemediaobject><imageobject>
<imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
button to display them.</para>

<variablelist>

<varlistentry>
<term><guilabel>Search in</guilabel></term>
<listitem><para>
This has three options.  Select <guilabel>Open Files</guilabel> to search all
files currently open in &kate;.  Select <guilabel>Folder</guilabel> to
search inside a folder and optionally its subfolders.  Select <guilabel>Current
File</guilabel> to search only in the active file.
</para>
<para>If the <guilabel>Projects</guilabel> plugin is loaded, you can also search in
the <guilabel>Current Project</guilabel> or in <guilabel>All Open Projects</guilabel>.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Match case</guilabel></term>
<listitem><para>
Restricts search results to only those that have the exact same combination
of upper and lower case letters as your search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Regular expressions</guilabel></term>
<listitem><para>
Permits you to use <ulink url="help:/katepart/regular-expressions.html">regular
expressions</ulink> instead of simple text as your search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Expand results</guilabel></term>
<listitem><para>
Display all the results found in each file, instead of just a list of files
that contain the search query.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Folder</guilabel></term>
<listitem><para>
You may enter the path of the folder you wish to search.  For instance, you might
enter <userinput>~/development/kde/kate/</userinput> if you wished to search the
&kate; source code.  This option is only available when using
<guilabel>in Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon>Open file dialog</guiicon></term>
<listitem><para>
Press this button to locate the folder in your desktop's folder browser. This
button only works when using <guilabel>Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/>
</imageobject></inlinemediaobject></guiicon></term>
<listitem><para>
Press this button to change <guilabel>Folder</guilabel> to the parent of the
currently selected folder. This button only works when using
<guilabel>Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="view-refresh-22.png" format="PNG"/>
</imageobject></inlinemediaobject></guiicon></term>
<listitem><para>
This button will set the <guilabel>Folder</guilabel> entry to the folder in which
the currently open document is located. This button only works when using
<guilabel>Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Filter</guilabel></term>
<listitem><para>
This permits you to only search filenames that match a particular pattern. For
instance, to only search files written in C++, change it to
<userinput>*.cpp</userinput>.  To search only files beginning with
<literal>kate</literal>, change it to <userinput>kate*</userinput>. You can
enter multiple filters separated with a comma (<userinput>,</userinput>). This
option is not available when using <guilabel>Open files</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Exclude</guilabel></term>
<listitem><para>
The opposite of <guilabel>Filter</guilabel>, this prevents &kate; from
searching files that match the specified patterns. As with
<guilabel>Filter</guilabel>, you can enter multiple patterns separated with a
comma (<userinput>,</userinput>). This option is not available when using
<guilabel>Open files</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Recursive</guilabel></term>
<listitem><para>
If this option is enabled, &kate; will also search in all subfolders of the
selected folder. This option is only available when using
<guilabel>Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Include hidden</guilabel></term>
<listitem><para>
If this option is enabled, &kate; will also search in files or folders that
are typically hidden by your &OS;. This option is only available when using
<guilabel>Folder</guilabel> mode.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Follow symbolic links</guilabel></term>
<listitem><para>
The Search in Files plugin typically does not follow
<ulink url="http://en.wikipedia.org/wiki/Symbolic_link">symbolic links</ulink>.
When this option is enabled, the plugin will follow them instead and search inside
the files or folders they reference. This option is only available when using
<guilabel>Folder</guilabel> mode.
</para>
<warning><para>It's possible for symbolic links to reference a folder that is the
parent of the folder currently being searched, or other folders that contain
symbolic links to their parent.  If there is such a link in the folder being
searched and this option is enabled, &kate; will repeatedly follow the link
and search the folder, and the search will never complete.</para></warning>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Include binary files</guilabel></term>
<listitem><para>
If enabled, &kate; will also search in files that do not appear to be text
files.
</para></listitem>
</varlistentry>

</variablelist>
</sect3>

<sect3 id="searchinfiles-ui-results">
<title>Search Results</title>

<para>The results of your search are displayed below the query options.  If
options for Search in Folder mode are displayed, simply press the
<guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
</imageobject></inlinemediaobject></guiicon>
button to display them.  They will also
automatically be displayed as soon as a search is performed.</para>

<para>The search results display a list of files that contains text that matches
your search query, followed by the number of matches found in that file.</para>

<para>To see a list of matches in that file, simply click the expansion arrow
to the left of the file name.  (If you selected the <guilabel>Expand
results</guilabel> option, this will already be done for you.)  The line number
each match is found on will be displayed, followed by the contents of that line,
with your search query indicated in bold text.</para>

<para>To open the file your result was found in, simply double-click it.  &kate;
will open the file if needed.  You can also move the cursor to the location of
a particular match by double-clicking on its listing instead of the file name.
</para>

</sect3>
</sect2>

<sect2 id="searchinfiles-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="edit-searchinfiles">
<term><menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Search in Files</guimenuitem>
</menuchoice></term>
<listitem>
<para>Launches the Search and Replace tool view.</para>
</listitem>
</varlistentry>

<varlistentry id="edit-next-match">
<term><menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Go to Next Match</guimenuitem>
</menuchoice></term>
<listitem>
<para>Go to the next match in a search performed by the Search and Replace
plugin.</para>
</listitem>
</varlistentry>

<varlistentry id="edit-previous-match">
<term><menuchoice>
<guimenu>Edit</guimenu>
<guimenuitem>Go to Previous Match</guimenuitem>
</menuchoice></term>
<listitem>
<para>Go to the previous match in a search performed by the Search and Replace
plugin.</para>
</listitem>
</varlistentry>

<varlistentry id="view-toolviews-searchandreplace">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Search and Replace</guimenuitem>
</menuchoice></term>
<listitem>
<para>Toggle the display of &kate;'s <guilabel>Search and Replace</guilabel> tool.
</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>
</sect1>

<sect1 id="kate-application-plugin-snippets">
<sect1info>
<authorgroup>
<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>Kate Snippets</title>

<sect2 id="snippets-intro">
<title>Introduction</title>
<para>Kate Snippets is a plugin used to save you some time by adding support for
so-called <quote>snippets</quote> (re-usable source code, machine code or text). The plugin
also supports code completion and JavaScript.</para>
</sect2>

<sect2 id="snippets-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term><menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Snippets</guimenuitem></menuchoice></term>
<listitem><para>Shows snippets panel containing all snippets in your repository
that are for the currently opened file type.</para></listitem>
</varlistentry>

<varlistentry id="tools-create-snippet">
<term><menuchoice>
<guimenu>Tools</guimenu>
<guimenuitem>Create Snippet</guimenuitem>
</menuchoice></term>
<listitem>
<para>Create a new snippet, which is a reusable chunk of text you
may insert in any part of any document.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="snippets-panel">
<title>Snippets panel</title>

<screenshot id="screenshot-snippets-panel">
<screeninfo>Kate Snippets Panel</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-panel.png" format="PNG"/></imageobject>
<textobject><phrase>The &kate; snippets panel.</phrase></textobject>
<caption><para>The panel for &kate; Snippets.</para></caption>
</mediaobject>
</screenshot>

<para>In the panel you should see a list of snippet repositories,
along with options to create your own, get them from the Internet or load
them from a local file.  Each repository has a checkbox that can be used to
activate or deactivate it.  There are also buttons to edit and delete existing
repositories.</para>

<sect3 id="snippets-repo-internet">
<title>Loading Snippet Repository Files</title>
<para>You can download snippet repositories from the Internet.  Just click
<guibutton>Get New Snippets</guibutton> and a window with a list of snippet
repositories will open.  After downloading the desired snippet, make sure that
you have activated it.</para>
<!--FIXME no way to load a local file ?
<para>You can also load snippet repositories from a local file using the file
browser at the bottom of the panel.  Click <guibutton>Copy to repository</guibutton>
when finished.</para>-->
</sect3>

<sect3 id="snippets-repo-editor">
<title>Creating and Editing Repositories</title>

<para>To create a new snippet repository, click <guibutton>Add Repository</guibutton>.
You should now see a dialog that asks for the name of the snippet file, license and
author. After choosing the desired options, click <guibutton>OK</guibutton>.</para>

<screenshot id="screenshot-snippets-repository">
<screeninfo>Snippet Editor</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-repository.png" format="PNG"/></imageobject>
<textobject><phrase>The repository editor.</phrase></textobject>
<caption><para>The repository editor interface.</para></caption>
</mediaobject>
</screenshot>

<para>The snippet repository editor contains the following options:</para>

<variablelist>

<varlistentry>
<term><guilabel>Name</guilabel></term>
<listitem><para>Appears in the list of snippets in the tool view and is also
searched when using the code completion feature.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Namespace</guilabel></term>
<listitem><para>Prefix used while using code completion.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>License</guilabel></term>
<listitem><para>Select the license for you snippet repository.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Authors</guilabel></term>
<listitem><para>Enter the name(s) of the author(s) of the snippet file.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>File types</guilabel></term>
<listitem><para>Select the file type(s) you want the snippet repository to apply
to.  It is set to <quote></quote> by default, so the repository applies to all files. You
can change it to something like <userinput>C++</userinput> for instance, or select
from a list by clicking on the items.  You can specify more
than one file type pressing the &Shift; while adding types.</para></listitem>
</varlistentry>

</variablelist>

</sect3>

<sect3 id="snippets-editor">
<title>Creating and Editing Snippets</title>

<screenshot id="screenshot-snippets-form">
<screeninfo>Snippet Editor</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-form.png" format="PNG"/></imageobject>
<textobject><phrase>The snippet editor.</phrase></textobject>
<caption><para>The snippet editor interface.</para></caption>
</mediaobject>
</screenshot>

<variablelist>

<varlistentry>
<term><guilabel>Name</guilabel></term>
<listitem><para>The name will be shown in the completion list.</para></listitem>
</varlistentry>

<varlistentry>
<term>Shortcut</term>
<listitem><para>Pressing this shortcut will insert the snippet into the document.</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Snippets</guilabel></term>
<listitem><para>The text your snippet will insert into the document.</para>
<para>A snippet can contain editable fields. They can be cycled by
pressing &Tab;. The following expressions can be used in the template
text to create fields:</para>
<para><userinput>${<replaceable>field_name</replaceable>}</userinput> creates a
simple, editable field. All subsequent occurrences of the same
<replaceable>field_name</replaceable> create fields which mirror the contents
of the first during editing.</para>
<para><userinput>${<replaceable>field_name=default</replaceable>}</userinput>
can be used to specify a default value for the field.
<replaceable>default</replaceable> can be any JavaScript expression.</para>
<para>Use <userinput>${<replaceable>field_name</replaceable>=<replaceable>text</replaceable>}</userinput>
to specify a fixed string as default value.</para>
<para><userinput>${func(<replaceable>other_field1</replaceable>,
<replaceable>other_field2</replaceable>, ...)}</userinput> can be used to create a
field which evaluates a JavaScript function on each edit and contains its
contents. See the <guilabel>Scripts</guilabel> tab for more information.</para>
<para><userinput>${cursor}</userinput> can be used to mark the end position
of the cursor after everything else was filled in.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Scripts</guilabel></term>
<listitem><para>JavaScript helper functions to use in your snippets.</para>
<para>All JavaScript functions should return the contents you want to place in a
template field as a string.</para>
<para>Functions are called in a scope which contains the contents of all
editable template fields as local variables. For example in a snippet
containing <userinput>${<replaceable>field</replaceable>}</userinput>,
a variable called <userinput>field</userinput> will be present which contains
the up-to-date contents of the template field. Those variables can either
be used in the function statically or passed as arguments, by using the
<userinput>${func(field)}</userinput> or <userinput>${<replaceable>field2=func(field)</replaceable>}</userinput>
syntax in the snippet string.</para>
<para>You can use
the &kate; scripting API to get the selected text, full text, file name and
more by using the appropriate methods of the <userinput>document</userinput>
and <userinput>view</userinput> objects. Refer to the scripting API
documentation for more information</para>
</listitem>
</varlistentry>

</variablelist>
</sect3>
</sect2>

<sect2 id="snippets-using">
<title>Using Snippets</title>

<screenshot id="screenshot-snippets-usage">
<screeninfo>Kate Snippets in Action</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="snippets-usage.png" format="PNG"/></imageobject>
<textobject><phrase>Accessing &kate; Snippets from a tool view and a drop down menu.</phrase></textobject>
<caption><para>Selecting from a list of snippets.</para></caption>
</mediaobject>
</screenshot>

<para>You can call snippets in two ways:</para>

<itemizedlist>
<listitem><para>By choosing the snippet from the tool view.</para></listitem>
<listitem><para>While writing, you can press <keycombo action="simul">&Ctrl;
<keysym>Space</keysym></keycombo>, which will display all the snippets in a
convenient window from which you can choose.  This key combination provides
functionality similar to code completion.</para></listitem>
</itemizedlist>

<para>If the snippet contains variables (besides <literal>${cursor}</literal>)
the cursor will automatically go to the first occurrence of a variable and will
wait for you to write something. When you are done, you can press &Tab; to move
to the next variable, and so on.</para>

</sect2>

<sect2 id="snippets-ack">
<title>Thanks and Acknowledgments</title>
<para>&kate; Snippets was written by Joseph Wenninger.</para>
<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
writing much of this section.</para>
</sect2>

</sect1>


<sect1 id="kate-application-plugin-sql">
<sect1info>
<authorgroup>
<author><firstname>Ömer</firstname> <othername>Faruk</othername> <surname>ORUÇ</surname></author>
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
</authorgroup>
</sect1info>
<title>SQL Plugin</title>

<sect2 id="sql-intro">
<title>Introduction</title>

<para>The Structured Query Language (SQL) is a specialized language for updating,
deleting, and requesting information from databases.</para>

<para>The &kate; SQL Plugin allows you to:</para>

<itemizedlist>
<listitem><para>Create a database</para></listitem>
<listitem><para>Connect to existing databases</para></listitem>
<listitem><para>Insert and delete data in the database</para></listitem>
<listitem><para>Execute queries</para></listitem>
<listitem><para>Display results in a table</para></listitem>
</itemizedlist>

</sect2>

<sect2 id="sql-connecting">
<title>Connecting to a Database</title>

<para>Select <guibutton>Add Connection</guibutton> from the <guimenu>SQL</guimenu>
menu or toolbar, and then select the Qt database driver you want to use (including
QSQLITE, QMYSQL3, QMYSQL, QODBC3, QODBC, QPSQL7, and QPSQL).  If you can't see
the desired driver, you need to install it.  Then, press <guibutton>Next</guibutton>.
</para>

<para>If the database you selected uses a file, simply indicate the database's
location and press the <guibutton>Next</guibutton> button.  If it requires connecting
to a server, you must enter the hostname of the server, your username and password,
and any other information that particular driver may require. Then press
<guibutton>Next</guibutton>.</para>

<para>Finally, give a name to your connection, and press <guibutton>Finish</guibutton>.</para>

</sect2>

<sect2 id="sql-querying">
<title>Running Queries</title>

<sect3 id="sql-querying-insert-delete-update">
<title>INSERT/DELETE/UPDATE</title>

<para>You can insert, delete, and update data using the SQL plugin just as
you would from the command line or from within a program.  Simply enter a query
and press the <guibutton>Run query</guibutton> button in the toolbar or
use <menuchoice><guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem></menuchoice>
(<keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo>).</para>

<example>
<title>Some Example Queries</title>
<variablelist>

<varlistentry>
<term><command>INSERT</command></term>
<listitem><para><programlisting>
INSERT INTO <replaceable>table_name</replaceable> ("<replaceable>feature1</replaceable>", "<replaceable>feature2</replaceable>", "<replaceable>feature3</replaceable>", "<replaceable>feature4</replaceable>", "<replaceable>feature5</replaceable>")
VALUES ("<replaceable>value1</replaceable>", "<replaceable>value2</replaceable>", "<replaceable>value3</replaceable>", "<replaceable>value4</replaceable>", "<replaceable>value5</replaceable>" )
</programlisting></para></listitem>
</varlistentry>

<varlistentry>
<term><command>DELETE</command></term>
<listitem><para><programlisting>
DELETE FROM <replaceable>table_name</replaceable> WHERE name = "<replaceable>text</replaceable>"
</programlisting></para></listitem>
</varlistentry>

<varlistentry>
<term><command>UPDATE</command></term>
<listitem><para><programlisting>
UPDATE <replaceable>table_name</replaceable> SET "<replaceable>feature1</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature2</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature3</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature4</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature5</replaceable>" = "<replaceable>text</replaceable>"
</programlisting></para></listitem>
</varlistentry>

</variablelist>
</example>

</sect3>

<sect3 id="sql-querying-select">
<title>SELECT</title>

<para>After running a  <command>SELECT</command> query, you can view the results
as a table that will appear in the <guilabel>SQL Data Output</guilabel> tool view at
the bottom of &kate;, or as text in the <guilabel>SQL Text Output</guilabel>.
If there is an error, you can see it in the text output.</para>

<example>
<title>Example <command>SELECT</command> Query</title>
<para><programlisting>
SELECT * FROM <replaceable>table_name</replaceable>
</programlisting></para>
</example>

<para>In the <guilabel>SQL Data Output</guilabel> tool view, there are several buttons:</para>

<variablelist>

<varlistentry>
<term><guibutton>Resize columns to contents</guibutton></term>
<listitem><para>Changes the size of columns to fit their contents.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Resize rows to contents</guibutton></term>
<listitem><para>Changes the size of rows to fit their contents.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Copy</guibutton></term>
<listitem><para>Selects all of the table contents and copies it to the clipboard buffer.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Export</guibutton></term>
<listitem><para>Exports all of the table contents to a file, the clipboard, or the
current document in the Comma Separated Values format.</para></listitem>
</varlistentry>

<varlistentry>
<term><guibutton>Clear</guibutton></term>
<listitem><para>Removes everything from the table view</para></listitem>
</varlistentry>

<!--FIXME Use system locale -->

</variablelist>

<para>You can now change the colors displayed in the table in the <guilabel>SQL</guilabel>
section of <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;</guimenuitem>
</menuchoice>.</para>

</sect3>
</sect2>

<sect2 id="sql-browsing">
<title>Browsing</title>

<para>You can browse your database using the <guilabel>Database schema</guilabel> browser
tool view on the left.  The information displayed varies depending on which
database driver you are using.</para>

<para>To refresh this list, right-click anywhere in the tool view and select
<guimenuitem>Refresh</guimenuitem>.  To generate a query on any entry in the list,
right-click on an entry, select <guisubmenu>Generate</guisubmenu>, and select the
query type (<guimenuitem>SELECT</guimenuitem>, <guimenuitem>UPDATE</guimenuitem>,
<guimenuitem>INSERT</guimenuitem>, or <guimenuitem>DELETE</guimenuitem>) from
the submenu that appears.</para>

</sect2>

<sect2 id="sql-menus">
<title>Menu Structure</title>
<variablelist>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Add connection...</guimenuitem>
</menuchoice></term>
<listitem><para>
Adds a new connection using any database driver.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Remove connection</guimenuitem>
</menuchoice></term>
<listitem><para>
Removes the selected connection.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<guimenu>SQL</guimenu><guimenuitem>Edit connection...</guimenuitem>
</menuchoice></term>
<listitem><para>
Edits the current connection's settings.
</para></listitem>
</varlistentry>

<varlistentry>
<term>Connections</term>
<listitem><para>
All database connections you have created are listed between the
<guimenuitem>Edit connection</guimenuitem> and <guimenuitem>Run query</guimenuitem>
menu items.  Select one to run queries or make modifications to it.
</para></listitem>
</varlistentry>

<varlistentry>
<term><menuchoice>
<shortcut><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></shortcut>
<guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem>
</menuchoice></term>
<listitem><para>
Runs your query.
</para></listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="sql-ack">
<title>Thanks and Acknowledgments</title>

<para>The SQL Plugin was written by Marco Mentasti.</para>
<para>Special thanks to Google Code-In 2011 participant Ömer Faruk ORUÇ for
writing much of this section.</para>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-symbolviewer">
<!--https://kate-editor.org/2010/10/27/php-treeview-improvements-in-kate/?-->
<title>Symbol Viewer Plugin</title>

<sect2 id="symbolviewer-using">
<title>Using the Close Except/Like Plugin</title>

<para>It allows developers to view symbols (functions, macros and structures) from source code.</para>
<para>By clicking the parsed information you can easily browse the code.</para>
<para>At the moment the following languages are supported:</para>
<para>C/C++, Java, Perl, PHP, Python, Ruby, XSLT, Tcl/Tk, Fortran</para>

<para>Feature list:</para>
<simplelist>
<member>List/Tree mode</member>
<member>Enable/disable sorting</member>
<member>Hide/Show Functions Parameters</member>
<member>Expand/collapse tree mode</member>
<member>Auto-update on document change</member>
<member>Code parsing is based on the Syntax-Highlighting framework from &kde-frameworks;</member>
</simplelist>

</sect2>

<sect2 id="symbolviewer-menu">
<title>Menu Structure</title>
<variablelist>

<varlistentry id="tools-symbolviewer">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo>
</shortcut>
<guimenu>View</guimenu>
<guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Symbol List</guimenuitem>
</menuchoice></term>
<listitem>
<para>Toggle the display of &kate;'s Symbol List displaying Functions, Macros and
Structures of the source code in the active document.</para>
</listitem>
</varlistentry>

</variablelist>

</sect2>

<sect2 id="symbolviewer-config">
<title>Configuration</title>

<screenshot id="screenshot-symbolviewer-settings">
<screeninfo>Symbol Viewer</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="symbolviewer-settings.png" format="PNG"/></imageobject>
<caption><para>Choose the default parser options</para></caption>
</mediaobject>
</screenshot>

</sect2>

</sect1>


<sect1 id="kate-application-plugin-konsole">
<title>Terminal Tool View Plugin</title>

<para><indexterm><primary>Terminal emulator</primary></indexterm>
The built in Terminal Emulator is a copy of the &kde; &konsole;
terminal application, for your convenience. It is available from the
<menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Terminal</guimenuitem></menuchoice> menu item and will get the focus
whenever displayed. Additionally, if the <link
linkend="konsole-config">Automatically synchronize
the terminal with the current document when possible</link> option is enabled, it will
change to the directory of the current document if
possible when it is displayed, or when the current document
changes.</para>

<para>The default location in the &kate; window is at the bottom,
below the editing area.</para>

<para>You can configure the &konsole; using its &RMB; menu, for more
information, see the <ulink url="help:/konsole/index.html">&konsole; manual</ulink>.</para>

<para>The built-in terminal emulator is provided by the Terminal Tool View plugin.</para>

<sect2 id="konsole-menus">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="view-toolviews-show-terminal">
<term><menuchoice>
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
<guimenuitem>Show Terminal</guimenuitem>
</menuchoice></term>
<listitem>
<para>Toggles the display of the built-in terminal emulator.</para>
<para>When activated for the first time, the terminal will be created.</para>
<para>When the terminal emulator is displayed, it will get the focus, so that
you can start typing in commands immediately. If the <link
linkend="konsole-config">Automatically synchronize the terminal
with the current document when possible</link> option is enabled in the
<guilabel>Terminal</guilabel> page of the <link
linkend="config-dialog">Main configuration dialog</link> the shell session will
change to the directory of the active document, if it is a local file.</para>
</listitem>
</varlistentry>

<varlistentry id="view-toolviews-pipe-to-terminal">
<term><menuchoice><guimenu>Tools</guimenu><guimenuitem>Pipe to
Terminal</guimenuitem></menuchoice></term>
<listitem><para>Feed the currently selected text into the built-in terminal
emulator. No newline is added after the text.</para></listitem>
</varlistentry>

<varlistentry id="tools-sync-terminal-document">
<term><menuchoice>
<guimenu>Tools</guimenu>
<guimenuitem>Synchronize Terminal with Current Document</guimenuitem></menuchoice></term>
<listitem>
<para>This will cause the built-in Terminal to <command>cd</command> into the
directory of the active document.</para>

<para>Alternatively, you can configure &kate; to always keep the terminal in
sync with the current document.  See
<xref linkend="konsole-config"/> for more information.</para>
</listitem>
</varlistentry>

<varlistentry id="tools-focus-terminal">
<term><menuchoice>
<guimenu>Tools</guimenu>
<guimenuitem>Focus/Defocus Terminal</guimenuitem>
</menuchoice></term>
<listitem>
<para>Switch the focus from the current document to the terminal and vice versa.
</para>
</listitem>
</varlistentry>

</variablelist>
</sect2>

<sect2 id="konsole-config">
<title>Configuration</title>

<para>You can configure the Terminal Tool View plugin on the
<guilabel>Terminal</guilabel> page of the
<link linkend="configuring-kate">configuration dialog</link>.</para>

<para>The following options are available:</para>

<variablelist>
<varlistentry>
<term>
<guilabel>Automatically synchronize the terminal with the current document when possible</guilabel></term>
<listitem><para>This will cause the built-in terminal to
<command>cd</command> into the directory of the active document when
launched and when a new document gets the focus. If not enabled, you
have to do all your navigation in the terminal on your own.
</para></listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Set EDITOR environment variable to 'kate -b'</guilabel></term>
<listitem><para>This sets the <envar>EDITOR</envar> environment variable so programs
run in the built-in terminal that automatically open a file in an editor will open
them in &kate; instead of the default editor configured in your shell.  You will
not be able to continue using the terminal until you have closed the file in &kate;,
so the calling program is aware you have finished editing the file.</para></listitem>
</varlistentry>

</variablelist>
</sect2>

</sect1>

<sect1 id="kate-application-plugin-textfilter">

<title>Text Filter Plugin</title><!--Name is completely misleading and should be changed-->

<sect2 id="textfilter-using">
<title>Using the Text Filter Plugin</title>

<para>You can use this plugin to execute shell commands. A selection will
be used as argument for the shell command, the output will either replace the selection
or copied to the clipboard.
</para>

<itemizedlist>
<title>Examples:</title>
<listitem><para>
<command>less /etc/fstab</command> - paste the contents of this file or copy it to the clipboard
</para></listitem>
<listitem><para>
<command>wc</command> - count lines, words and characters of the selection and
paste this into the document or copy it to the clipboard
</para></listitem>
<listitem><para>
<command>sort</command> - sort lines of the selection and paste the result into
the document or copy it to the clipboard
</para></listitem>
</itemizedlist>

</sect2>

<sect2 id="textfilter-menu">
<title>Menu Structure</title>

<variablelist>

<varlistentry id="tools-textfilter">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo><!--FIXME shortcut does not work with a german keyboard \ = AltGr+\-->
</shortcut>
<guimenu>Tools</guimenu>
<guisubmenu>Filter Text</guisubmenu>
</menuchoice></term>
<listitem>

<para><action>Opens</action> the Text Filter dialog:</para>

<screenshot id="screenshot-filtertext">
<screeninfo>Text Filter dialog</screeninfo>
<mediaobject>
<imageobject><imagedata fileref="textfilter.png" format="PNG"/></imageobject>
</mediaobject>
</screenshot>

<para>Enter the shell command into the combobox or select a previous command from the history.</para>

<variablelist>

<varlistentry>
<term><guilabel>Copy the result instead of pasting it</guilabel></term>
<listitem>
<para>Copy the result to clipboard leaving a document unchanged.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><guilabel>Merge STDOUT and STDERR</guilabel></term>
<listitem>
<para>
If checked, an output from STDOUT and STDERR will be merged and no errors will be reported.
Otherwise, STDERR will be displayed as a passive message.</para>
</listitem>
</varlistentry>

</variablelist>

</listitem>
</varlistentry>

</variablelist>

</sect2>

</sect1>

<sect1 id="kate-application-plugin-xmlcheck">
<!-- from doc/kate-addons/xmlcheck.docbook -->
<sect1info>
<authorgroup><author>
&Daniel.Naber; &Daniel.Naber.mail;
</author></authorgroup>
</sect1info>

<title>&XML; Validation</title>

<para>This plugin checks &XML; files for validity and being well-formed.</para>
<para>This plugin checks the current file. A list of warnings and errors
will appear at the bottom of &kate;'s main window. You can click on an error message
to jump to the corresponding place in the file. If the file has a <quote>DOCTYPE</quote>
the DTD given with this doctype will be used to check the file for validity. The
DTD is expected at a position relative to the current file, &eg; if the doctype
refers to <quote>DTD/xhtml1-transitional.dtd</quote> and the file is <filename>/home/peter/test.xml</filename>
the DTD is expected to be located at <filename>/home/peter/DTD/xhtml1-transitional.dtd</filename>.
However, remote DTDs specified via http are supported.</para>

<para>If the file has no doctype it will be checked for being well-formed.</para>

<para>To learn more about &XML; check out the <ulink url="http://www.w3.org/XML/"> official W3C &XML; pages</ulink>.</para>

<para>Internally this plugin calls the external command <command>xmllint</command>, which
is part of libxml2. If this command is not correctly installed on your system, the plugin
will not work.</para>

<para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
Then select <guilabel>&XML; Validation</guilabel> which will appear
in the <guilabel>Application</guilabel> / <guilabel>Plugins</guilabel> section and close the dialog.
</para>

<sect2 id="xmlcheck-menu">
<title>Menu Structure</title>

<variablelist>
<varlistentry>
<term>
<menuchoice>
<guimenu>&XML;</guimenu>
<guimenuitem>Validate &XML;</guimenuitem>
</menuchoice>
</term>
<listitem><para>This will start the check, as described above.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmlcheck-thanks-and-acknowledgements">
<title>Thanks and Acknowledgments</title>
<para>
&kate; Plugin <quote>&XML; Validation</quote> copyright 2002 &Daniel.Naber;
&Daniel.Naber.mail;.
</para>
<para>Documentation copyright 2002 &Daniel.Naber;</para>

</sect2>
</sect1>

<sect1 id="kate-application-plugin-xmltools">
<!-- from doc/kate-addons/xmlcheck.docbook -->
<sect1info>
<authorgroup><author>
&Daniel.Naber; &Daniel.Naber.mail;
</author></authorgroup>
</sect1info>
<title>&XML; Completion</title>

<para>This plugin gives hints about what is allowed at a certain position in
an &XML; file, according to the file's DTD. It will list possible
elements, attributes, attribute values or entities, depending on the
cursor position (&eg; all entities are listed if the character on the left
of the cursor is <quote>&amp;</quote>). It's also possible to close the nearest
open tag on the left.</para>

<para>The <acronym>DTD</acronym> must exist in &XML; format, as produced by the Perl program
<command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>.
Some meta DTDs are supplied. They are installed in
<filename class="directory">katexmltools/</filename> in
<userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>,
which is also the default folder when you choose
<guimenuitem>Assign Meta DTD...</guimenuitem>.
To produce your own meta DTDs, get <command>dtdparse</command> from
<ulink url="http://dtdparse.sourceforge.net">http://dtdparse.sourceforge.net</ulink>.</para>

<sect2 id="xmltools-how-to-use">
<title>How to Use</title>

<para>Start &kate; and open the configuration dialog under <menuchoice><guimenu>Settings</guimenu>
<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
Then select <guilabel>&XML; Completion</guilabel> which will appear
in the <menuchoice><guimenu>Application</guimenu>
<guimenuitem>Plugins</guimenuitem></menuchoice> page and close the dialog. After
that, select <menuchoice><guimenu>&XML;</guimenu><guimenuitem>Assign Meta DTD...</guimenuitem></menuchoice>.
If your document contains no <quote>DOCTYPE</quote> or the doctype is unknown, you will have to
select a meta DTD from the file system. Otherwise the meta DTD that
matches the current document's DOCTYPE will be loaded automatically.</para>

<para>You can now use the plugin while typing your text:</para>

<variablelist>

<varlistentry>
<term><keycap>&lt;</keycap> (less than key)</term>
<listitem><para>This will trigger a list of possible elements unless the
cursor is inside a tag already. Note that you currently cannot use
this to insert the top level element (&eg; <quote>&lt;html&gt;</quote>).</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>&lt;</keycap><keycap>/</keycap>(less than key + slash)</term>
<listitem><para>Entering these characters will offer to close the current element
(nearest open one to the left of the cursor). Press &Enter; to accept the suggestion.
Unlike the <guimenuitem>Close Element</guimenuitem> menu item, this works only with
a DTD assigned.</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>"</keycap> (quote key)</term>
<listitem><para>The quote key will trigger a list of possible attribute
values (if there are any) if you are inside a tag.</para></listitem>
</varlistentry>

<varlistentry>
<term><keycap>&nbsp;</keycap> (space key)</term>
<listitem><para>This key will trigger a list of possible attributes for the
current element if you are inside a tag.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><keycap>&amp;</keycap> (ampersand key)</term>
<listitem><para>This key will trigger a list of named entities.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmltools-features-and-limitations">
<title>Features and Limitations</title>

<para>You can test all functions and limitations by loading
<filename>katexmltools/testcases.xml</filename> in
<userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>
into &kate; and following the instructions.</para>

</sect2>


<sect2 id="xmltools-menu">
<title>Menu Structure</title>

<variablelist id="xml-insert-element">
<varlistentry>
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>Return</keycap></keycombo>
</shortcut>
<guimenu>&XML;</guimenu>
<guimenuitem>Insert Element...</guimenuitem>
</menuchoice></term>
<listitem><para>This will open a dialog that lets you insert an &XML; element.
The &lt;, &gt; characters and the closing tag will be inserted automatically.
If you have selected text when this menu item is selected, the selected
text will be surrounded by the opening and the closing tag.
The dialog also offers completion of all elements that may be inserted
at the current cursor position if you have assigned a meta DTD by
using <guimenuitem>Assign Meta DTD...</guimenuitem>.
</para></listitem>
</varlistentry>

<varlistentry id="xml-close-element">
<term><menuchoice>
<shortcut>
<keycombo action="simul">&Ctrl;<keycap>&lt;</keycap></keycombo>
</shortcut>
<guimenu>&XML;</guimenu>
<guimenuitem>Close Element</guimenuitem>
</menuchoice></term>
<listitem><para>This will search your text for a tag that is not yet closed
and will close it by inserting the corresponding closing tag.
The search starts at the cursor position and goes left. If
it cannot find an open tag nothing will happen.</para></listitem>
</varlistentry>

<varlistentry id="xml-assign-metadtd">
<term><menuchoice>
<guimenu>&XML;</guimenu>
<guimenuitem>Assign Meta DTD...</guimenuitem>
</menuchoice></term>
<listitem><para>This will tell the plugin which meta DTD to use for the
current document. Note that this assignment will not be saved.
You will have to repeat it when you start &kate; the next time.</para></listitem>
</varlistentry>
</variablelist>

</sect2>

<sect2 id="xmltools-thanks-and-acknowledgements">
<title>Thanks and Acknowledgments</title>
<para>
&kate; Plugin <quote>&XML; Completion</quote> copyright 2001,2002 &Daniel.Naber;
&Daniel.Naber.mail;.
</para>
<para>KDE SC 4 version copyright 2010 Tomáš Trnka</para>
<para>Documentation copyright 2001,2002 &Daniel.Naber;</para>
</sect2>
</sect1>


</chapter>
