1<chapter id="plugins">
2
3<chapterinfo>
4<authorgroup>
5<author>&Anders.Lund; &Anders.Lund.mail;</author>
6<!-- TRANS:ROLES_OF_TRANSLATORS -->
7</authorgroup>
8</chapterinfo>
9
10<title>Working with Plugins</title>
11
12<para>You can enable the individual plugins in the <link
13linkend="configuring-kate-configdialog">configuration dialog</link>, which also
14provides access to additional configuration options for plugins that require
15it.</para>
16
17<sect1 id="kate-application-plugins">
18<title>&kate; Application Plugins</title>
19
20<!-- from doc/kate-addons/index.docbook -->
21<para>
22&kate; plugins are additional functions for the &kate; editor.  They can
23add extra menus and shortcuts, and extend &kate;'s features.  You can
24install as many or as few as you like, from within &kate;.
25Open &kate;'s configuration dialog with
26<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem></menuchoice>
27Select <menuchoice><guimenu>Application</guimenu><guimenuitem>Plugins</guimenuitem></menuchoice> to
28choose the wanted plugins.
29</para>
30
31<para>
32The available application plugins are:
33</para>
34<itemizedlist>
35<listitem>
36<para><link linkend="kate-application-plugin-external-tools">External Tools</link>
37- Run external tools and applications</para>
38</listitem>
39<listitem>
40<para><link linkend="kate-application-plugin-backtracebrowser">Backtrace Browser</link>
41- C/C++ Backtrace navigation tool view</para>
42</listitem>
43<listitem>
44<para><link linkend="kate-application-plugin-build">Build Plugin</link> - Compile or Make and parse error messages</para>
45</listitem>
46<listitem>
47<para><link linkend="kate-application-plugin-closeexceptlike">Close Except/Like</link>
48- Close group of documents based on a common path or file extension</para>
49</listitem>
50<listitem>
51<para><link linkend="kate-application-plugin-colorpicker">Color Picker</link>
52- Show preview for known color names</para>
53</listitem>
54<listitem>
55<para><link linkend="kate-application-plugin-ctags">CTags</link> -
56Look up definitions/declarations with CTags</para>
57</listitem>
58<listitem>
59<para><link linkend="kate-application-plugin-preview">Document preview</link> -
60Preview the document in the target format.</para>
61</listitem>
62<listitem>
63<para><link linkend="kate-application-plugin-documentswitcher">Document switcher</link> -
64Quick document switching with <keycombo action="simul">&Alt;&Tab;</keycombo> behavior</para>
65</listitem>
66<listitem>
67<para><link linkend="kate-application-plugin-fsbrowser">File System Browser</link> -
68  File system browser tool view</para>
69</listitem>
70<listitem>
71<para><link linkend="kate-application-plugin-documents">Document Tree View</link> - Displays the open files in a file tree</para>
72</listitem>
73<listitem>
74<para><link linkend="kate-application-plugin-gdb">&gdb;</link> - Provides a
75simple &gdb; frontend</para>
76</listitem>
77<!--from workspace/plasma-sdk, why picked up here?
78<listitem>
79<para>Icon picker - Invokes Cuttlefish icon picker</para>
80</listitem>
81-->
82<listitem>
83<para><link linkend="kate-application-plugin-projects">Project Plugin</link> - Integration with &git; and other source control systems</para>
84</listitem>
85<listitem>
86<para>Replicode - Constructivist AI language and runtime</para>
87</listitem>
88<listitem>
89<para><link linkend="kate-application-plugin-lspclient">LSP Client</link>
90- LSP client providing code navigation and code completion for many languages</para>
91</listitem>
92<listitem>
93<para><link linkend="kate-application-plugin-searchinfiles">Search &amp; Replace</link> -
94Search and replace in documents, folders, or projects</para>
95</listitem>
96<listitem>
97<para><link linkend="kate-application-plugin-snippets">Snippets tool view</link> - Tool view embedding the snippets management</para>
98</listitem>
99<listitem>
100<para><link linkend="kate-application-plugin-sql">SQL Plugin</link> - Execute
101query on SQL databases</para>
102</listitem>
103<listitem>
104<para><link linkend="kate-application-plugin-symbolviewer">Symbol Viewer</link>
105- Extract and show reference symbols from source</para>
106</listitem>
107<listitem>
108<para><link linkend="kate-application-plugin-konsole">Terminal tool view</link> - Have a terminal at the ready, using &kde;'s &konsole; widget</para>
109</listitem>
110<listitem>
111<para><link linkend="kate-application-plugin-textfilter">Text Filter</link> - Process text using terminal commands</para>
112</listitem>
113<listitem>
114<para><link linkend="kate-application-plugin-xmltools">&XML;Completetion</link> - Lists &XML; elements,
115attributes, attribute values and entities allowed by DTD</para>
116</listitem>
117<listitem>
118<para><link linkend="kate-application-plugin-xmlcheck">&XML; Validation</link>- Validates &XML; files using xmllint</para>
119</listitem>
120</itemizedlist>
121</sect1>
122
123<sect1 id="kate-application-plugin-external-tools">
124<title>External Tools</title>
125
126<para>The <guilabel>External Tools</guilabel> plugin allows to invoke
127external applications with data related to the current document, for example
128its URL, directory, text or selection. Once enabled, a config page appears
129as depicted below that allows to change or remove existing tools. Similarly,
130new tools can be added to your liking. The tools will then appear in the
131<guisubmenu>External Tools</guisubmenu> submenu of the <guimenu>Tools</guimenu>
132menu of the application.
133</para>
134
135<mediaobject>
136<imageobject>
137<imagedata format="PNG" fileref="kateexternaltools.png"/>
138</imageobject>
139</mediaobject>
140
141<para>
142The config page allows to add new external tools by clicking on the
143<guilabel>Add</guilabel> button. In this case, a popup menu appears where one
144can either add a new external tool, add an existing tool from a predefined list,
145or add a new category to organize the external tools into categories. Similarly,
146the existing tools can be modified either by double-click or by invoking
147<guilabel>Edit...</guilabel>, and <guilabel>Remove</guilabel> removes the
148selected tools.
149</para>
150
151<sect2 id="kate-application-plugin-external-tools-edit">
152<title>Configuring External Tools</title>
153
154<para>Editing a tool opens a config dialog that allows fine-grained
155configuration of the tool:</para>
156
157<mediaobject>
158<imageobject>
159<imagedata format="PNG" fileref="kateeditexternaltool.png"/>
160</imageobject>
161</mediaobject>
162
163<variablelist>
164<varlistentry>
165<term>As can be seen, many details can be defined, namely:</term>
166<listitem>
167<para><userinput>Name</userinput>, the name of the tool, which will later appear in the menu.</para>
168<para><userinput>Icon</userinput>, optional icon that is visible in the menu.</para>
169<para><userinput>Executable</userinput>, executable including either a full path, or your executable must be in the <envar>PATH</envar> environment variable.</para>
170<para><userinput>Arguments</userinput>, optional arguments that are passed to the executable.</para>
171<para><userinput>Input</userinput>, optional input that is passed to the process via stdin.</para>
172<para><userinput>Working directory</userinput>, the working directory the tool will be started in. If empty, the working directory is set to the current document’s path.</para>
173<para><userinput>Mime types</userinput>, if set, the tool is active only if the current document’s mime type matches.</para>
174<para><userinput>Save</userinput>, when invoked, saves none, the current document, or all documents.</para>
175<para><userinput>Reload current document after execution</userinput>, useful when the current file is modified on disk.</para>
176<para><userinput>Output</userinput>, the output defines the target of stdout. It is either set to <userinput>Ignored</userinput>, <userinput>Insert at Cursor Position</userinput>, <userinput>Replace Selected Text</userinput>, <userinput>Replace Current Document</userinput>, <userinput>Append to Current Document</userinput>, <userinput>Insert in New Document</userinput>, <userinput>Copy to Clipboard</userinput>, or <userinput>Display in Pane</userinput>.</para>
177<para><userinput>Editor command</userinput>, optional command that can be used to invoke the external tool via the built-in <ulink url="help:/katepart/advanced.html#advanced-editing-tools-commandline">command line</ulink>.</para>
178</listitem>
179</varlistentry>
180</variablelist>
181
182<para>The button <guilabel>Defaults</guilabel> is visible only for tools that
183are shipped with Kate. When clicked, all tool’s settings reverted to default
184(aka factory) values.
185</para>
186
187</sect2>
188
189<sect2 id="kate-application-plugin-external-tools-variables">
190<title>Variable Expansion</title>
191
192<para>
193Some editing fields such as the <guilabel>Executable</guilabel>, the
194<guilabel>Arguments</guilabel>, the <guilabel>Input</guilabel> and the
195<guilabel>Working Directory</guilabel> support variables that are expanded
196on tool invocation. This is indicated by the icon <guilabel>{}</guilabel>
197that appears once one of these text input fields has focus (see red circle):
198</para>
199
200<mediaobject>
201<imageobject>
202<imagedata format="PNG" fileref="katevariableexpansion.png"/>
203</imageobject>
204</mediaobject>
205
206<para>
207Hovering over one of these text input fields also shows a tooltip with the
208current expanded text. Further, clicking on the <guilabel>{}</guilabel>
209action will open a dialog that lists all available variables:
210</para>
211
212<mediaobject>
213<imageobject>
214<imagedata format="PNG" fileref="kateexternaltoolvariablechooser.png"/>
215</imageobject>
216</mediaobject>
217
218<para>
219This feature provides a lot of flexibility when defining an external tool since
220all variables of the form <userinput>%{...}</userinput> are expanded when the tool
221gets invoked. There are two kind of variables supported:
222
223<itemizedlist>
224<listitem><para><userinput>%{variable-name}</userinput></para></listitem>
225<listitem><para><userinput>%{variable-name:&lt;value&gt;}</userinput></para></listitem>
226</itemizedlist>
227The first form <userinput>%{variable-name}</userinput> simply replaces the
228variable with its contents. For instance, the variable <userinput>%{Document:FileName}</userinput>
229is replaced by the current document’s filename without its path.
230The second form <userinput>%{variable-name:&lt;value&gt;}</userinput> gets the
231<userinput>&lt;value&gt;</userinput> as contents. For example, this can be used
232to expand an environment variable with <userinput>%{ENV:HOME}</userinput>,
233or one can obtain the current date in the preferred format like
234<userinput>%{Date:yyyy-MM-dd}</userinput>.
235</para>
236
237<variablelist>
238<varlistentry>
239<term>Supported variables include:</term>
240<listitem>
241<para><userinput>Document:FileBaseName</userinput>: File base name without path and suffix of the current document.</para>
242<para><userinput>Document:FileExtension</userinput>: File extension of the current document.</para>
243<para><userinput>Document:FileName</userinput>: File name without path of the current document.</para>
244<para><userinput>Document:FilePath</userinput>: Full path of the current document including the file name</para>
245<para><userinput>Document:Text</userinput>: Contents of the current document.</para>
246<para><userinput>Document:Path</userinput>: Full path of the current document excluding the file name.</para>
247<para><userinput>Document:NativeFilePath</userinput>: Full document path including file name, with native path separator (backslash on Windows).</para>
248<para><userinput>Document:NativePath</userinput>: Full document path excluding file name, with native path separator (backslash on Windows).</para>
249<para><userinput>Document:Cursor:Line</userinput>: Line number of the text cursor position in current document (starts with 0).</para>
250<para><userinput>Document:Cursor:Column</userinput>: Column number of the text cursor position in current document (starts with 0).</para>
251<para><userinput>Document:Cursor:XPos</userinput>: X component in global screen coordinates of the cursor position.</para>
252<para><userinput>Document:Cursor:YPos</userinput>: Y component in global screen coordinates of the cursor position.</para>
253<para><userinput>Document:Selection:Text</userinput>: Text selection of the current document.</para>
254<para><userinput>Document:Selection:StartLine</userinput>: Start line of selected text of the current document.</para>
255<para><userinput>Document:Selection:StartColumn</userinput>: Start column of selected text of the current document.</para>
256<para><userinput>Document:Selection:EndLine</userinput>: End line of selected text of the current document.</para>
257<para><userinput>Document:Selection:EndColumn</userinput>: End column of selected text of the current document.</para>
258<para><userinput>Document:RowCount</userinput>: Number of rows of the current document.</para>
259<para><userinput>Document:Variable:&lt;variable&gt;</userinput>: Expand arbitrary <ulink url="help:/katepart/config-variables.html">document variables</ulink>.</para>
260<para><userinput>Date:Locale</userinput>: The current date in current locale format.</para>
261<para><userinput>Date:ISO</userinput>: The current date (ISO).</para>
262<para><userinput>Date:&lt;value&gt;</userinput>: The current date (<ulink url="https://doc.qt.io/qt-5/qdate.html#toString">QDate formatstring</ulink>).</para>
263<para><userinput>Time:Locale</userinput>: The current time in current locale format.</para>
264<para><userinput>Time:ISO</userinput>: The current time (ISO).</para>
265<para><userinput>Time:&lt;value&gt;</userinput>: The current time (<ulink url="https://doc.qt.io/qt-5/qtime.html#toString">QTime formatstring</ulink>).</para>
266<para><userinput>ENV:&lt;value&gt;</userinput>: Access to environment variables.</para>
267<para><userinput>JS:&lt;expression&gt;</userinput>: Evaluate simple JavaScript statements.</para>
268<para><userinput>PercentEncoded:&lt;text&gt;</userinput>: Percent encoded text.</para>
269<para><userinput>UUID</userinput>: Generate a new UUID.</para>
270</listitem>
271</varlistentry>
272</variablelist>
273
274<para>
275</para>
276
277</sect2>
278
279<sect2 id="kate-application-plugin-external-tools-defaults">
280<title>List of Default Tools</title>
281
282<para>
283Several tools are shipped by default. However, if you have more useful tools
284please contribute those to <email>kwrite-devel@kde.org</email> so that we can add them to this list.
285All default tools are visible in the list view by default. However, all tools can be
286changed to your liking, including the category or even deleting tools.
287Deleted tools can be added back again by clicking on the <guibutton>Add</guibutton>
288button in the config page as described above.
289</para>
290
291<variablelist>
292<title>git-cola</title>
293
294<varlistentry>
295<term>git-cola is a graphical git client that enables you to easily stage and commit changes.
296If installed, it is available also through the command line by typing <userinput>git-cola</userinput></term>
297<listitem>
298<para><userinput>Name</userinput>: git-cola</para>
299<para><userinput>Icon</userinput>: git-cola</para>
300<para><userinput>Executable</userinput>: git-cola</para>
301<para><userinput>Arguments</userinput>: -r %{Document:Path}</para>
302<para><userinput>Editor command</userinput>: git-cola</para>
303</listitem>
304</varlistentry>
305
306</variablelist>
307
308
309<variablelist>
310<title>gitk</title>
311
312<varlistentry>
313<term>gitk is a git client as well that allows to nicely visualize the git history.</term>
314<listitem>
315<para><userinput>Name</userinput>: gitk</para>
316<para><userinput>Icon</userinput>: git-gui</para>
317<para><userinput>Executable</userinput>: gitk</para>
318<para><userinput>Working directory</userinput>: %{Document:Path}</para>
319<para><userinput>Editor command</userinput>: gitk</para>
320</listitem>
321</varlistentry>
322
323</variablelist>
324
325
326<variablelist>
327<title>git blame</title>
328
329<varlistentry>
330<term>Starts git blame to easily follow git changes in the current file.</term>
331<listitem>
332<para><userinput>Name</userinput>: git blame</para>
333<para><userinput>Executable</userinput>: git</para>
334<para><userinput>Arguments</userinput>: gui blame %{Document:FileName}</para>
335<para><userinput>Save</userinput>: Current Document</para>
336<para><userinput>Working directory</userinput>: %{Document:Path}</para>
337<para><userinput>Editor command</userinput>: git-blame</para>
338</listitem>
339</varlistentry>
340
341</variablelist>
342
343
344<variablelist>
345<title>Run Shell Script</title>
346
347<varlistentry>
348<term>Starts an external konsole in which the current document is executed.
349The script needs to state the interpreter in the first line via a shebang <userinput>#!/path/interpreter</userinput>.</term>
350<listitem>
351<para><userinput>Name</userinput>: Run Shell Script</para>
352<para><userinput>Icon</userinput>: system-run</para>
353<para><userinput>Executable</userinput>: konsole</para>
354<para><userinput>Arguments</userinput>: -e sh -c &quot;cd %{Document:Path} &amp;&amp; pwd &amp;&amp; chmod -vc a+x %{Document:FileName} &amp;&amp; ./%{Document:FileName} ; echo Press any key to continue. &amp;&amp; read -n 1&quot;</para>
355<para><userinput>Save</userinput>: Current Document</para>
356<para><userinput>Working directory</userinput>: %{Document:Path}</para>
357<para><userinput>Editor command</userinput>: run-script</para>
358</listitem>
359</varlistentry>
360
361</variablelist>
362
363
364<variablelist>
365<title>Google Selected Text</title>
366
367<varlistentry>
368<term>Search in google for the selected text.</term>
369<listitem>
370<para><userinput>Name</userinput>: Google Selected Text</para>
371<para><userinput>Icon</userinput>: globe</para>
372<para><userinput>Executable</userinput>: xdg-open</para>
373<para><userinput>Arguments</userinput>: &quot;https://www.google.com/search?q=%{Document:Selection:Text}&quot;</para>
374<para><userinput>Editor command</userinput>: google</para>
375</listitem>
376</varlistentry>
377
378</variablelist>
379
380
381<variablelist>
382<title>Insert UUID</title>
383
384<varlistentry>
385<term>Inserts a new UUID each time this action is invoked.</term>
386<listitem>
387<para><userinput>Name</userinput>: Insert UUID</para>
388<para><userinput>Executable</userinput>: echo</para>
389<para><userinput>Arguments</userinput>: %{UUID}</para>
390<para><userinput>Output</userinput>: Insert at Cursor Position</para>
391<para><userinput>Editor command</userinput>: uuid</para>
392</listitem>
393</varlistentry>
394
395</variablelist>
396
397
398<variablelist>
399<title>Clang Format Full File</title>
400
401<varlistentry>
402<term>Runs clang-format on the current file on disk. The document is reloaded afterwards.</term>
403<listitem>
404<para><userinput>Name</userinput>: Clang Format Full File</para>
405<para><userinput>Executable</userinput>: clang-format</para>
406<para><userinput>Arguments</userinput>: -i %{Document:FileName}</para>
407<para><userinput>Working directory</userinput>: %{Document:Path}</para>
408<para><userinput>Save</userinput>: Current Document</para>
409<para><userinput>Reload</userinput>: Yes</para>
410<para><userinput>Editor command</userinput>: clang-format-file</para>
411</listitem>
412</varlistentry>
413
414</variablelist>
415
416
417<variablelist>
418<title>Clang Format Selected Text</title>
419
420<varlistentry>
421<term>Runs clang-format just on the selected text in the current document.</term>
422<listitem>
423<para><userinput>Name</userinput>: Clang Format Selected Text</para>
424<para><userinput>Executable</userinput>: clang-format</para>
425<para><userinput>Arguments</userinput>: -assume-fileName: %{Document:FileName}</para>
426<para><userinput>Working directory</userinput>: %{Document:Path}</para>
427<para><userinput>Input</userinput>: %{Document:Selection:Text}</para>
428<para><userinput>Output</userinput>: Replace Selected Text</para>
429<para><userinput>Editor command</userinput>: clang-format-selection</para>
430</listitem>
431</varlistentry>
432
433</variablelist>
434
435
436<variablelist>
437<title>Qt Quick 2 Preview (qmlscene)</title>
438
439<varlistentry>
440<term>Previews the current qml file in qmlscene.</term>
441<listitem>
442<para><userinput>Name</userinput>: Qt Quick 2 Preview (qmlscene)</para>
443<para><userinput>Executable</userinput>: qmlscene</para>
444<para><userinput>Arguments</userinput>: %{Document:FileName}</para>
445<para><userinput>Save</userinput>: Current Document</para>
446<para><userinput>Working directory</userinput>: %{Document:Path}</para>
447<para><userinput>Editor command</userinput>: qml-preview</para>
448</listitem>
449</varlistentry>
450
451</variablelist>
452
453
454<variablelist>
455<title>JSON Format Full File</title>
456
457<varlistentry>
458<term>Format the entire JSON file.</term>
459<listitem>
460<para><userinput>Name</userinput>: JSON Format Full File</para>
461<para><userinput>Icon</userinput>: application-json</para>
462<para><userinput>Executable</userinput>: jq</para>
463<para><userinput>Arguments</userinput>: %{Document:FileName}</para>
464<para><userinput>Save</userinput>: Current Document</para>
465<para><userinput>Working directory</userinput>: %{Document:Path}</para>
466<para><userinput>Output</userinput>: Replace Current Document</para>
467<para><userinput>Editor command</userinput>: json-format-file</para>
468</listitem>
469</varlistentry>
470
471</variablelist>
472
473
474<variablelist>
475<title>XML Format Full File</title>
476
477<varlistentry>
478<term>Format the entire XML file.</term>
479<listitem>
480<para><userinput>Name</userinput>: JSON Format Full File</para>
481<para><userinput>Icon</userinput>: application-xml</para>
482<para><userinput>Executable</userinput>: xmllint</para>
483<para><userinput>Arguments</userinput>: --format %{Document:FileName}</para>
484<para><userinput>Save</userinput>: Current Document</para>
485<para><userinput>Working directory</userinput>: %{Document:Path}</para>
486<para><userinput>Output</userinput>: Replace Current Document</para>
487<para><userinput>Editor command</userinput>: xml-format-file</para>
488</listitem>
489</varlistentry>
490
491</variablelist>
492
493</sect2>
494</sect1>
495
496<sect1 id="kate-application-plugin-backtracebrowser">
497<!--https://kate-editor.org/2008/08/12/kate-fast-backtrace-navigation/-->
498<title>Backtrace Browser Plugin</title>
499
500<sect2 id="backtracebrowser-using">
501<title>Using the Backtrace Browser Plugin</title>
502
503<para>This plugin is meant for developers and probably of little use for users.
504It shows a backtrace delivered by gdb in a listview in a &kate; toolview.
505Clicking on an item opens the selected file and jumps to the correct line number.
506It works for backtraces generated on your own machine, but it will also work for
507backtraces from other people, &ie; with <filename>/home/dummy/qt-copy/…/qwidget.cpp</filename>
508will still be found on other machines. For that to work, you have to index the
509directories where the source code is located.
510</para>
511
512<para>Sometimes there are several files with the same name, &eg;</para>
513
514<simplelist>
515<member><filename>kdegraphics/okular/generators/dvi/config.h</filename></member>
516<member><filename>kdepim-runtime/resources/gmail/saslplugin/config.h</filename></member>
517</simplelist>
518
519<para>To pick the right choice, the plugin picks the last two parts of the &URL;,
520in this case this would be</para>
521
522<simplelist>
523<member><filename>dvi/config.h</filename></member>
524<member><filename>saslplugin/config.h</filename></member>
525</simplelist>
526
527<para>And then usually the plugin finds the correct one.</para>
528
529<para>Indexing master and a branches of course will lead to a clash.</para>
530
531</sect2>
532
533<sect2 id="backtracebrowser-config">
534<title>Configuration</title>
535
536<para>On the configuration page add the directories containing the source code.</para>
537
538<screenshot id="screenshot-backtrace-settings">
539<screeninfo>Backtrace Browser</screeninfo>
540<mediaobject>
541<imageobject><imagedata fileref="backtrace-settings.png" format="PNG"/></imageobject>
542<caption>Configure Paths in Backtrace browser tool view</caption>
543</mediaobject>
544</screenshot>
545
546<para>Clicking <guibutton>OK</guibutton> will start indexing.
547When indexing is finished, open the toolview <guilabel>Backtrace Browser</guilabel>.</para>
548<para>Now you can load a backtrace from the clipboard (&eg;, when you clicked
549<guibutton>Copy to Clipboard</guibutton> in &drkonqi;) or from a file.</para>
550
551</sect2>
552
553</sect1>
554
555<sect1 id="kate-application-plugin-build">
556<!--https://kate-editor.org/2011/06/21/kate-plugin-updates-part-1/ -->
557<sect1info>
558<authorgroup>
559<author><firstname>Salma</firstname> <surname>Sultana</surname></author>
560<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
561</authorgroup>
562</sect1info>
563<title>Build Plugin</title>
564
565<sect2 id="build-intro">
566<title>Introduction</title>
567
568<para>The Build plugin allows you to run actions like build, clean and compile
569on a project.</para>
570
571</sect2>
572
573<sect2 id="build-using">
574<title>Using the Build Plugin</title>
575
576<para>The Build plugin adds a <guilabel>Build Output</guilabel> tool view at the
577bottom and a <guimenu>Build</guimenu> menu on the menubar. The tool view can be used to configure
578build target settings, while the menu can be used to perform build, clean and
579compile actions.</para>
580
581<screenshot id="screenshot-build-output">
582<screeninfo>Build Output</screeninfo>
583<mediaobject>
584<imageobject><imagedata fileref="build-output.png" format="PNG"/></imageobject>
585</mediaobject>
586</screenshot>
587
588<para>The <guilabel>Build Output</guilabel> tool view has two tabs:</para>
589
590<itemizedlist>
591<listitem><para><guilabel>Target Settings</guilabel></para></listitem>
592<listitem><para><guilabel>Output</guilabel></para></listitem>
593</itemizedlist>
594
595<sect3 id="build-using-target-settings">
596<title>Target Settings tab</title>
597
598<para>The target settings tab can be used to configure various build targets and define targets sets.</para>
599
600<para>To change the names or commands double click on the entries in the table and use the
601dropdown box to select the active target set. Use the checkbox in front of each target to define a default.</para>
602
603<para>A new target set contains several configuration options:</para>
604
605<variablelist>
606<varlistentry>
607<term><guilabel>Working Directory</guilabel></term>
608<listitem><para>You can set the path to the project here. Leave this empty to
609use the directory the current document is located in.</para></listitem>
610</varlistentry>
611
612<varlistentry>
613<term><guilabel>Build</guilabel></term>
614<listitem><para>This option lets you define the build command. It is set to
615<command>make</command> by default.</para></listitem>
616</varlistentry>
617
618<varlistentry>
619<term><guilabel>Clean</guilabel></term>
620<listitem><para>The option lets you define the clean command. It is set to
621<command>make clean</command> by default.</para></listitem>
622</varlistentry>
623
624<varlistentry>
625<term><guilabel>Config</guilabel></term>
626<listitem><para>This option lets you define the config command. It is set
627to <command>cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ../</command>
628by default.</para></listitem>
629</varlistentry>
630</variablelist>
631
632<para>On the top this plugin has a toolbar with the following buttons :</para>
633
634<simplelist>
635<member>
636<guiicon><inlinemediaobject><imageobject><imagedata fileref="dialog-ok-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
637Build the selected target</member>
638<member>
639<guiicon><inlinemediaobject><imageobject><imagedata fileref="list-add-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
640Add a new build target</member>
641<member>
642<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
643Create a new build target set</member>
644<member>
645<guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-copy-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
646Copy a command or target set</member>
647<member>
648<guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-delete-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
649Delete the current command or target set</member>
650</simplelist>
651
652</sect3>
653
654<sect3 id="build-using-output">
655<title>Output tab</title>
656
657<para>The <guilabel>Output</guilabel> tab shows the console output generated by
658the last command.</para>
659
660<para>Use the slider at the top to show or hide categories of output:</para>
661
662<para><guilabel>Full Output</guilabel>, <guilabel>Parsed Output</guilabel>,
663<guilabel>Errors and Warnings</guilabel> or <guilabel>Only Errors</guilabel>
664</para>
665
666<para>Each line contains a message and the file name and line number if available.
667Clicking on the error or warning takes you to the appropriate file and places
668the cursor on the corresponding line number.</para>
669
670<para>To navigate to the previous error, press
671<keycombo action="simul">&Alt;&Shift;&Left;</keycombo>.
672To navigate to the next error, press
673<keycombo action="simul">&Alt;&Shift;&Right;</keycombo>.</para>
674
675</sect3>
676</sect2>
677
678<sect2 id="build-menu">
679<title>Menu Structure</title>
680
681<variablelist id="build-build">
682<varlistentry>
683<term><menuchoice id="build-targets">
684<guimenu>Build</guimenu><guisubmenu>Select Target</guisubmenu>
685</menuchoice></term>
686<listitem><para>Select from a list of targets configured by the user.</para></listitem>
687</varlistentry>
688
689<varlistentry id="build-default">
690<term><menuchoice>
691<guimenu>Build</guimenu><guimenuitem>Build Default Target</guimenuitem>
692</menuchoice></term>
693<listitem><para>Builds the target defined as default in the active target set.</para></listitem>
694</varlistentry>
695
696<varlistentry id="build-previous">
697<term><menuchoice>
698<guimenu>Build</guimenu><guimenuitem>Build Previous Target</guimenuitem>
699</menuchoice></term>
700<listitem><para>Switch to the previous target configured by the user.</para></listitem>
701</varlistentry>
702
703<varlistentry id="build-stop">
704<term><menuchoice>
705<guimenu>Build</guimenu><guimenuitem>Stop</guimenuitem>
706</menuchoice></term>
707<listitem><para>Stop building a target.</para></listitem>
708</varlistentry>
709
710<varlistentry id="build-previous-error">
711<term><menuchoice>
712<shortcut><keycombo action="simul">&Ctrl;&Alt;&Left;</keycombo></shortcut>
713<guimenu>Build</guimenu><guimenuitem>Previous Error</guimenuitem>
714</menuchoice></term>
715<listitem><para>Moves the cursor to the location of the previous error in the
716document.</para></listitem>
717</varlistentry>
718
719<varlistentry id="build-next-error">
720<term><menuchoice>
721<shortcut><keycombo action="simul">&Ctrl;&Alt;&Right;</keycombo></shortcut>
722<guimenu>Build</guimenu><guimenuitem>Next Error</guimenuitem>
723</menuchoice></term>
724<listitem><para>Moves the cursor to the location of the next error in the
725document.</para></listitem>
726</varlistentry>
727
728</variablelist>
729</sect2>
730
731<sect2 id="build-ack">
732<title>Thanks and Acknowledgments</title>
733<para>The &kate; Build Plugin was written by Kåre Särs.</para>
734<para>Special thanks to Google Code-In 2011 participant Salma Sultana for
735writing much of this section.</para>
736</sect2>
737</sect1>
738
739<sect1 id="kate-application-plugin-closeexceptlike">
740
741<title>Close Except/Like Plugin</title>
742
743<sect2 id="closeexceptlike-intro">
744<title>Introduction</title>
745
746<para>This plugin allows you to close a group of documents based on their extension and path.</para>
747
748</sect2>
749
750<sect2 id="closeexceptlike-using">
751<title>Using the Close Except/Like Plugin</title>
752
753<para>Assumed you have these documents opened in &kate;:</para>
754
755<simplelist>
756<member>/tmp/subfolder/test.h</member>
757<member>/tmp/test.cpp</member>
758<member>/tmp/test.txt</member>
759</simplelist>
760
761<para>Then you have the following options to close documents as displayed in the screenshot:</para>
762
763<screenshot id="screenshot-closeexceptlike">
764<screeninfo>Close Except</screeninfo>
765<mediaobject>
766<imageobject><imagedata fileref="close-except-like.png" format="PNG"/></imageobject>
767</mediaobject>
768</screenshot>
769
770<para>Use the checkbox in the last item of the list to enable or disable a confirmation dialog.
771The selected option will be applied to both close actions.
772</para>
773
774</sect2>
775
776<sect2 id="closeexceptlike-menu">
777<title>Menu Structure</title>
778
779<variablelist>
780<varlistentry id="file-close-except">
781<term><menuchoice>
782<guimenu>File</guimenu>
783<guisubmenu>Close Except</guisubmenu>
784</menuchoice></term>
785<listitem>
786<para><action>Close</action> all open documents, <emphasis>except</emphasis>
787those which match the path or file extension selected from the submenu.</para>
788</listitem>
789</varlistentry>
790
791<varlistentry id="file-close-like">
792<term><menuchoice>
793<guimenu>File</guimenu>
794<guisubmenu>Close Like</guisubmenu>
795</menuchoice></term>
796<listitem>
797<para><action>Close</action> all open documents
798which match the path or file extension selected from the submenu.</para>
799</listitem>
800</varlistentry>
801
802</variablelist>
803
804</sect2>
805
806</sect1>
807
808<sect1 id="kate-application-plugin-colorpicker">
809
810<title>Color Picker Plugin</title>
811
812<sect2 id="colorpicker-intro">
813<title>Introduction</title>
814
815<para>This plugin adds an inline color preview/picker to colors in the text (&eg;, <literal>#FFFFFF</literal>,
816<literal>white</literal>).</para>
817
818<para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
819<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
820Then select <guilabel>Color Picker</guilabel> and close the dialog.
821</para>
822</sect2>
823
824<sect2 id="colorpicker-config">
825<title>Configuration</title>
826
827<para>On the Color Picker settings page in &kate;'s configuration, you can configure the following options of the plugin behavior.</para>
828
829<variablelist>
830
831<varlistentry>
832<term><guilabel>Show preview for known color names</guilabel></term>
833<listitem>
834<para>Whether to show the color picker for known color names (&eg;, <literal>skyblue</literal>). See <ulink url="https://www.w3.org/TR/SVG11/types.html#ColorKeywords">this page</ulink> for the list of colors.</para>
835</listitem>
836</varlistentry>
837
838<varlistentry>
839<term><guilabel>Place preview after text color</guilabel></term>
840<listitem>
841<para>Whether to place the inline preview after text color in the text.</para>
842</listitem>
843</varlistentry>
844
845<varlistentry>
846<term><guilabel>Hex color matching</guilabel></term>
847<listitem>
848<para>Here, you can choose the best matching option for the colors used in your code.</para>
849</listitem>
850</varlistentry>
851
852</variablelist>
853
854</sect2>
855
856</sect1>
857
858<sect1 id="kate-application-plugin-ctags">
859<!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate/-->
860<title>CTags Plugin</title>
861
862<sect2 id="ctags-intro">
863<title>Introduction</title>
864
865<para><ulink url="https://en.wikipedia.org/wiki/Ctags">CTags</ulink> generates an
866index (or tag) file of language objects found in source files that allows these
867items to be quickly and easily located using this plugin in &kate;.
868</para>
869<para>A tag signifies a language object for which an index entry is available
870(or, alternatively, the index entry created for that object).</para>
871
872<para>Tag generation is supported for these
873<ulink url="http://ctags.sourceforge.net/languages.html">programming languages</ulink>.
874</para>
875</sect2>
876
877<sect2 id="ctags-config">
878<title>Configuration</title>
879
880<para>The CTags plugin uses two different database files for the index.</para>
881
882<para>On the CTags settings page in &kate;'s configuration you can add or remove
883directories containing the source code and regenerate the common CTags database.</para>
884
885<sect3 id="ctags-config-common">
886<title>Common Index</title>
887
888<screenshot id="screenshot-ctags-global-settings">
889<screeninfo>CTags Settings</screeninfo>
890<mediaobject>
891<imageobject><imagedata fileref="ctags-global-setting.png" format="PNG"/></imageobject>
892<caption>Configure CTags Global Database</caption>
893</mediaobject>
894</screenshot>
895
896<para>At the bottom of the settings page you can adapt the <guilabel>CTags command</guilabel>.
897</para>
898
899<para>For more information about all available options please read the CTags man page. This man page
900is available in &khelpcenter; and you can also enter the &URL; <emphasis>man:/ctags</emphasis>
901directly into &konqueror;
902</para>
903
904<para>Clicking <guibutton>Update</guibutton> will start indexing.
905When indexing is finished, close the dialog.</para>
906</sect3>
907
908<sect3 id="ctags-config-session">
909<title>Session Index</title>
910
911<para>To configure the session index open the <guilabel>CTags</guilabel> view.</para>
912
913<variablelist>
914<varlistentry>
915<term><menuchoice>
916<guimenu>Index Targets</guimenu>
917</menuchoice></term>
918<listitem>
919<para>On this tab you can add or remove directories containing the source code and manually
920regenerate the session specific CTags database.</para>
921</listitem>
922</varlistentry>
923
924<varlistentry>
925<term><menuchoice>
926<guimenu>Database</guimenu>
927</menuchoice></term>
928<listitem>
929<screenshot id="screenshot-ctags-session-settings">
930<screeninfo>Database Settings</screeninfo>
931<mediaobject>
932<imageobject><imagedata fileref="ctags-session-setting.png" format="PNG"/></imageobject>
933<caption>Configure CTags Session Database</caption>
934</mediaobject>
935</screenshot>
936<para>Select another CTags database file, configure the CTags command or revert
937to the default command.</para>
938</listitem>
939</varlistentry>
940
941</variablelist>
942
943</sect3>
944
945</sect2>
946
947<sect2 id="ctags-using">
948<title>Using the CTags Plugin</title>
949
950<para>
951You place the mouse cursor on the language object like function, symbol &etc;
952that you are interested in and then select one of the actions in the
953<guimenu>CTags</guimenu> menu to jump to the line and file where the object is
954defined or declared.</para>
955<para>By default the actions in the <guimenu>CTags</guimenu> menu have no shortcuts assigned.
956Use the <ulink url="help:/fundamentals/shortcuts.html">keyboard shortcut editor</ulink>
957to configure your own shortcuts.</para>
958
959<para>Alternatively use the search field on the <guilabel>Lookup</guilabel> tab of the
960CTags view.</para>
961<para>Entering characters into the search field will start the search and display matching names
962of language objects like functions, classes, symbols &etc; together with type and filename.</para>
963<para>Select an item in the list to jump to the corresponding line in the source file.</para>
964<!--FIXME why Tag Type here but Name Kind in Project plugin, is there really any difference?-->
965
966<!--FIXME completion as in Project plugin? -->
967
968</sect2>
969
970<sect2 id="ctags-menu">
971<title>Menu Structure</title>
972
973<variablelist>
974
975<varlistentry id="ctags-jumpback">
976<term><menuchoice>
977<guimenu>CTags</guimenu>
978<guisubmenu>Jump back one step</guisubmenu>
979</menuchoice></term>
980<listitem>
981<para>Navigate back in the history to the last visited tag.</para>
982</listitem>
983</varlistentry>
984
985<varlistentry id="ctags-lookup">
986<term><menuchoice>
987<guimenu>CTags</guimenu>
988<guisubmenu>Lookup Current Text</guisubmenu>
989</menuchoice></term>
990<listitem>
991<para>Opens the <guilabel>Lookup</guilabel> tab of the CTags view and displays all
992language objects matching the current text selection in the list.</para>
993</listitem>
994</varlistentry>
995
996<varlistentry id="ctags-gotodeclaration">
997<term><menuchoice>
998<guimenu>CTags</guimenu>
999<guisubmenu>Go to Declaration</guisubmenu>
1000</menuchoice></term>
1001<listitem>
1002<para>If the cursor is in a definition object this will open the document
1003containing the corresponding declaration if needed, activate its view and
1004place the cursor at the start of the declaration.</para>
1005</listitem>
1006</varlistentry>
1007
1008<varlistentry id="ctags-gotodefinition">
1009<term><menuchoice>
1010<guimenu>CTags</guimenu>
1011<guisubmenu>Go to Definition</guisubmenu>
1012</menuchoice></term>
1013<listitem>
1014<para>If the cursor is in a declaration object this will open the document
1015containing the corresponding definition if needed, activate its view and
1016place the cursor at the start of the definition.</para>
1017</listitem>
1018</varlistentry>
1019
1020</variablelist>
1021
1022<!--context menu with Lookup Current Text, Goto Declaration, Goto Definition -->
1023
1024</sect2>
1025
1026</sect1>
1027<!--https://frinring.wordpress.com/2017/11/07/ktexteditorpreviewplugin-0-2-1-last-stand-alone/-->
1028<!-- https://frinring.wordpress.com/2017/08/21/look-what-you-have-donewwdo/-->
1029<sect1 id="kate-application-plugin-preview">
1030<title>Document Preview Plugin</title>
1031
1032<sect2 id="preview-introduction">
1033<title>Introduction</title>
1034<para>
1035The plugin enables a live preview of the currently edited text document in the
1036final format in the sidebar. So when editing &eg; a &Markdown; text or an &SVG; image,
1037the result is instantly visible next to the source text.
1038</para>
1039
1040<para>For the display the plugin uses that &kparts; plugin which is currently selected
1041as the preferred one for the &MIME; type of the document.
1042If there is no &kparts; plugin for that type, no preview is possible.
1043</para>
1044
1045<para>To change the preferred plugin open the <guilabel>File Associations</guilabel>
1046module in the &systemsettings; and edit the <guilabel>Services Preference Order</guilabel>
1047on the <guilabel>Embedding</guilabel> tab.
1048</para>
1049
1050<table>
1051<title>Some available &kparts; plugins</title>
1052<tgroup cols="2">
1053<tbody>
1054<row>
1055<entry>&MIME; type</entry><entry>&kparts; plugin</entry>
1056</row>
1057<row>
1058<entry>&Markdown; text</entry><entry>KMarkdownWebViewPart or OkularPart</entry>
1059</row>
1060<row>
1061<entry>&SVG; image</entry><entry>SVGPart</entry>
1062</row>
1063<row>
1064<entry>&Qt; UI files</entry><entry>KUIViewerPart</entry>
1065</row>
1066<row>
1067<entry>&DOT; graph files</entry><entry>KGraphviewerPart</entry>
1068</row>
1069</tbody>
1070</tgroup>
1071</table>
1072</sect2>
1073
1074<sect2 id="preview-menu">
1075<title>Menu Structure</title>
1076<variablelist>
1077
1078<varlistentry id="view-toolviews-show-preview">
1079<term><menuchoice>
1080<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
1081<guimenuitem>Show Preview</guimenuitem>
1082</menuchoice></term>
1083<listitem>
1084<para>Toggle the display of &kate;'s Document preview in a sidebar.</para>
1085</listitem>
1086</varlistentry>
1087</variablelist>
1088</sect2>
1089
1090<sect2 id="preview-interface">
1091<title>Interface</title>
1092<para>The buttons at the top of the preview window provide these actions:
1093</para>
1094<itemizedlist>
1095<listitem>
1096<para>Lock the preview to a given document. Selecting this option ensures
1097that if switching the focus to the view of another document in the same &kate;
1098window, the preview will not follow to that document, but keep previewing
1099this document.</para>
1100</listitem>
1101<listitem>
1102<para>Enable or disable updates of the preview of the current document content</para>
1103</listitem>
1104<listitem>
1105<para>Manually update the preview of the current document content</para>
1106</listitem>
1107<listitem>
1108<para>A dropdown menu with actions from the &kparts; plugin</para>
1109</listitem>
1110</itemizedlist>
1111</sect2>
1112
1113</sect1>
1114
1115<sect1 id="kate-application-plugin-documentswitcher">
1116
1117<title>Document Switcher Plugin</title>
1118
1119<sect2 id="documentswitcher-menu">
1120<title>Menu Structure</title>
1121
1122<variablelist>
1123
1124<varlistentry id="view-documentswitcher">
1125<term><menuchoice>
1126<shortcut>
1127<keycombo action="simul">&Ctrl;&Tab;</keycombo>
1128</shortcut>
1129<guimenu>View</guimenu>
1130<guisubmenu>Last Used Views</guisubmenu>
1131</menuchoice></term>
1132<term><menuchoice>
1133<shortcut>
1134<keycombo action="simul">&Ctrl;&Shift;&Tab;</keycombo>
1135</shortcut>
1136<guimenu>View</guimenu>
1137<guisubmenu>Last Used Views (Reverse)</guisubmenu>
1138</menuchoice></term>
1139<listitem>
1140
1141<para><action>Opens</action> a list with the last viewed documents:</para>
1142
1143<screenshot id="screenshot-documentswitcher">
1144<screeninfo>Last viewed documents</screeninfo>
1145<mediaobject>
1146<imageobject><imagedata fileref="documentswitcher.png" format="PNG"/></imageobject>
1147</mediaobject>
1148</screenshot>
1149
1150<para>Keep the &Ctrl; key pressed and use the &Tab; key to cycle forward through the list.
1151Additionally press the &Shift; key to reverse the direction.
1152</para>
1153
1154<para>Keep the shortcut <keycombo action="simul">&Ctrl;&Tab;</keycombo> pressed and
1155can use the &Up;, &Down;, &Home; or
1156&End; keys to navigate in the list. Pressing a char key consecutively
1157will cycle through all items with the first matching in the list.
1158If you release the shortcut keys the view will switch to the selected document in the list.
1159</para>
1160</listitem>
1161</varlistentry>
1162
1163</variablelist>
1164
1165</sect2>
1166
1167</sect1>
1168
1169
1170<sect1 id="kate-application-plugin-fsbrowser">
1171
1172<title>File System Browser</title>
1173
1174<para>The File System Browser is a folder viewer, allowing you to open
1175files from a displayed folder in the current frame.</para>
1176
1177<sect2 id="fsbrowser-menu">
1178<title>Menu Structure</title>
1179<variablelist>
1180
1181<varlistentry id="view-toolviews-show-filebrowser">
1182<term><menuchoice>
1183<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
1184<guimenuitem>Show Filesystem Browser</guimenuitem>
1185</menuchoice></term>
1186<listitem>
1187<para>Toggle the display of &kate;'s Filesystem Browser.</para>
1188</listitem>
1189</varlistentry>
1190
1191</variablelist>
1192</sect2>
1193
1194<sect2 id="fsbrowser-interface">
1195<title>Interface</title>
1196
1197<para>From the top down, the Filesystem Browser consists of the following
1198elements:</para>
1199
1200<variablelist>
1201<varlistentry>
1202<term>A Toolbar</term>
1203<listitem>
1204<para>This contains standard navigations tool buttons:</para>
1205<variablelist>
1206<varlistentry>
1207<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-previous-22.png" format="PNG"/></imageobject></inlinemediaobject> Back</guiicon></term>
1208<listitem><para>Causes the folder view to <command>cd</command> to the previously displayed folder in the history.
1209This button is disabled, if there is no previous item.</para></listitem>
1210</varlistentry>
1211<varlistentry>
1212<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-next-22.png" format="PNG"/></imageobject></inlinemediaobject> Forward</guiicon></term>
1213<listitem><para>Causes the folder view to <command>cd</command> to the next folder in the history.
1214This button is disabled, if there is no next folder.</para></listitem>
1215</varlistentry>
1216<!--varlistentry>
1217<term><guibutton>Parent Folder</guibutton></term>
1218<listitem><para>This will cause the folder view to <command>cd</command> to the immediate parent of the currently displayed
1219folder if possible.</para></listitem>
1220</varlistentry-->
1221<varlistentry>
1222<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="bookmarks-22.png" format="PNG"/></imageobject></inlinemediaobject> Bookmarks</guiicon></term>
1223<listitem><para>Opens a submenu to edit or add bookmarks and to add a new bookmark folder.</para></listitem>
1224</varlistentry>
1225<varlistentry>
1226<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="system-switch-user-22.png" format="PNG"/></imageobject></inlinemediaobject> Current Document Folder</guiicon></term>
1227<listitem><para>This button will cause the folder view to
1228<command>cd</command> to the folder of the currently active
1229document if possible. This button is disabled, if the active document
1230is a new, unsaved file, or the folder in which it resides can not
1231be decided.</para></listitem>
1232</varlistentry>
1233<varlistentry>
1234<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject> Options</guiicon></term>
1235<listitem>
1236<variablelist>
1237<varlistentry>
1238<term><guimenuitem>Short View</guimenuitem></term>
1239<listitem><para>Displays only the filenames.</para></listitem>
1240</varlistentry>
1241<varlistentry>
1242<term><guimenuitem>Detailed View</guimenuitem></term>
1243<listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel> and
1244<guilabel>Size</guilabel> of the files.</para></listitem>
1245</varlistentry>
1246<varlistentry>
1247<term><guimenuitem>Tree View</guimenuitem></term>
1248<listitem><para>Like Short View, but folders can be expanded to view their contents.</para></listitem>
1249</varlistentry>
1250<varlistentry>
1251<term><guimenuitem>Detailed Tree View</guimenuitem></term>
1252<listitem><para>This also allows folders to be expanded, but displays the additional columns
1253available in Detailed View.</para></listitem>
1254</varlistentry>
1255<varlistentry>
1256<term><guimenuitem>Show Hidden Files</guimenuitem></term>
1257<listitem><para>Displays files normally hidden by your &OS;.</para></listitem>
1258</varlistentry>
1259<varlistentry>
1260<term><guimenuitem>Automatically synchronize with current document</guimenuitem></term>
1261<listitem><para>When this option is enabled the filesystem browser will automatically <command>cd</command>
1262to the folder of the document currently open in the editing area every time it changes.</para></listitem>
1263</varlistentry>
1264</variablelist>
1265</listitem>
1266</varlistentry>
1267</variablelist>
1268</listitem>
1269</varlistentry>
1270
1271<varlistentry>
1272<term>A Location Entry</term>
1273<listitem>
1274<para>This displays a breadcrumb navigation to the currently open folder, similarly to
1275&dolphin;.  You can click on a any folder to browse to it, or click on one of the
1276arrows to the left of a folder to select any folders beneath it.  You may also
1277select from your list of Places by clicking the leftmost icon in the breadcrumb
1278navigation, which displays an icon that represents your current Place.</para>
1279
1280<para>You can also click to the right of the breadcrumbs to change them to a text box
1281where you can type the path of a folder to browse. The &URL;
1282entry maintains a list of previously typed paths. To choose one, use
1283the arrow button to the right of the entry.</para>
1284<tip><para>The &URL; entry has folder auto-completion. The completion
1285method can be set using the &RMB; menu of the text
1286entry.</para></tip>
1287</listitem>
1288</varlistentry>
1289
1290<varlistentry>
1291<term>A Folder View</term>
1292<listitem><para>This is a standard &kde; folder view.</para></listitem>
1293</varlistentry>
1294
1295<varlistentry>
1296<term>A Filter Entry</term>
1297<listitem>
1298<para>The Filter entry allows you to enter a filter for the files
1299displayed in the folder view. The filter uses standard globs; patterns
1300must be separated by white space. Example: <userinput>*.cpp *.h
1301*.moc</userinput></para>
1302<para>To display all files, enter a single asterisk
1303<userinput>*</userinput>.</para>
1304<para>The filter entry saves the last 10 filters entered between
1305sessions.  To use one, press the arrow button on the right of the entry
1306and select the desired filter string.  You can disable the filter by pressing
1307the <guibutton>Clear text</guibutton> button to the left of the autocompletion
1308arrow button.</para>
1309</listitem>
1310</varlistentry>
1311
1312</variablelist>
1313</sect2>
1314
1315
1316<sect2 id="fsbrowser-config">
1317<title>Configuration</title>
1318
1319<para>This plugin can be configured on the <guilabel>Filesystem Browser</guilabel> page
1320of <link linkend="configuring-kate-configdialog">&kate;'s configuration</link>.</para>
1321
1322<variablelist>
1323<varlistentry>
1324<term><guilabel>Toolbar</guilabel></term>
1325<listitem><para>Configure the buttons on the Filesystem Browser toolbar
1326by moving the ones you want enabled to the <guilabel>Selected Actions</guilabel>
1327list, and order them using the arrow buttons at the side of the list.</para>
1328 </listitem>
1329</varlistentry>
1330
1331</variablelist>
1332</sect2>
1333</sect1>
1334
1335<sect1 id="kate-application-plugin-documents">
1336<title>The Documents List</title>
1337<!-- https://kate-editor.org/2010/09/12/kate-tree-view-plugin-update/-->
1338<sect2 id="documents-intro">
1339<title>Introduction</title>
1340
1341<para><indexterm><primary>Documents list</primary></indexterm>
1342The documents list displays a list of all documents currently open in
1343&kate;. Modified files will have a small <guiicon>floppy
1344disk</guiicon> icon on their left to indicate that state.</para>
1345
1346<para>On the top the Documents list has a toolbar with the following buttons:</para>
1347
1348<simplelist>
1349<member>
1350<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1351Create new document</member>
1352<member>
1353<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-open-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1354Open an existing document</member>
1355<member>
1356<guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1357Previous Document</member>
1358<member>
1359<guiicon><inlinemediaobject><imageobject><imagedata fileref="go-down-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1360Next Document</member>
1361<member>
1362<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1363Save the current document</member>
1364<member>
1365<guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-as-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1366Save the current document under a new name</member>
1367</simplelist>
1368
1369<para>By default, the Documents list appears in
1370<guimenuitem>Tree Mode</guimenuitem>, which displays the folder structure
1371surrounding all currently open documents. Also available is
1372<guimenuitem>List Mode</guimenuitem>, which displays a simple list of all
1373open documents. You can switch modes by right-clicking on the list and selecting
1374from the <guisubmenu>View Mode</guisubmenu> menu.</para>
1375
1376<para>If two or more files with the same name (located in different
1377folders) are open in <guimenuitem>List Mode</guimenuitem>, the names of the second will be prepended
1378<quote>(2)</quote> and so on. The tool-tip for the file will
1379display its full name including the path, allowing you to choose the
1380desired one.</para> <para>To display a document in the currently
1381active frame, click the document name in the list.</para>
1382
1383<para>The context menu has some common actions from the <guimenu>File</guimenu> menu.</para>
1384
1385<para>Additionally there are filemanager actions to rename or delete the file. With
1386<guimenuitem>Copy File Path</guimenuitem> you can copy the full path of the document
1387to the clipboard.</para>
1388
1389<para>You can sort the list in a few different ways by right clicking the
1390list and selecting from the <guisubmenu>Sort By</guisubmenu> menu.
1391
1392The options are:
1393<variablelist>
1394
1395<varlistentry>
1396<term><guimenuitem>Document Name</guimenuitem></term>
1397<listitem><para>Lists the documents alphabetically by their name.</para></listitem>
1398</varlistentry>
1399
1400<varlistentry>
1401<term><guimenuitem>Document Path</guimenuitem></term>
1402<listitem><para>Lists the documents alphabetically by the path to them.</para></listitem>
1403</varlistentry>
1404
1405<varlistentry>
1406<term><guimenuitem>Opening Order</guimenuitem></term>
1407<listitem><para>Lists the documents in the order of opening.</para></listitem>
1408</varlistentry>
1409
1410</variablelist>
1411
1412</para>
1413
1414<para>The document list will per default visualize your history by shading the
1415entries for the most recent documents with a background color. If the document
1416was edited, an extra color is blended in. The most recent document has the
1417strongest color, so that you can easily find the documents you are working on.
1418This feature can be disabled in the
1419<link linkend="config-dialog-documents">Documents</link> page
1420of the configuration dialog.</para>
1421<para>The default location of the document list in the &kate; window is to the left of the
1422editing area.</para>
1423
1424</sect2>
1425
1426<sect2 id="documents-menus">
1427<title>Menu Structure</title>
1428
1429<variablelist>
1430
1431<varlistentry id="view-document-previous">
1432<term><menuchoice>
1433<shortcut>
1434<keycombo action="simul">&Alt;&Up;</keycombo>
1435</shortcut>
1436<guimenu>View</guimenu>
1437<guimenuitem>Previous Document</guimenuitem>
1438</menuchoice></term>
1439<listitem>
1440<para>Opens the document displayed above the currently open document in the Documents list.</para>
1441</listitem>
1442</varlistentry>
1443
1444<varlistentry id="view-document-next">
1445<term><menuchoice>
1446<shortcut>
1447<keycombo action="simul">&Alt;&Down;</keycombo>
1448</shortcut>
1449<guimenu>View</guimenu>
1450<guimenuitem>Next Document</guimenuitem>
1451</menuchoice></term>
1452<listitem>
1453<para>Opens the document displayed below the currently open document in the Documents list.</para>
1454</listitem>
1455</varlistentry>
1456
1457<varlistentry id="view-active">
1458<term><menuchoice>
1459<guimenu>View</guimenu>
1460<guimenuitem>Show Active</guimenuitem>
1461</menuchoice></term>
1462<listitem>
1463<para>Displays the currently open document in the Documents list.</para>
1464</listitem>
1465</varlistentry>
1466
1467</variablelist>
1468
1469</sect2>
1470
1471<sect2 id="config-dialog-documents">
1472<title>Configuration</title>
1473
1474<variablelist>
1475<varlistentry>
1476<term><guilabel>Background Shading</guilabel></term>
1477<listitem><para>This section allows you to enable or disable the background
1478shading visualization of your recent activity, and choose which colors to use if
1479enabled.</para></listitem>
1480</varlistentry>
1481
1482<varlistentry>
1483<term><guilabel>Sort By</guilabel></term>
1484<listitem><para>Set how you want the document list sorted. This can be set
1485from the &RMB; menu in the document list as well.</para></listitem>
1486</varlistentry>
1487
1488<varlistentry>
1489<term><guilabel>View Mode</guilabel></term>
1490<listitem><para>This provides two options that effect the display of the
1491Documents tool view.  The <guilabel>Tree View</guilabel> option will display
1492the documents in a tree underneath the folders they are in, while the
1493<guilabel>List View</guilabel> option will display a flat list of documents.
1494</para></listitem>
1495</varlistentry>
1496
1497<varlistentry>
1498<term><guilabel>Show Full Path</guilabel></term>
1499<listitem><para>When Tree View and this option are enabled, the folder entries
1500displayed in the Documents tool view will display the full filesystem path to
1501the folder in addition to the name of the folder.  It has no effect in List
1502View.</para></listitem>
1503</varlistentry>
1504
1505<varlistentry>
1506<term><guilabel>Show Toolbar</guilabel></term>
1507<listitem><para>When Tree View and this option are enabled, a toolbar with
1508actions like <guibutton>Save</guibutton> is displayed above the
1509list of documents. Uncheck this option if the toolbar should be
1510hidden.</para></listitem>
1511</varlistentry>
1512
1513<varlistentry>
1514<term><guilabel>Show Close Button</guilabel></term>
1515<listitem><para>When this option is enabled, &kate; will show a close button
1516for opened documents on hover.</para></listitem>
1517</varlistentry>
1518
1519</variablelist>
1520
1521</sect2>
1522
1523</sect1>
1524
1525<sect1 id="kate-application-plugin-gdb">
1526<!--https://kate-editor.org/2011/06/23/kate-plugin-updates-part-2/-->
1527<sect1info>
1528<authorgroup>
1529<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
1530<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
1531</authorgroup>
1532</sect1info>
1533<title>&gdb; Plugin</title>
1534
1535<sect2 id="gdb-intro">
1536<title>Introduction</title>
1537
1538<para>&kate;'s &gdb; plugin provides a simple frontend to the popular &GNU;
1539Project Debugger.</para>
1540
1541<important>
1542<para>Previous experience with &gdb; is strongly recommended.  For more
1543information on using &gdb;, visit <ulink url="https://www.gnu.org/software/gdb/">the
1544&gdb; website</ulink>.</para>
1545</important>
1546
1547<para>You can enable the &gdb; plugin in
1548<link linkend="config-dialog-plugins">the Plugins section of &kate;'s
1549configuration</link>.</para>
1550
1551<para>For the plugin to work properly, you must have a source file (of any type
1552supported by &gdb;) and an executable.</para>
1553
1554<tip>
1555<para>If you compile using &gcc;/<command>g++</command> you might want to use
1556the <command><parameter>-ggdb</parameter></command> command line argument.
1557</para>
1558</tip>
1559
1560<para>After these preparations are made, open the source file in &kate;,
1561enter the path to the executable in the <guilabel>Settings</guilabel> tab of the
1562<guilabel>Debug View</guilabel> tool view, and select
1563<menuchoice><guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem></menuchoice>
1564from the menu to get started.</para>
1565
1566</sect2>
1567
1568<sect2 id="gdb-menus">
1569<title>Menu and Toolbar Structure</title>
1570
1571<para>All of these options are available in &kate;'s menus, and many are
1572available on the Debug toolbar as well.</para>
1573
1574<variablelist>
1575
1576<varlistentry id="gdb-menus-show-debug-view">
1577<term><menuchoice>
1578<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Debug View</guimenuitem>
1579</menuchoice></term>
1580<listitem><para>Shows a tool view containing &gdb; output, the &gdb; command
1581line used, and other settings.</para></listitem>
1582</varlistentry>
1583
1584<varlistentry id="gdb-menus-show-locals-and-stack">
1585<term><menuchoice>
1586<guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Locals and Stack</guimenuitem>
1587</menuchoice></term>
1588<listitem><para>Shows a list of all currently loaded variables and their values and a &gdb; backtrace.
1589</para></listitem>
1590</varlistentry>
1591
1592<varlistentry id="gdb-menus-targets">
1593<term><menuchoice>
1594<guimenu>Debug</guimenu><guisubmenu>Targets</guisubmenu>
1595</menuchoice></term>
1596<listitem><para>A submenu containing a list of targets (executables).
1597</para></listitem>
1598</varlistentry>
1599
1600<varlistentry id="gdb-menus-start">
1601<term><menuchoice>
1602<guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem>
1603</menuchoice></term>
1604<listitem><para>Starts &gdb; with a target.</para></listitem>
1605</varlistentry>
1606
1607<varlistentry id="gdb-menus-kill">
1608<term><menuchoice>
1609<guimenu>Debug</guimenu><guimenuitem>Kill / Stop Debugging</guimenuitem>
1610</menuchoice></term>
1611<listitem><para>Stops &gdb;.</para></listitem>
1612</varlistentry>
1613
1614<varlistentry id="gdb-menus-restart">
1615<term><menuchoice>
1616<guimenu>Debug</guimenu><guimenuitem>Restart Debugging</guimenuitem>
1617</menuchoice></term>
1618<listitem><para>Restarts &gdb;.</para></listitem>
1619</varlistentry>
1620
1621<varlistentry id="gdb-menus-break">
1622<term><menuchoice>
1623<guimenu>Debug</guimenu><guimenuitem>Toggle Breakpoint / Break</guimenuitem>
1624</menuchoice></term>
1625<listitem><para>Set a breakpoint at the current cursor position.
1626</para></listitem>
1627</varlistentry>
1628
1629<varlistentry id="gdb-menus-step-in">
1630<term><menuchoice>
1631<guimenu>Debug</guimenu><guimenuitem>Step In</guimenuitem>
1632</menuchoice></term>
1633<listitem><para>Execute the present statement (function call will be debugged).
1634</para></listitem>
1635</varlistentry>
1636
1637<varlistentry id="gdb-menus-step-over">
1638<term><menuchoice>
1639<guimenu>Debug</guimenu><guimenuitem>Step Over</guimenuitem>
1640</menuchoice></term>
1641<listitem><para>Execute the present statement (function call will not be
1642debugged).</para></listitem>
1643</varlistentry>
1644
1645<varlistentry id="gdb-menus-step-out">
1646<term><menuchoice>
1647<guimenu>Debug</guimenu><guimenuitem>Step Out</guimenuitem>
1648</menuchoice></term>
1649<listitem><para>Resumes execution until the program that is executing
1650terminates.</para></listitem>
1651</varlistentry>
1652
1653<varlistentry id="gdb-menus-move-pc">
1654<term><menuchoice>
1655<guimenu>Debug</guimenu><guimenuitem>Move PC</guimenuitem>
1656</menuchoice></term>
1657<listitem><para>Move program counter (next execution).</para></listitem>
1658</varlistentry>
1659
1660<varlistentry id="gdb-menus-run-to-cursor">
1661<term><menuchoice>
1662<guimenu>Debug</guimenu><guimenuitem>Run To Cursor</guimenuitem>
1663</menuchoice></term>
1664<listitem><para>Runs the program until it reaches current cursor position.
1665</para></listitem>
1666</varlistentry>
1667
1668<varlistentry id="gdb-menus-continue">
1669<term><menuchoice>
1670<guimenu>Debug</guimenu><guimenuitem>Continue</guimenuitem>
1671</menuchoice></term>
1672<listitem><para>Ignores any breakpoints and executes program until it terminates
1673(successfully or not).</para></listitem>
1674</varlistentry>
1675
1676<varlistentry id="gdb-menus-print-value">
1677<term><menuchoice>
1678<guimenu>Debug</guimenu><guimenuitem>Print Value</guimenuitem>
1679</menuchoice></term>
1680<listitem><para>Prints the value of the variable that the cursor is currently
1681pointing to.</para></listitem>
1682</varlistentry>
1683
1684<varlistentry id="gdb-menus-toolbar">
1685<term><menuchoice>
1686<guimenu>Settings</guimenu><guisubmenu>Toolbars Shown</guisubmenu><guimenuitem>&gdb; Plugin</guimenuitem>
1687</menuchoice></term>
1688<listitem><para>Display the debugging toolbar.</para></listitem>
1689</varlistentry>
1690
1691</variablelist>
1692
1693</sect2>
1694
1695<sect2 id="gdb-debug-view">
1696<title>Debug View</title>
1697
1698<para>The <guilabel>Debug View</guilabel> tool view consists of several tabs:
1699</para>
1700
1701<variablelist>
1702
1703<varlistentry>
1704<term><guilabel>&gdb; Output</guilabel></term>
1705<listitem>
1706<para>Contains output from &gdb; and a &gdb; command line.</para>
1707
1708<screenshot id="screenshot-gdb-output">
1709<screeninfo>The Output Tab</screeninfo>
1710<mediaobject>
1711<imageobject><imagedata fileref="gdb-output.png" format="PNG"/></imageobject>
1712<textobject><phrase>The Output tab.</phrase></textobject>
1713<caption><para>The <guilabel>Output</guilabel> tab displaying the output from a
1714debugging session.</para></caption>
1715</mediaobject>
1716</screenshot>
1717
1718</listitem>
1719</varlistentry>
1720
1721<varlistentry>
1722<term><guilabel>Settings</guilabel></term>
1723<listitem>
1724<variablelist>
1725
1726<varlistentry>
1727<term><guilabel>Executable</guilabel></term>
1728<listitem><para>Path to the target (executable) for debugging.</para></listitem>
1729</varlistentry>
1730
1731<varlistentry>
1732<term><guilabel>Working Directory</guilabel></term>
1733<listitem><para>The current working directory provided to the target.
1734</para></listitem>
1735</varlistentry>
1736
1737<varlistentry>
1738<term><guilabel>Arguments</guilabel></term>
1739<listitem><para>Arguments passed to the program.</para></listitem>
1740</varlistentry>
1741
1742<varlistentry>
1743<term><guilabel>Keep focus</guilabel></term>
1744<listitem><para>Keeps focus on the &gdb; command line.</para></listitem>
1745</varlistentry>
1746
1747<varlistentry>
1748<term><guilabel>Redirect IO</guilabel></term>
1749<listitem><para>Opens a new <guilabel>IO</guilabel> tab in the <guilabel>Debug
1750View</guilabel> where you can view output and provide input to the running
1751program.</para></listitem>
1752</varlistentry>
1753
1754</variablelist>
1755
1756<screenshot id="screenshot-gdb-settings">
1757<screeninfo>The Settings dialog</screeninfo>
1758<mediaobject>
1759<imageobject><imagedata fileref="gdb-settings.png" format="PNG"/></imageobject>
1760<textobject><phrase>The Settings dialog</phrase></textobject>
1761<caption><para>The <guilabel>Settings</guilabel> dialog displaying the configuration
1762of a debugging session.</para></caption>
1763</mediaobject>
1764</screenshot>
1765
1766</listitem>
1767</varlistentry>
1768
1769<varlistentry>
1770<term><guilabel>IO</guilabel></term>
1771<listitem>
1772<para>Contains an area that displays output from the running program and a
1773command line where you may provide input to it.</para>
1774
1775<screenshot id="screenshot-gdb-io">
1776<screeninfo>The IO Tab</screeninfo>
1777<mediaobject>
1778<imageobject><imagedata fileref="gdb-io.png" format="PNG"/></imageobject>
1779<textobject><phrase>The IO tab.</phrase></textobject>
1780<caption><para>The <guilabel>IO</guilabel> tab displaying output from a simple
1781test program.</para></caption>
1782</mediaobject>
1783</screenshot>
1784
1785</listitem>
1786</varlistentry>
1787
1788</variablelist>
1789
1790</sect2>
1791
1792<sect2 id="gdb-other">
1793<title>Call Stack and Locals</title>
1794
1795<para>The <guilabel>Call Stack</guilabel> tool view contains a list of the formatted
1796backtrace returned from &gdb;.</para>
1797
1798<screenshot id="screenshot-gdb-call-stack">
1799<screeninfo>The &gdb; Call Stack Tool View</screeninfo>
1800<mediaobject>
1801<imageobject><imagedata fileref="gdb-call-stack.png" format="PNG"/></imageobject>
1802<textobject><phrase>The Call Stack tool view.</phrase></textobject>
1803<caption><para>The &gdb; Plugin's <guilabel>Call Stack</guilabel> tool view.
1804</para></caption>
1805</mediaobject>
1806</screenshot>
1807
1808<para>The <guilabel>Locals</guilabel> tool view contains a list of all currently
1809loaded variables from the program and their corresponding values.</para>
1810
1811<screenshot id="screenshot-gdb-locals">
1812<screeninfo>The &gdb; Locals Tool View</screeninfo>
1813<mediaobject>
1814<imageobject><imagedata fileref="gdb-locals.png" format="PNG"/></imageobject>
1815<textobject><phrase>The Locals tool view.</phrase></textobject>
1816<caption><para>The &gdb; Plugin's <guilabel>Locals</guilabel> tool view.
1817</para></caption>
1818</mediaobject>
1819</screenshot>
1820
1821</sect2>
1822
1823<sect2 id="gdb-ack">
1824<title>Thanks and Acknowledgments</title>
1825
1826<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
1827writing much of this section.</para>
1828
1829</sect2>
1830
1831</sect1>
1832
1833<sect1 id="kate-application-plugin-projects">
1834<!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate -->
1835
1836<title>Project Plugin</title>
1837
1838<sect2 id="project-intro">
1839<title>Introduction</title>
1840
1841<para>The basic idea of the Project plugin is to have a structured list of
1842files belonging to the project with the following properties:</para>
1843
1844<orderedlist>
1845<listitem><para>Provide a structured view of the files</para></listitem>
1846<listitem><para>Make it easy and very fast to open and switch projects</para></listitem>
1847<listitem><para>Support search and replace for a project</para></listitem>
1848<listitem><para>Provide simple auto completion</para></listitem>
1849<listitem><para>Make it simple to quickly open files in the project</para></listitem>
1850<listitem><para>Support for building the project</para></listitem>
1851</orderedlist>
1852</sect2>
1853
1854<sect2 id="project-view">
1855<title>Structured View of the Files</title>
1856
1857<para>Once the Project plugin is loaded in the &kate; configuration page, open a file
1858in a project and a sidebar
1859appears that lists all projects as well as the project files as follows:</para>
1860
1861<screenshot id="screenshot-project-view">
1862<screeninfo>Project View</screeninfo>
1863<mediaobject>
1864<imageobject><imagedata fileref="project-view.png" format="PNG"/></imageobject>
1865</mediaobject>
1866</screenshot>
1867
1868<para>As you can see, the currently active project is <quote>Kate</quote>, and its contents is
1869listed in the tree view. Clicking on files in the tree view opens the file in the
1870editor. Further, a context menu is provided with which you can open files with
1871other applications, such as a <filename class="extension">.ui</filename> file with Qt Designer.</para>
1872<para>You can filter the items by typing parts of the file name you are looking for into the search bar
1873at the bottom of the list.</para>
1874</sect2>
1875
1876<sect2 id="project-switch">
1877<title>Switching Projects</title>
1878
1879<para>The idea is that you never have to open a project manually, this is even not
1880supported at all. Hence, what happens if you open a file, the Project plugin quickly
1881scans the folder and its parent folders for a <filename>.kateproject</filename> file. If found, the project
1882is automatically loaded.</para>
1883
1884<para>Furthermore, if you open another document in &kate;, that belongs to another project,
1885the Project plugin automatically switches the current project. So intuitively, always the
1886correct project is active. Of course, you can also switch the currently active project
1887using the combo box.</para>
1888
1889</sect2>
1890
1891<sect2 id="project-search-replace">
1892<title>Search and Replace in Projects</title>
1893
1894<para>&kate; has a Search and Replace plugin that shows up in the
1895bottom sidebar. If a project is loaded, open the Search and Replace sidebar,
1896and switch to the mode to search and replace in the current project:</para>
1897
1898<screenshot id="screenshot-projects-search">
1899<screeninfo>Search in Projects</screeninfo>
1900<mediaobject>
1901<imageobject><imagedata fileref="project-search.png" format="PNG"/></imageobject>
1902</mediaobject>
1903</screenshot>
1904
1905</sect2>
1906
1907<sect2 id="project-autocompletition">
1908<title>Simple Auto Completion</title>
1909
1910<para>With the knowledge of all files belonging to a project, the Project plugin provides
1911simple auto completion facilities based on CTags. If a project is initially opened, CTags
1912parses all project files in a background thread and saves the CTags information to
1913<filename class="directory">/tmp</filename>. This file then is used to populate the auto
1914completion popup in &kate;.</para>
1915
1916<para>In contrast, without this auto completion, &kate; is only capable of showing auto
1917completion items based on the words in the current file. So the auto completion provided
1918by the Project plugin is much more powerful.</para>
1919
1920<screenshot id="screenshot-completion-search">
1921<screeninfo>Completion in Projects</screeninfo>
1922<mediaobject>
1923<imageobject><imagedata fileref="project-completition.png" format="PNG"/></imageobject>
1924</mediaobject>
1925</screenshot>
1926
1927<para>If CTags is missing, a passive popup warns you about this issue. It is also noteworthy,
1928that the CTags file in <filename class="directory">/tmp</filename> is cleaned up when &kate;
1929exits, so the plugin does not pollute any folder with unwanted files.</para>
1930
1931</sect2>
1932
1933<sect2 id="project-quickopen">
1934<title>Quick Opening Files</title>
1935
1936<para>As clicking on files in the tree view is not the fastest way to open a file, &kate;
1937provides a built-in quick open mechanism you can activate with
1938<keycombo action="simul">&Ctrl;&Alt;<keycap>O</keycap></keycombo>.
1939What you the get is a list like this:</para>
1940
1941<screenshot id="screenshot-project-quickopen">
1942<screeninfo>Quick Open</screeninfo>
1943<mediaobject>
1944<imageobject><imagedata fileref="project-quickopen.png" format="PNG"/></imageobject>
1945</mediaobject>
1946</screenshot>
1947
1948<para>You can filter by typing parts of the file name you are looking for, and you can
1949also navigate with the arrow keys and page up/down through the list.
1950Hitting &Enter; activates the selected file, while &Esc; hides the quick open view again.</para>
1951
1952<para>Further, the quick open remembers the previous file. So when you change to the
1953quick open view the previously activated file is automatically selected and you just
1954need to hit &Enter;, which comes very handy at times.</para>
1955
1956</sect2>
1957
1958<sect2 id="project-build">
1959<title>Support for Building the Project</title>
1960
1961<para>Another feature is to have support for the <link linkend="projects-build-support">Build Plugin</link>,
1962so that it automatically is configured correctly.</para>
1963
1964</sect2>
1965
1966<sect2 id="project-create">
1967<title>Creating Projects</title>
1968
1969<sect3 id="project-autoload">
1970<!--https://kate-editor.org/2014/10/12/autoloading-projects-plugin-kate-5/-->
1971<title>Loading Projects Automatically</title>
1972
1973<para>The Project plugin has an auto-loading feature. You can read the file list from
1974the version control system. To this end, auto-loading for the respective version control
1975system needs to be enabled in the settings (enabled by default):
1976</para>
1977
1978<screenshot id="screenshot-project-configure">
1979<screeninfo>Project Plugin Configuration</screeninfo>
1980<mediaobject>
1981<imageobject><imagedata fileref="project-configure.png" format="PNG"/></imageobject>
1982</mediaobject>
1983</screenshot>
1984
1985</sect3>
1986
1987<sect3 id="project-manual">
1988<title>Creating Projects Manually</title>
1989<para>
1990You just have to create a <filename>.kateproject</filename> file in the root folder of the project.
1991For instance, the <quote>Kate</quote> <filename>.kateproject</filename> file looks like this:
1992</para>
1993
1994<screen>
1995{
1996  "name": "Kate"
1997, "files": [ { "git": 1 } ]
1998}
1999</screen>
2000
2001<para>The file content is written in &JSON; syntax. The project name is <quote>Kate</quote>, and
2002the files contained in should be read from &git;.
2003</para>
2004
2005<para>
2006Also supported instead of <literal>git</literal> is subversion through <literal>svn</literal> and
2007mercurial through <literal>hg</literal>.
2008If you do not want to read from a version control system, you can tell it to recursively
2009load files from directories as follows:
2010</para>
2011
2012<screen>
2013{
2014  "name": "Kate"
2015, "files": [ { "directory": "kate", "filters": ["*.cpp", "*.h", "*.ui", "CMakeLists.txt", "Find*.cmake"], "recursive": 1 } ]
2016}
2017</screen>
2018
2019<para>
2020Here, subfolders and filters define what’s part of the project.
2021You can also mix version control and files based on filters.
2022</para>
2023
2024<para id="projects-build-support">If you want to add support for the Build plugin, you could write a
2025<filename>.kateproject</filename> like this:</para>
2026
2027<screen>
2028{
2029  "name": "Kate"
2030, "files": [ { "git": 1 } ]
2031, "build": {
2032    "directory": "build"
2033  , "build": "make all"
2034  , "clean": "make clean"
2035  , "install": "make install"
2036  }
2037}
2038</screen>
2039
2040<para>
2041In case you have a <filename>.kateproject</filename> file tracked by a control
2042version system, but you need to tweak the configuration for a particular
2043workspace, you can save those changes to a separated file named
2044<filename>.kateproject.local</filename>. The content of this file will take
2045precedence over <filename>.kateproject</filename>.
2046</para>
2047
2048</sect3>
2049
2050</sect2>
2051
2052<sect2 id="project-current">
2053<title>Current Project</title>
2054
2055<para>Using <menuchoice><shortcut><keycombo action="simul">&Alt;<keycap>1</keycap></keycombo></shortcut>
2056<guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem></menuchoice> you can open the
2057<guilabel>Current Project</guilabel> view at the bottom of the editor window with four tabs:</para>
2058
2059<screenshot id="screenshot-project-current">
2060<screeninfo>Current Project</screeninfo>
2061<mediaobject>
2062<imageobject><imagedata fileref="project-current-analysis.png" format="PNG"/></imageobject>
2063</mediaobject>
2064</screenshot>
2065
2066<variablelist>
2067
2068<varlistentry>
2069<term>
2070<guimenu>Terminal Panel</guimenu>
2071</term>
2072<listitem>
2073<para>A <link linkend="kate-application-plugin-konsole">Terminal emulator</link> starting in the
2074root folder of the project.</para>
2075</listitem>
2076</varlistentry>
2077
2078<varlistentry>
2079<term>
2080<guimenu>Code Index</guimenu>
2081</term>
2082<listitem>
2083<para>Entering characters into the search bar will start the search and display matching names
2084of functions, classes, symbols &etc; together with kind, filename and line number.</para>
2085<para>Select an item in the list to jump to the corresponding line in the source file.</para>
2086</listitem>
2087</varlistentry>
2088
2089<varlistentry>
2090<term>
2091<guimenu>Code Analysis</guimenu>
2092</term>
2093<listitem>
2094<para>Click <guilabel>Start Analysis</guilabel> to run a static code analysis for the C and C++
2095using <command>cppcheck</command> and to generate a report showing filename, line number, severity
2096(style, warning &etc;) and the issue found.</para>
2097<para>Select an item in the list to jump to the corresponding line in the source file.</para>
2098</listitem>
2099</varlistentry>
2100<!--FIXME options for cppcheck? configurable?-->
2101<varlistentry>
2102<term>
2103<guimenu>Notes</guimenu>
2104</term>
2105<listitem>
2106<para>Text entered in this tab will be saved in the file
2107<filename>.kateproject.notes</filename>.</para>
2108</listitem>
2109</varlistentry>
2110
2111</variablelist>
2112
2113</sect2>
2114
2115<sect2 id="projects-menu">
2116<title>The Projects Menu</title>
2117
2118<para>The <guimenu>Projects</guimenu> menu allows you to switch between
2119currently open projects.  It is displayed by the Project plugin.</para>
2120
2121<variablelist>
2122
2123<varlistentry id="projects-back">
2124<term><menuchoice>
2125<shortcut>
2126<keycombo action="simul">&Ctrl;&Alt;&Left;</keycombo>
2127</shortcut>
2128<guimenu>Projects</guimenu>
2129<guimenuitem>Back</guimenuitem>
2130</menuchoice></term>
2131<listitem>
2132<para>Switch to the previous project.</para>
2133</listitem>
2134</varlistentry>
2135
2136<varlistentry id="projects-forward">
2137<term><menuchoice>
2138<shortcut>
2139<keycombo action="simul">&Ctrl;&Alt;&Right;</keycombo>
2140</shortcut>
2141<guimenu>Projects</guimenu>
2142<guimenuitem>Forward</guimenuitem>
2143</menuchoice></term>
2144<listitem>
2145<para>Switch to the next project.</para>
2146</listitem>
2147</varlistentry>
2148
2149<varlistentry id="projects-goto">
2150<term><menuchoice>
2151<shortcut>
2152<keycombo action="simul">&Alt;<keycap>1</keycap></keycombo>
2153</shortcut>
2154<guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem>
2155</menuchoice></term>
2156<listitem>
2157<para>Open the <guilabel>Current Project</guilabel> view at the bottom of the editor window.</para>
2158</listitem>
2159</varlistentry>
2160
2161</variablelist>
2162
2163</sect2>
2164<!--
2165context menu Project->Lookup:xxx
2166-->
2167
2168</sect1>
2169
2170<!--FIXME Replicode
2171Projects Replicode run / stop-->
2172
2173<sect1 id="kate-application-plugin-lspclient">
2174<title>LSP Client Plugin</title>
2175
2176<para>The LSP Client plugin provides many language features such as code completion, code navigation or finding references
2177based on the <ulink url="https://microsoft.github.io/language-server-protocol/">Language Server Protocol</ulink>.</para>
2178
2179<para>Once you have enabled the LSP Client in the plugin page, a new
2180page called LSP Client will appear in your &kate; configuration dialog.
2181</para>
2182
2183<sect2 id="lspclient-menu">
2184<title>Menu Structure</title>
2185
2186<para>
2187If appropriate, a corresponding LSP command is also mentioned in the
2188explanation below, the documentation of which may then provide additional
2189background and interpretation, though it may vary depending on the actual
2190language. The phrase 'current symbol' refers to the symbol corresponding to the
2191current cursor position, as so determined by the language and server
2192implementation.
2193</para>
2194
2195<variablelist>
2196
2197<varlistentry id="lspclient-definition">
2198<term><menuchoice>
2199<guimenu>LSP Client</guimenu>
2200<guisubmenu>Go to Definition</guisubmenu>
2201</menuchoice></term>
2202<listitem>
2203<para>[textDocument/definition] Go to current symbol definition.</para>
2204</listitem>
2205</varlistentry>
2206
2207<varlistentry id="lspclient-declaration">
2208<term><menuchoice>
2209<guimenu>LSP Client</guimenu>
2210<guisubmenu>Go to Declaration</guisubmenu>
2211</menuchoice></term>
2212<listitem>
2213<para>[textDocument/declaration] Go to current symbol declaration.</para>
2214</listitem>
2215</varlistentry>
2216
2217<varlistentry id="lspclient-typedefinition">
2218<term><menuchoice>
2219<guimenu>LSP Client</guimenu>
2220<guisubmenu>Go to Type Definition</guisubmenu>
2221</menuchoice></term>
2222<listitem>
2223<para>[textDocument/typeDefinition] Go to current symbol type definition.</para>
2224</listitem>
2225</varlistentry>
2226
2227<varlistentry id="lspclient-references">
2228<term><menuchoice>
2229<guimenu>LSP Client</guimenu>
2230<guisubmenu>Find References</guisubmenu>
2231</menuchoice></term>
2232<listitem>
2233<para>[textDocument/references] Find references to current symbol.</para>
2234</listitem>
2235</varlistentry>
2236
2237<varlistentry id="lspclient-implementation">
2238<term><menuchoice>
2239<guimenu>LSP Client</guimenu>
2240<guisubmenu>Find Implementations</guisubmenu>
2241</menuchoice></term>
2242<listitem>
2243<para>[textDocument/implementation] Find implementations of current symbol.</para>
2244</listitem>
2245</varlistentry>
2246
2247<varlistentry id="lspclient-highlight">
2248<term><menuchoice>
2249<guimenu>LSP Client</guimenu>
2250<guisubmenu>Highlight</guisubmenu>
2251</menuchoice></term>
2252<listitem>
2253<para>[textDocument/documentHighlight] Highlight current symbol references in current document.</para>
2254</listitem>
2255</varlistentry>
2256
2257<varlistentry id="lspclient-hover">
2258<term><menuchoice>
2259<guimenu>LSP Client</guimenu>
2260<guisubmenu>Hover</guisubmenu>
2261</menuchoice></term>
2262<listitem>
2263<para>[textDocument/hover] Hover info for current symbol.</para>
2264</listitem>
2265</varlistentry>
2266
2267<varlistentry id="lspclient-format">
2268<term><menuchoice>
2269<guimenu>LSP Client</guimenu>
2270<guisubmenu>Format</guisubmenu>
2271</menuchoice></term>
2272<listitem>
2273<para>[textDocument/formatting] [textDocument/rangeFormatting]
2274Format the current document or current selection.</para>
2275</listitem>
2276</varlistentry>
2277
2278<varlistentry id="lspclient-rename">
2279<term><menuchoice>
2280<guimenu>LSP Client</guimenu>
2281<guisubmenu>Rename</guisubmenu>
2282</menuchoice></term>
2283<listitem>
2284<para>[textDocument/rename] Rename current symbol.</para>
2285</listitem>
2286</varlistentry>
2287
2288<varlistentry id="lspclient-quick-fix">
2289<term><menuchoice>
2290<guimenu>LSP Client</guimenu>
2291<guisubmenu>Quick Fix</guisubmenu>
2292</menuchoice></term>
2293<listitem>
2294<para>[textDocument/codeAction, workspace/executeCommand]
2295Computes and applies a quick fix for a diagnostic on current position (or line).</para>
2296</listitem>
2297</varlistentry>
2298
2299<varlistentry id="lspclient-completion-documentation">
2300<term><menuchoice>
2301<guimenu>LSP Client</guimenu>
2302<guisubmenu>Show selected completion documentation</guisubmenu>
2303</menuchoice></term>
2304<listitem>
2305<para>Show documentation for a selected item in the completion list.</para>
2306</listitem>
2307</varlistentry>
2308
2309<varlistentry id="lspclient-signature-help">
2310<term><menuchoice>
2311<guimenu>LSP Client</guimenu>
2312<guisubmenu>Enable signature help with auto completion</guisubmenu>
2313</menuchoice></term>
2314<listitem>
2315<para>Also show signature help in the completion list.</para>
2316</listitem>
2317</varlistentry>
2318
2319<varlistentry id="lspclient-declaration-references">
2320<term><menuchoice>
2321<guimenu>LSP Client</guimenu>
2322<guisubmenu>Include declaration in references</guisubmenu>
2323</menuchoice></term>
2324<listitem>
2325<para>Request to include a symbol's declaration when requesting references.</para>
2326</listitem>
2327</varlistentry>
2328
2329<varlistentry id="lspclient-completion-parens">
2330<term><menuchoice>
2331<guimenu>LSP Client</guimenu>
2332<guisubmenu>Add parentheses upon function completion</guisubmenu>
2333</menuchoice></term>
2334<listitem>
2335<para>Automatically add a pair of parentheses after completion of a function.</para>
2336</listitem>
2337</varlistentry>
2338
2339<varlistentry id="lspclient-show-hover">
2340<term><menuchoice>
2341<guimenu>LSP Client</guimenu>
2342<guisubmenu>Show hover information</guisubmenu>
2343</menuchoice></term>
2344<listitem>
2345<para>Show hover information upon (mouse cursor) hover.
2346Regardless of this setting, the request can always be manually initiated.
2347</para>
2348</listitem>
2349</varlistentry>
2350
2351<varlistentry id="lspclient-format-typing">
2352<term><menuchoice>
2353<guimenu>LSP Client</guimenu>
2354<guisubmenu>Format on typing</guisubmenu>
2355</menuchoice></term>
2356<listitem>
2357<para>[document/onTypeFormatting] Format parts of document when typing certain trigger characters.
2358For example, this might apply indentation upon newline, or as otherwise determined by LSP Server.
2359Note that editor indentation scripts might be trying to do the same (depending on the mode)
2360and so it may not be advisable to have both enabled at the same time.
2361</para>
2362</listitem>
2363</varlistentry>
2364
2365<varlistentry id="lspclient-incremental-sync">
2366<term><menuchoice>
2367<guimenu>LSP Client</guimenu>
2368<guisubmenu>Incremental document synchronization</guisubmenu>
2369</menuchoice></term>
2370<listitem>
2371<para>Send partial document edits to update the server rather than whole document text (if supported).</para>
2372</listitem>
2373</varlistentry>
2374
2375<varlistentry id="lspclient-highlight-goto">
2376<term><menuchoice>
2377<guimenu>LSP Client</guimenu>
2378<guisubmenu>Highlight goto location</guisubmenu>
2379</menuchoice></term>
2380<listitem>
2381<para>Provide a transient visual cue after performing a goto to a location (of definition, declaration, etc).</para>
2382</listitem>
2383</varlistentry>
2384
2385<varlistentry id="lspclient-diagnostics">
2386<term><menuchoice>
2387<guimenu>LSP Client</guimenu>
2388<guisubmenu>Show diagnostics notifications</guisubmenu>
2389</menuchoice></term>
2390<listitem>
2391<para>[textDocument/publishDiagnostics] Process and show diagnostics notifications sent by server.</para>
2392</listitem>
2393</varlistentry>
2394
2395<varlistentry id="lspclient-diagnostics-highlight">
2396<term><menuchoice>
2397<guimenu>LSP Client</guimenu>
2398<guisubmenu>Show diagnostics highlights</guisubmenu>
2399</menuchoice></term>
2400<listitem>
2401<para>Add text highlights for ranges indicated in diagnostics.</para>
2402</listitem>
2403</varlistentry>
2404
2405<varlistentry id="lspclient-diagnostics-marks">
2406<term><menuchoice>
2407<guimenu>LSP Client</guimenu>
2408<guisubmenu>Show diagnostics marks</guisubmenu>
2409</menuchoice></term>
2410<listitem>
2411<para>Add document marks for lines indicated in diagnostics.</para>
2412</listitem>
2413</varlistentry>
2414
2415<varlistentry id="lspclient-diagnostics-tab">
2416<term><menuchoice>
2417<guimenu>LSP Client</guimenu>
2418<guisubmenu>Switch to diagnostic tab</guisubmenu>
2419</menuchoice></term>
2420<listitem>
2421<para>Switch to the diagnostic tab in the plugin toolview.</para>
2422</listitem>
2423</varlistentry>
2424
2425<varlistentry id="lspclient-close-non-diagnostics">
2426<term><menuchoice>
2427<guimenu>LSP Client</guimenu>
2428<guisubmenu>Close all non-diagnostics tabs</guisubmenu>
2429</menuchoice></term>
2430<listitem>
2431<para>Close all non-diagnostics (&eg; references) tabs in plugin toolview.</para>
2432</listitem>
2433</varlistentry>
2434
2435<varlistentry id="lspclient-restart">
2436<term><menuchoice>
2437<guimenu>LSP Client</guimenu>
2438<guisubmenu>Restart LSP Server</guisubmenu>
2439</menuchoice></term>
2440<listitem>
2441<para>Restart current document's LSP Server.</para>
2442</listitem>
2443</varlistentry>
2444
2445<varlistentry id="lspclient-restart-all">
2446<term><menuchoice>
2447<guimenu>LSP Client</guimenu>
2448<guisubmenu>Restart all LSP Servers</guisubmenu>
2449</menuchoice></term>
2450<listitem>
2451<para>Stop all LSP Servers which will then be (re)started as needed.</para>
2452</listitem>
2453</varlistentry>
2454
2455</variablelist>
2456
2457</sect2>
2458
2459
2460<sect2 id="lspclient-configuration">
2461<title>Configuration</title>
2462
2463<para>
2464The plugin's configuration page mostly allows for persistent configuration of
2465some of the above menu items.  However, there is one additional entry
2466to specify the Server Configuration file.  This is a &JSON; file that
2467can be used to specify the LSP server to start (and then to communicate
2468with over stdin/stdout).  For convenience, some default configuration
2469is included, which can be inspected in the plugin's configuration page.
2470To aid in the explanation below, an excerpt of that configuration is given here:
2471</para>
2472
2473<screen>
2474{
2475    "servers": {
2476        "bibtex": {
2477            "use": "latex",
2478            "highlightingModeRegex": "^BibTeX$"
2479        },
2480        "c": {
2481            "command": ["clangd", "-log=error", "--background-index"],
2482            "commandDebug": ["clangd", "-log=verbose", "--background-index"],
2483            "url": "https://clang.llvm.org/extra/clangd/",
2484            "highlightingModeRegex": "^(C|ANSI C89|Objective-C)$"
2485        },
2486        "cpp": {
2487            "use": "c",
2488            "highlightingModeRegex": "^(C\\+\\+|ISO C\\+\\+|Objective-C\\+\\+)$"
2489        },
2490        "d": {
2491            "command": ["dls", "--stdio"],
2492            "url": "https://github.com/d-language-server/dls",
2493            "highlightingModeRegex": "^D$"
2494        },
2495        "fortran": {
2496            "command": ["fortls"],
2497            "rootIndicationFileNames": [".fortls"],
2498            "url": "https://github.com/hansec/fortran-language-server",
2499            "highlightingModeRegex": "^Fortran.*$"
2500        },
2501        "javascript": {
2502            "command": ["typescript-language-server", "--stdio"],
2503            "rootIndicationFileNames": ["package.json", "package-lock.json"],
2504            "url": "https://github.com/theia-ide/typescript-language-server",
2505            "highlightingModeRegex": "^JavaScript.*$",
2506            "documentLanguageId": false
2507        },
2508        "latex": {
2509            "command": ["texlab"],
2510            "url": "https://texlab.netlify.com/",
2511            "highlightingModeRegex": "^LaTeX$"
2512        },
2513        "go": {
2514            "command": ["go-langserver"],
2515            "commandDebug": ["go-langserver", "-trace"],
2516            "url": "https://github.com/sourcegraph/go-langserver",
2517            "highlightingModeRegex": "^Go$"
2518        },
2519        "python": {
2520            "command": ["python3", "-m", "pyls", "--check-parent-process"],
2521            "url": "https://github.com/palantir/python-language-server",
2522            "highlightingModeRegex": "^Python$"
2523        },
2524        "rust": {
2525            "command": ["rls"],
2526            "path": ["%{ENV:HOME}/.cargo/bin", "%{ENV:USERPROFILE}/.cargo/bin"],
2527            "rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
2528            "url": "https://github.com/rust-lang/rls",
2529            "highlightingModeRegex": "^Rust$"
2530        },
2531        "ocaml": {
2532            "command": ["ocamlmerlin-lsp"],
2533            "url": "https://github.com/ocaml/merlin",
2534            "highlightingModeRegex": "^Objective Caml.*$"
2535        }
2536    }
2537}
2538</screen>
2539
2540<para>
2541Note that each "command" may be an array or a string (in which case it is
2542split into an array). Also, a top-level "global" entry (next to "server") is
2543considered as well (see further below).
2544The specified binary is searched for in the usual way, e.g. using <literal>PATH</literal>.
2545If it is installed in some custom location, then the latter may have to be
2546extended.  Or alternatively, a (sym)link or wrapper script may be used in a location
2547that is within the usual <literal>PATH</literal>.  As illustrated above,
2548one may also specify a "path" that will be searched for after the standard locations.
2549</para>
2550
2551<para>
2552All of the entries in "command", "root" and "path" are subject to variable expansion.
2553</para>
2554
2555<para>
2556The "highlightingModeRegex" is used to map the highlighting mode as used by &kate;
2557to the language id of the server. If no regular expression is given, the language id
2558itself is used.  If a "documentLanguageId" entry is set to false, then no
2559language id is provided to the server when opening the document.  This may
2560have better results for some servers that are more precise in determining
2561the document type than doing so based on a kate mode.
2562</para>
2563
2564<para>
2565From the above example, the gist is presumably clear.  In addition, each server
2566entry object may also have an "initializationOptions" entry, which is passed
2567along to the server as part of the 'initialize' method.
2568If present, a "settings" entry is passed to the server by means of the
2569'workspace/didChangeConfiguration' notification.
2570</para>
2571
2572<para>
2573Various stages of override/merge are applied;
2574<itemizedlist>
2575<listitem>
2576<para>user configuration (loaded from file) overrides (internal) default configuration</para>
2577</listitem>
2578<listitem>
2579<para>"lspclient" entry in <filename>.kateproject</filename> project configuration overrides the above</para>
2580</listitem>
2581<listitem>
2582<para>the resulting "global" entry is used to supplement (not override) any server entry</para>
2583</listitem>
2584</itemizedlist>
2585</para>
2586
2587<para> One server instance is used per (root, servertype) combination. If "root"
2588is specified as an absolute path, then it used as-is, otherwise it is relative
2589to the <quote>projectBase</quote> (as determined by the <link
2590linkend="kate-application-plugin-projects">Project plugin</link>) if applicable,
2591or otherwise relative to the document's directory. If not specified and
2592"rootIndicationFileNames" is an array as filenames, then a parent directory of
2593current document containing such a file is selected. As a last fallback, the
2594home directory is selected as "root". For any document, the resulting "root"
2595then determines whether or not a separate instance is needed. If so, the "root"
2596is passed as rootUri/rootPath. </para>
2597
2598<para>
2599In general, it is recommended to leave root unspecified, as it is not that
2600important for a server (your mileage may vary though).  Fewer server instances
2601are obviously more efficient, and they also have a 'wider' view than
2602the view of many separate instances.
2603</para>
2604
2605<sect3 id="lspclient-customization">
2606<title>LSP Server Configuration</title>
2607
2608<para>
2609
2610Each particular LSP server has its own way of customization and may use
2611language/tool specific means for configuration, &eg;
2612<filename>tox.ini</filename> (a.o. for python),
2613<filename>.clang-format</filename> for C++ style format. Such configuration may
2614then also be used by other (non-LSP) tools (such as then
2615<application>tox</application> or <application>clang-format</application>). On
2616top of that, some LSP servers also load configuration from custom files (&eg;
2617<filename>.ccls</filename>). Furthermore, custom server configuration can also
2618be passed through LSP (protocol), see the aforementioned
2619"initializationOptions" and "settings" entries in server configuration.
2620
2621</para>
2622
2623<para>
2624Since various level of override/merge are applied, the following example
2625of user specified client configuration tweaks some python-language-server
2626configuration.
2627</para>
2628
2629<screen>
2630{
2631    "servers": {
2632        "python": {
2633            "settings": {
2634                "pyls": {
2635                    "plugins": {
2636                        "pylint": {
2637                            "enable": true
2638                        }
2639                    }
2640                }
2641            }
2642        }
2643    }
2644}
2645</screen>
2646
2647<para>
2648Unfortunately, LSP server configuration/customization is often not so well
2649documented, in ways that only examining the source code shows configuration
2650approaches and the set of available configuration options.  In particular,
2651the above example's server supports many more options in "settings".
2652See <ulink url="https://github.com/neoclide/coc.nvim/wiki/Language-servers">
2653another LSP client's documentation</ulink> for various other language server
2654examples and corresponding settings, which can easily and readily be
2655transformed to the &JSON; configuration that is used here and outlined above.
2656</para>
2657
2658</sect3>
2659
2660<sect3 id="lspclient-diagnostics-suppression">
2661<title>LSP Server Diagnostic Suppression</title>
2662
2663<para>
2664It may happen that diagnostics are reported which are not quite useful.
2665This can be quite cumbersome, especially if there are many (often of the same
2666kind). In some cases, this may be tweaked by language (server) specific means.
2667For example, the <ulink url="https://clangd.llvm.org/config.html">clangd
2668configuration  mechanism</ulink> allows tweaking of some diagnostics aspects. In
2669general, however, it may not always be evident how to do so, or it may not even
2670be possible at all in desired ways due to server limitations or bug.
2671</para>
2672
2673<para>
2674As such, the plugin supports diagnostics suppression similar to e.g. valgrind
2675suppressions. The most fine-grained configuration can be supplied in a
2676"suppressions" key in the (merged) &JSON; configuration.
2677</para>
2678
2679<screen>
2680{
2681    "servers": {
2682        "c": {
2683            "suppressions": {
2684                "rulename": ["filename", "foo"],
2685                "clang_pointer": ["", "clang-tidy", "clear_pointer"],
2686            }
2687        }
2688    }
2689}
2690</screen>
2691
2692<para>
2693Each (valid) rule has an arbitrary name and is defined by an array of length
26942 or 3 which provides a regex to match against the (full) filename, a regex
2695to match against the diagnostic (text) and an optional regex matched against
2696the (source code range of) text to which the diagnostic applies.
2697</para>
2698
2699<para>
2700In addition to the above fine-grained configuration, the context menu in the
2701diagnostics tab also supports add/remove of suppressions that match a particular
2702diagnostic (text) exactly, either globally (any file) or locally (the specific
2703file in question).  These suppression are stored in and loaded from session config.
2704</para>
2705
2706</sect3>
2707
2708<sect3 id="lspclient-troubleshooting">
2709<title>LSP Server Troubleshooting</title>
2710
2711<para>
2712It is one thing to describe how to configure a (custom) LSP server for
2713any particular language, it is another to end up with the server running
2714smoothly. Usually, the latter is fortunately the case.  Sometimes, however,
2715problems may arise due to either some "silly" misconfiguration or a more
2716fundamental problem with the server itself.  The latter might typically manifest
2717itself as a couple of attempts at starting the server, as so reported in &kate;
2718Output tab. The latter, however, is only meant to convey high-level messages or
2719progress rather than to provide detailed diagnostics, and even less so for what
2720is in fact another process (the LSP server).
2721</para>
2722
2723<para>
2724The usual way to diagnose this is to add some flag(s) to the startup
2725command (of the language server) that enables (additional) logging (to
2726some file or standard error), in as far as it does not do so by default. If
2727&kate; is then started on the command line, then one might be able to obtain
2728more (in)sight in what might be going wrong.
2729</para>
2730
2731<para>
2732It may also be informative to examine the protocol exchange between &kate;'s
2733LSP client and the LSP server.  Again, the latter usually has ways to trace
2734that.  The LSP client also provides additional debug tracing (to stderr)
2735when &kate; is invoked with the following
2736<literal>QT_LOGGING_RULES=katelspclientplugin=true</literal> suitably
2737<literal>export</literal>'ed.
2738</para>
2739
2740</sect3>
2741
2742</sect2>
2743
2744<!--TODO: Supported languages, describe features and actions a bit -->
2745
2746<!--<screenshot id="screenshot-rust-configuration">
2747<screeninfo>Rust Configuration</screeninfo>
2748<mediaobject>
2749<imageobject><imagedata fileref="rust-configuration.png" format="PNG"/></imageobject>
2750</mediaobject>
2751</screenshot>
2752
2753<para>Edit the command to run <ulink url="https://github.com/phildawes/racer">Racer</ulink>,
2754an utility intended to provide Rust code completion for editors.</para>
2755
2756<para>You also need the Rust source code and have to provide the path to the source tree.
2757</para>
2758
2759<para>While typing code a popup list appears with items for completion:
2760</para>
2761
2762<screenshot id="screenshot-rust-completion">
2763<screeninfo>Rust Completion</screeninfo>
2764<mediaobject>
2765<imageobject><imagedata fileref="rust-completion.png" format="PNG"/></imageobject>
2766</mediaobject>
2767</screenshot>
2768
2769<para>In addition to code completion popups, the plugin also installs
2770a <guimenuitem>Go to Definition</guimenuitem> action in the <guimenu>Edit</guimenu> menu and
2771in the context menu. You can configure a keyboard shortcut for it as well.
2772</para>
2773
2774<para>This action will open the document containing the definition if needed, activate
2775its view and place the cursor at the start of the definition.
2776</para>-->
2777
2778</sect1>
2779
2780<sect1 id="kate-application-plugin-searchinfiles">
2781<sect1info>
2782<authorgroup><author>
2783&TC.Hollingsworth; &TC.Hollingsworth.mail;
2784</author></authorgroup>
2785</sect1info>
2786<title>Search &amp; Replace</title>
2787
2788<sect2 id="searchinfiles-intro">
2789<title>Introduction</title>
2790<para>&kate;'s Search &amp; Replace plugin allows you to search for text or
2791<ulink url="help:/katepart/regular-expressions.html">regular expressions</ulink>
2792in many different files at once.  You can search all open files, all the files
2793in one directory and optionally its subdirectories, or in the active file.
2794You can even filter by filename, for instance searching only files
2795that end with a particular file extension.</para>
2796
2797</sect2>
2798
2799<sect2 id="searchinfiles-ui">
2800<title>Interface</title>
2801
2802<sect3 id="searchinfiles-ui-query">
2803<title>Search Query</title>
2804
2805<para>The following options are always displayed at the top of the Search in
2806Files tool view:</para>
2807
2808<variablelist>
2809
2810<varlistentry>
2811<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="tab-new-22.png" format="PNG"/>
2812</imageobject></inlinemediaobject></guiicon></term>
2813<listitem><para>
2814You can have as many searches as you want open at the same time.  Simply click
2815the new tab button at the top-left corner of the Search
2816tool view and a new results tab will open permitting you to perform another
2817search.
2818</para></listitem>
2819</varlistentry>
2820
2821<varlistentry>
2822<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
2823</imageobject></inlinemediaobject></guiicon></term>
2824<listitem><para>
2825The button in the top right-corner of the Search in Files tool view will
2826toggle the bottom half of the tool view between displaying additional options
2827for the Search in Folder mode and the results of your search.
2828</para></listitem>
2829</varlistentry>
2830
2831<varlistentry>
2832<term><guilabel>Find</guilabel></term>
2833<listitem><para>
2834This is where you type in what you want to find.  You may enter standard text,
2835or a regular expression if enabled.
2836</para></listitem>
2837</varlistentry>
2838
2839<varlistentry>
2840<term><guilabel>Replace</guilabel> (text box)</term>
2841<listitem><para>
2842Replacement text that will be added to file(s) in place of the text in the
2843<guilabel>Find</guilabel> text box.
2844</para></listitem>
2845</varlistentry>
2846
2847<varlistentry>
2848<term><guibutton>Search</guibutton></term>
2849<listitem><para>
2850When you've finished configuring everything, just press the
2851<guibutton>Search</guibutton> button to perform your search.  You may also press
2852&Enter; in the <guilabel>Find</guilabel> text box to do the same.
2853</para></listitem>
2854</varlistentry>
2855
2856<varlistentry>
2857<term><guibutton>Replace</guibutton></term>
2858<listitem><para>
2859When you've finished configuring everything, just press the
2860<guibutton>Replace</guibutton> button to replace the text entered in the
2861<guilabel>Find</guilabel> text box with that of the <guilabel>Replace</guilabel>
2862text box.  You may also press &Enter; in the <guilabel>Replace</guilabel> text
2863box to do the same.
2864</para></listitem>
2865</varlistentry>
2866
2867<varlistentry>
2868<term><guibutton>Next</guibutton></term>
2869<listitem><para>
2870Go to the next match of your search query, switching files if necessary.
2871</para></listitem>
2872</varlistentry>
2873
2874<varlistentry>
2875<term><guibutton>Replace Checked</guibutton></term>
2876<listitem><para>
2877The same as <guibutton>Replace</guibutton>, but will only perform replacements
2878in files that are checked in the pane below.
2879</para></listitem>
2880</varlistentry>
2881
2882</variablelist>
2883</sect3>
2884
2885<sect3 id="searchinfiles-ui-folder">
2886<title>Search in Folder Options</title>
2887
2888<para>These options are displayed below the aforementioned query options. If search
2889results are being displayed instead, press the <guiicon><inlinemediaobject><imageobject>
2890<imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
2891button to display them.</para>
2892
2893<variablelist>
2894
2895<varlistentry>
2896<term><guilabel>Search in</guilabel></term>
2897<listitem><para>
2898This has three options.  Select <guilabel>Open Files</guilabel> to search all
2899files currently open in &kate;.  Select <guilabel>Folder</guilabel> to
2900search inside a folder and optionally its subfolders.  Select <guilabel>Current
2901File</guilabel> to search only in the active file.
2902</para>
2903<para>If the <guilabel>Projects</guilabel> plugin is loaded, you can also search in
2904the <guilabel>Current Project</guilabel> or in <guilabel>All Open Projects</guilabel>.
2905</para>
2906</listitem>
2907</varlistentry>
2908
2909<varlistentry>
2910<term><guilabel>Match case</guilabel></term>
2911<listitem><para>
2912Restricts search results to only those that have the exact same combination
2913of upper and lower case letters as your search query.
2914</para></listitem>
2915</varlistentry>
2916
2917<varlistentry>
2918<term><guilabel>Regular expressions</guilabel></term>
2919<listitem><para>
2920Permits you to use <ulink url="help:/katepart/regular-expressions.html">regular
2921expressions</ulink> instead of simple text as your search query.
2922</para></listitem>
2923</varlistentry>
2924
2925<varlistentry>
2926<term><guilabel>Expand results</guilabel></term>
2927<listitem><para>
2928Display all the results found in each file, instead of just a list of files
2929that contain the search query.
2930</para></listitem>
2931</varlistentry>
2932
2933<varlistentry>
2934<term><guilabel>Folder</guilabel></term>
2935<listitem><para>
2936You may enter the path of the folder you wish to search.  For instance, you might
2937enter <userinput>~/development/kde/kate/</userinput> if you wished to search the
2938&kate; source code.  This option is only available when using
2939<guilabel>in Folder</guilabel> mode.
2940</para></listitem>
2941</varlistentry>
2942
2943<varlistentry>
2944<term><guiicon>Open file dialog</guiicon></term>
2945<listitem><para>
2946Press this button to locate the folder in your desktop's folder browser. This
2947button only works when using <guilabel>Folder</guilabel> mode.
2948</para></listitem>
2949</varlistentry>
2950
2951<varlistentry>
2952<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/>
2953</imageobject></inlinemediaobject></guiicon></term>
2954<listitem><para>
2955Press this button to change <guilabel>Folder</guilabel> to the parent of the
2956currently selected folder. This button only works when using
2957<guilabel>Folder</guilabel> mode.
2958</para></listitem>
2959</varlistentry>
2960
2961<varlistentry>
2962<term><guiicon><inlinemediaobject><imageobject><imagedata fileref="view-refresh-22.png" format="PNG"/>
2963</imageobject></inlinemediaobject></guiicon></term>
2964<listitem><para>
2965This button will set the <guilabel>Folder</guilabel> entry to the folder in which
2966the currently open document is located. This button only works when using
2967<guilabel>Folder</guilabel> mode.
2968</para></listitem>
2969</varlistentry>
2970
2971<varlistentry>
2972<term><guilabel>Filter</guilabel></term>
2973<listitem><para>
2974This permits you to only search filenames that match a particular pattern. For
2975instance, to only search files written in C++, change it to
2976<userinput>*.cpp</userinput>.  To search only files beginning with
2977<literal>kate</literal>, change it to <userinput>kate*</userinput>. You can
2978enter multiple filters separated with a comma (<userinput>,</userinput>). This
2979option is not available when using <guilabel>Open files</guilabel> mode.
2980</para></listitem>
2981</varlistentry>
2982
2983<varlistentry>
2984<term><guilabel>Exclude</guilabel></term>
2985<listitem><para>
2986The opposite of <guilabel>Filter</guilabel>, this prevents &kate; from
2987searching files that match the specified patterns. As with
2988<guilabel>Filter</guilabel>, you can enter multiple patterns separated with a
2989comma (<userinput>,</userinput>). This option is not available when using
2990<guilabel>Open files</guilabel> mode.
2991</para></listitem>
2992</varlistentry>
2993
2994<varlistentry>
2995<term><guilabel>Recursive</guilabel></term>
2996<listitem><para>
2997If this option is enabled, &kate; will also search in all subfolders of the
2998selected folder. This option is only available when using
2999<guilabel>Folder</guilabel> mode.
3000</para></listitem>
3001</varlistentry>
3002
3003<varlistentry>
3004<term><guilabel>Include hidden</guilabel></term>
3005<listitem><para>
3006If this option is enabled, &kate; will also search in files or folders that
3007are typically hidden by your &OS;. This option is only available when using
3008<guilabel>Folder</guilabel> mode.
3009</para></listitem>
3010</varlistentry>
3011
3012<varlistentry>
3013<term><guilabel>Follow symbolic links</guilabel></term>
3014<listitem><para>
3015The Search in Files plugin typically does not follow
3016<ulink url="https://en.wikipedia.org/wiki/Symbolic_link">symbolic links</ulink>.
3017When this option is enabled, the plugin will follow them instead and search inside
3018the files or folders they reference. This option is only available when using
3019<guilabel>Folder</guilabel> mode.
3020</para>
3021<warning><para>It's possible for symbolic links to reference a folder that is the
3022parent of the folder currently being searched, or other folders that contain
3023symbolic links to their parent.  If there is such a link in the folder being
3024searched and this option is enabled, &kate; will repeatedly follow the link
3025and search the folder, and the search will never complete.</para></warning>
3026</listitem>
3027</varlistentry>
3028
3029<varlistentry>
3030<term><guilabel>Include binary files</guilabel></term>
3031<listitem><para>
3032If enabled, &kate; will also search in files that do not appear to be text
3033files.
3034</para></listitem>
3035</varlistentry>
3036
3037</variablelist>
3038</sect3>
3039
3040<sect3 id="searchinfiles-ui-results">
3041<title>Search Results</title>
3042
3043<para>The results of your search are displayed below the query options.  If
3044options for Search in Folder mode are displayed, simply press the
3045<guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
3046</imageobject></inlinemediaobject></guiicon>
3047button to display them.  They will also
3048automatically be displayed as soon as a search is performed.</para>
3049
3050<para>The search results display a list of files that contains text that matches
3051your search query, followed by the number of matches found in that file.</para>
3052
3053<para>To see a list of matches in that file, simply click the expansion arrow
3054to the left of the file name.  (If you selected the <guilabel>Expand
3055results</guilabel> option, this will already be done for you.)  The line number
3056each match is found on will be displayed, followed by the contents of that line,
3057with your search query indicated in bold text.</para>
3058
3059<para>To open the file your result was found in, simply double-click it.  &kate;
3060will open the file if needed.  You can also move the cursor to the location of
3061a particular match by double-clicking on its listing instead of the file name.
3062</para>
3063
3064</sect3>
3065</sect2>
3066
3067<sect2 id="searchinfiles-menu">
3068<title>Menu Structure</title>
3069
3070<variablelist>
3071
3072<varlistentry id="edit-searchinfiles">
3073<term><menuchoice>
3074<shortcut>
3075<keycombo action="simul">&Ctrl;&Alt;<keycap>F</keycap></keycombo>
3076</shortcut>
3077<guimenu>Edit</guimenu>
3078<guimenuitem>Search in Files</guimenuitem>
3079</menuchoice></term>
3080<listitem>
3081<para>Launches the Search and Replace tool view.</para>
3082</listitem>
3083</varlistentry>
3084
3085<varlistentry id="edit-next-match">
3086<term><menuchoice>
3087<guimenu>Edit</guimenu>
3088<guimenuitem>Go to Next Match</guimenuitem>
3089</menuchoice></term>
3090<listitem>
3091<para>Go to the next match in a search performed by the Search and Replace
3092plugin.</para>
3093</listitem>
3094</varlistentry>
3095
3096<varlistentry id="edit-previous-match">
3097<term><menuchoice>
3098<guimenu>Edit</guimenu>
3099<guimenuitem>Go to Previous Match</guimenuitem>
3100</menuchoice></term>
3101<listitem>
3102<para>Go to the previous match in a search performed by the Search and Replace
3103plugin.</para>
3104</listitem>
3105</varlistentry>
3106
3107<varlistentry id="view-toolviews-searchandreplace">
3108<term><menuchoice>
3109<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3110<guimenuitem>Show Search and Replace</guimenuitem>
3111</menuchoice></term>
3112<listitem>
3113<para>Toggle the display of &kate;'s <guilabel>Search and Replace</guilabel> tool.
3114</para>
3115</listitem>
3116</varlistentry>
3117
3118</variablelist>
3119
3120</sect2>
3121</sect1>
3122
3123<sect1 id="kate-application-plugin-snippets">
3124<sect1info>
3125<authorgroup>
3126<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
3127<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
3128</authorgroup>
3129</sect1info>
3130<title>&kate; Snippets</title>
3131
3132<sect2 id="snippets-intro">
3133<title>Introduction</title>
3134<para>&kate; Snippets is a plugin used to save you some time by adding support for
3135so-called <quote>snippets</quote> (re-usable source code, machine code or text). The plugin
3136also supports code completion and &javascript;.</para>
3137</sect2>
3138
3139<sect2 id="snippets-menu">
3140<title>Menu Structure</title>
3141
3142<variablelist>
3143<varlistentry>
3144<term><menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3145<guimenuitem>Show Snippets</guimenuitem></menuchoice></term>
3146<listitem><para>Shows snippets panel containing all snippets in your repository
3147that are for the currently opened file type.</para></listitem>
3148</varlistentry>
3149
3150<varlistentry id="tools-create-snippet">
3151<term><menuchoice>
3152<guimenu>Tools</guimenu>
3153<guimenuitem>Create Snippet</guimenuitem>
3154</menuchoice></term>
3155<listitem>
3156<para>Create a new snippet, which is a reusable chunk of text you
3157may insert in any part of any document.</para>
3158</listitem>
3159</varlistentry>
3160
3161</variablelist>
3162
3163</sect2>
3164
3165<sect2 id="snippets-panel">
3166<title>Snippets panel</title>
3167
3168<screenshot id="screenshot-snippets-panel">
3169<screeninfo>&kate; Snippets Panel</screeninfo>
3170<mediaobject>
3171<imageobject><imagedata fileref="snippets-panel.png" format="PNG"/></imageobject>
3172<textobject><phrase>The &kate; snippets panel.</phrase></textobject>
3173<caption><para>The panel for &kate; Snippets.</para></caption>
3174</mediaobject>
3175</screenshot>
3176
3177<para>In the panel you should see a list of snippet repositories,
3178along with options to create your own, get them from the Internet or load
3179them from a local file.  Each repository has a checkbox that can be used to
3180activate or deactivate it.  There are also buttons to edit and delete existing
3181repositories.</para>
3182
3183<sect3 id="snippets-repo-internet">
3184<title>Loading Snippet Repository Files</title>
3185<para>You can download snippet repositories from the Internet.  Just click
3186<guibutton>Get New Snippets</guibutton> and a window with a list of snippet
3187repositories will open.  After downloading the desired snippet, make sure that
3188you have activated it.</para>
3189<!--FIXME no way to load a local file ?
3190<para>You can also load snippet repositories from a local file using the file
3191browser at the bottom of the panel.  Click <guibutton>Copy to repository</guibutton>
3192when finished.</para>-->
3193</sect3>
3194
3195<sect3 id="snippets-repo-editor">
3196<title>Creating and Editing Repositories</title>
3197
3198<para>To create a new snippet repository, click <guibutton>Add Repository</guibutton>.
3199You should now see a dialog that asks for the name of the snippet file, license and
3200author. After choosing the desired options, click <guibutton>OK</guibutton>.</para>
3201
3202<screenshot id="screenshot-snippets-repository">
3203<screeninfo>Snippet Editor</screeninfo>
3204<mediaobject>
3205<imageobject><imagedata fileref="snippets-repository.png" format="PNG"/></imageobject>
3206<textobject><phrase>The repository editor.</phrase></textobject>
3207<caption><para>The repository editor interface.</para></caption>
3208</mediaobject>
3209</screenshot>
3210
3211<para>The snippet repository editor contains the following options:</para>
3212
3213<variablelist>
3214
3215<varlistentry>
3216<term><guilabel>Name</guilabel></term>
3217<listitem><para>Appears in the list of snippets in the tool view and is also
3218searched when using the code completion feature.</para></listitem>
3219</varlistentry>
3220
3221<varlistentry>
3222<term><guilabel>Namespace</guilabel></term>
3223<listitem><para>Prefix used while using code completion.</para></listitem>
3224</varlistentry>
3225
3226<varlistentry>
3227<term><guilabel>License</guilabel></term>
3228<listitem><para>Select the license for you snippet repository.</para></listitem>
3229</varlistentry>
3230
3231<varlistentry>
3232<term><guilabel>Authors</guilabel></term>
3233<listitem><para>Enter the name(s) of the author(s) of the snippet file.</para></listitem>
3234</varlistentry>
3235
3236<varlistentry>
3237<term><guilabel>File types</guilabel></term>
3238<listitem><para>Select the file type(s) you want the snippet repository to apply
3239to.  It is set to <quote></quote> by default, so the repository applies to all files. You
3240can change it to something like <userinput>C++</userinput> for instance, or select
3241from a list by clicking on the items.  You can specify more
3242than one file type pressing the &Shift; while adding types.</para></listitem>
3243</varlistentry>
3244
3245</variablelist>
3246
3247</sect3>
3248
3249<sect3 id="snippets-editor">
3250<title>Creating and Editing Snippets</title>
3251
3252<screenshot id="screenshot-snippets-form">
3253<screeninfo>Snippet Editor</screeninfo>
3254<mediaobject>
3255<imageobject><imagedata fileref="snippets-form.png" format="PNG"/></imageobject>
3256<textobject><phrase>The snippet editor.</phrase></textobject>
3257<caption><para>The snippet editor interface.</para></caption>
3258</mediaobject>
3259</screenshot>
3260
3261<variablelist>
3262
3263<varlistentry>
3264<term><guilabel>Name</guilabel></term>
3265<listitem><para>The name will be shown in the completion list.</para></listitem>
3266</varlistentry>
3267
3268<varlistentry>
3269<term>Shortcut</term>
3270<listitem><para>Pressing this shortcut will insert the snippet into the document.</para></listitem>
3271</varlistentry>
3272
3273<varlistentry>
3274<term><guilabel>Snippets</guilabel></term>
3275<listitem><para>The text your snippet will insert into the document.</para>
3276<para>A snippet can contain editable fields. They can be cycled by
3277pressing &Tab;. The following expressions can be used in the template
3278text to create fields:</para>
3279<para><userinput>${<replaceable>field_name</replaceable>}</userinput> creates a
3280simple, editable field. All subsequent occurrences of the same
3281<replaceable>field_name</replaceable> create fields which mirror the contents
3282of the first during editing.</para>
3283<para><userinput>${<replaceable>field_name=default</replaceable>}</userinput>
3284can be used to specify a default value for the field.
3285<replaceable>default</replaceable> can be any &javascript; expression.</para>
3286<para>Use <userinput>${<replaceable>field_name</replaceable>=<replaceable>text</replaceable>}</userinput>
3287to specify a fixed string as default value.</para>
3288<para><userinput>${func(<replaceable>other_field1</replaceable>,
3289<replaceable>other_field2</replaceable>, ...)}</userinput> can be used to create a
3290field which evaluates a &javascript; function on each edit and contains its
3291contents. See the <guilabel>Scripts</guilabel> tab for more information.</para>
3292<para><userinput>${cursor}</userinput> can be used to mark the end position
3293of the cursor after everything else was filled in.</para>
3294</listitem>
3295</varlistentry>
3296
3297<varlistentry>
3298<term><guilabel>Scripts</guilabel></term>
3299<listitem><para>&javascript; helper functions to use in your snippets.</para>
3300<para>All &javascript; functions should return the contents you want to place in a
3301template field as a string.</para>
3302<para>Functions are called in a scope which contains the contents of all
3303editable template fields as local variables. For example in a snippet
3304containing <userinput>${<replaceable>field</replaceable>}</userinput>,
3305a variable called <userinput>field</userinput> will be present which contains
3306the up-to-date contents of the template field. Those variables can either
3307be used in the function statically or passed as arguments, by using the
3308<userinput>${func(field)}</userinput> or <userinput>${<replaceable>field2=func(field)</replaceable>}</userinput>
3309syntax in the snippet string.</para>
3310<para>You can use
3311the <ulink url="help:/katepart/dev-scripting.html#dev-scripting-api">&kate; scripting API</ulink>
3312to get the selected text, full text, file name and
3313more by using the appropriate methods of the <userinput>document</userinput>
3314and <userinput>view</userinput> objects. Refer to the scripting API
3315documentation for more information</para>
3316</listitem>
3317</varlistentry>
3318
3319</variablelist>
3320</sect3>
3321</sect2>
3322
3323<sect2 id="snippets-using">
3324<title>Using Snippets</title>
3325
3326<screenshot id="screenshot-snippets-usage">
3327<screeninfo>&kate; Snippets in Action</screeninfo>
3328<mediaobject>
3329<imageobject><imagedata fileref="snippets-usage.png" format="PNG"/></imageobject>
3330<textobject><phrase>Accessing &kate; Snippets from a tool view and a drop down menu.</phrase></textobject>
3331<caption><para>Selecting from a list of snippets.</para></caption>
3332</mediaobject>
3333</screenshot>
3334
3335<para>You can call snippets in two ways:</para>
3336
3337<itemizedlist>
3338<listitem><para>By choosing the snippet from the tool view.</para></listitem>
3339<listitem><para>While writing, you can press <keycombo action="simul">&Ctrl;
3340&Space;</keycombo>, which will display all the snippets in a
3341convenient window from which you can choose.  This key combination provides
3342functionality similar to code completion.</para></listitem>
3343</itemizedlist>
3344
3345<para>If the snippet contains variables (besides <literal>${cursor}</literal>)
3346the cursor will automatically go to the first occurrence of a variable and will
3347wait for you to write something. When you are done, you can press &Tab; to move
3348to the next variable, and so on.</para>
3349
3350</sect2>
3351
3352<sect2 id="snippets-ack">
3353<title>Thanks and Acknowledgments</title>
3354<para>&kate; Snippets was written by Joseph Wenninger.</para>
3355<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
3356writing much of this section.</para>
3357</sect2>
3358
3359</sect1>
3360
3361
3362<sect1 id="kate-application-plugin-sql">
3363<sect1info>
3364<authorgroup>
3365<author><firstname>Ömer</firstname> <othername>Faruk</othername> <surname>ORUÇ</surname></author>
3366<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
3367</authorgroup>
3368</sect1info>
3369<title>SQL Plugin</title>
3370
3371<sect2 id="sql-intro">
3372<title>Introduction</title>
3373
3374<para>The Structured Query Language (SQL) is a specialized language for updating,
3375deleting, and requesting information from databases.</para>
3376
3377<para>The &kate; SQL Plugin allows you to:</para>
3378
3379<itemizedlist>
3380<listitem><para>Create a database</para></listitem>
3381<listitem><para>Connect to existing databases</para></listitem>
3382<listitem><para>Insert and delete data in the database</para></listitem>
3383<listitem><para>Execute queries</para></listitem>
3384<listitem><para>Display results in a table</para></listitem>
3385</itemizedlist>
3386
3387</sect2>
3388
3389<sect2 id="sql-connecting">
3390<title>Connecting to a Database</title>
3391
3392<para>Select <guibutton>Add Connection</guibutton> from the <guimenu>SQL</guimenu>
3393menu or toolbar, and then select the &Qt; database driver you want to use (including
3394QSQLITE, QMYSQL3, QMYSQL, QODBC3, QODBC, QPSQL7, and QPSQL).  If you can't see
3395the desired driver, you need to install it.  Then, press <guibutton>Next</guibutton>.
3396</para>
3397
3398<para>If the database you selected uses a file, simply indicate the database's
3399location and press the <guibutton>Next</guibutton> button.  If it requires connecting
3400to a server, you must enter the hostname of the server, your username and password,
3401and any other information that particular driver may require. Then press
3402<guibutton>Next</guibutton>.</para>
3403
3404<para>Finally, give a name to your connection, and press <guibutton>Finish</guibutton>.</para>
3405
3406</sect2>
3407
3408<sect2 id="sql-querying">
3409<title>Running Queries</title>
3410
3411<sect3 id="sql-querying-insert-delete-update">
3412<title>INSERT/DELETE/UPDATE</title>
3413
3414<para>You can insert, delete, and update data using the SQL plugin just as
3415you would from the command line or from within a program.  Simply enter a query
3416and press the <guibutton>Run query</guibutton> button in the toolbar or
3417use <menuchoice><guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem></menuchoice>
3418(<keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo>).</para>
3419
3420<example>
3421<title>Some Example Queries</title>
3422<variablelist>
3423
3424<varlistentry>
3425<term><command>INSERT</command></term>
3426<listitem><para><programlisting>
3427INSERT INTO <replaceable>table_name</replaceable> ("<replaceable>feature1</replaceable>", "<replaceable>feature2</replaceable>", "<replaceable>feature3</replaceable>", "<replaceable>feature4</replaceable>", "<replaceable>feature5</replaceable>")
3428VALUES ("<replaceable>value1</replaceable>", "<replaceable>value2</replaceable>", "<replaceable>value3</replaceable>", "<replaceable>value4</replaceable>", "<replaceable>value5</replaceable>" )
3429</programlisting></para></listitem>
3430</varlistentry>
3431
3432<varlistentry>
3433<term><command>DELETE</command></term>
3434<listitem><para><programlisting>
3435DELETE FROM <replaceable>table_name</replaceable> WHERE name = "<replaceable>text</replaceable>"
3436</programlisting></para></listitem>
3437</varlistentry>
3438
3439<varlistentry>
3440<term><command>UPDATE</command></term>
3441<listitem><para><programlisting>
3442UPDATE <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>"
3443</programlisting></para></listitem>
3444</varlistentry>
3445
3446</variablelist>
3447</example>
3448
3449</sect3>
3450
3451<sect3 id="sql-querying-select">
3452<title>SELECT</title>
3453
3454<para>After running a  <command>SELECT</command> query, you can view the results
3455as a table that will appear in the <guilabel>SQL Data Output</guilabel> tool view at
3456the bottom of &kate;, or as text in the <guilabel>SQL Text Output</guilabel>.
3457If there is an error, you can see it in the text output.</para>
3458
3459<example>
3460<title>Example <command>SELECT</command> Query</title>
3461<para><programlisting>
3462SELECT * FROM <replaceable>table_name</replaceable>
3463</programlisting></para>
3464</example>
3465
3466<para>In the <guilabel>SQL Data Output</guilabel> tool view, there are several buttons:</para>
3467
3468<variablelist>
3469
3470<varlistentry>
3471<term><guibutton>Resize columns to contents</guibutton></term>
3472<listitem><para>Changes the size of columns to fit their contents.</para></listitem>
3473</varlistentry>
3474
3475<varlistentry>
3476<term><guibutton>Resize rows to contents</guibutton></term>
3477<listitem><para>Changes the size of rows to fit their contents.</para></listitem>
3478</varlistentry>
3479
3480<varlistentry>
3481<term><guibutton>Copy</guibutton></term>
3482<listitem><para>Selects all of the table contents and copies it to the clipboard buffer.</para></listitem>
3483</varlistentry>
3484
3485<varlistentry>
3486<term><guibutton>Export</guibutton></term>
3487<listitem><para>Exports all of the table contents to a file, the clipboard, or the
3488current document in the Comma Separated Values format.</para></listitem>
3489</varlistentry>
3490
3491<varlistentry>
3492<term><guibutton>Clear</guibutton></term>
3493<listitem><para>Removes everything from the table view.</para></listitem>
3494</varlistentry>
3495
3496<!--FIXME Use system locale -->
3497
3498</variablelist>
3499
3500<para>You can now change the colors displayed in the table in the <guilabel>SQL</guilabel>
3501section of <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem>
3502</menuchoice>.</para>
3503
3504</sect3>
3505</sect2>
3506
3507<sect2 id="sql-browsing">
3508<title>Browsing</title>
3509
3510<para>You can browse your database using the <guilabel>Database schema</guilabel> browser
3511tool view on the left.  The information displayed varies depending on which
3512database driver you are using.</para>
3513
3514<para>To refresh this list, right-click anywhere in the tool view and select
3515<guimenuitem>Refresh</guimenuitem>.  To generate a query on any entry in the list,
3516right-click on an entry, select <guisubmenu>Generate</guisubmenu>, and select the
3517query type (<guimenuitem>SELECT</guimenuitem>, <guimenuitem>UPDATE</guimenuitem>,
3518<guimenuitem>INSERT</guimenuitem>, or <guimenuitem>DELETE</guimenuitem>) from
3519the submenu that appears.</para>
3520
3521</sect2>
3522
3523<sect2 id="sql-menus">
3524<title>Menu Structure</title>
3525<variablelist>
3526
3527<varlistentry>
3528<term><menuchoice>
3529<guimenu>SQL</guimenu><guimenuitem>Add connection...</guimenuitem>
3530</menuchoice></term>
3531<listitem><para>
3532Adds a new connection using any database driver.
3533</para></listitem>
3534</varlistentry>
3535
3536<varlistentry>
3537<term><menuchoice>
3538<guimenu>SQL</guimenu><guimenuitem>Remove connection</guimenuitem>
3539</menuchoice></term>
3540<listitem><para>
3541Removes the selected connection.
3542</para></listitem>
3543</varlistentry>
3544
3545<varlistentry>
3546<term><menuchoice>
3547<guimenu>SQL</guimenu><guimenuitem>Edit connection...</guimenuitem>
3548</menuchoice></term>
3549<listitem><para>
3550Edits the current connection's settings.
3551</para></listitem>
3552</varlistentry>
3553
3554<varlistentry>
3555<term>Connections</term>
3556<listitem><para>
3557All database connections you have created are listed between the
3558<guimenuitem>Edit connection</guimenuitem> and <guimenuitem>Run query</guimenuitem>
3559menu items.  Select one to run queries or make modifications to it.
3560</para></listitem>
3561</varlistentry>
3562
3563<varlistentry>
3564<term><menuchoice>
3565<shortcut><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></shortcut>
3566<guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem>
3567</menuchoice></term>
3568<listitem><para>
3569Runs your query.
3570</para></listitem>
3571</varlistentry>
3572
3573</variablelist>
3574</sect2>
3575
3576<sect2 id="sql-ack">
3577<title>Thanks and Acknowledgments</title>
3578
3579<para>The SQL Plugin was written by Marco Mentasti.</para>
3580<para>Special thanks to Google Code-In 2011 participant Ömer Faruk ORUÇ for
3581writing much of this section.</para>
3582
3583</sect2>
3584
3585</sect1>
3586
3587<sect1 id="kate-application-plugin-symbolviewer">
3588<!--https://kate-editor.org/2010/10/27/php-treeview-improvements-in-kate/?-->
3589<title>Symbol Viewer Plugin</title>
3590
3591<sect2 id="symbolviewer-using">
3592<title>Using the Close Except/Like Plugin</title>
3593
3594<para>It allows developers to view symbols (functions, macros and structures) from source code.</para>
3595<para>By clicking the parsed information you can easily browse the code.</para>
3596<para>At the moment the following languages are supported:</para>
3597<para>C/C++, &Java;, Perl, PHP, Python, Ruby, XSLT, Tcl/Tk, Fortran</para>
3598
3599<para>Feature list:</para>
3600<simplelist>
3601<member>List/Tree mode</member>
3602<member>Enable/disable sorting</member>
3603<member>Hide/Show Functions Parameters</member>
3604<member>Expand/collapse tree mode</member>
3605<member>Auto-update on document change</member>
3606<member>Code parsing is based on the Syntax-Highlighting framework from &kde-frameworks;</member>
3607</simplelist>
3608
3609</sect2>
3610
3611<sect2 id="symbolviewer-menu">
3612<title>Menu Structure</title>
3613<variablelist>
3614
3615<varlistentry id="tools-symbolviewer">
3616<term><menuchoice>
3617<shortcut>
3618<keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo>
3619</shortcut>
3620<guimenu>View</guimenu>
3621<guisubmenu>Tool Views</guisubmenu>
3622<guimenuitem>Show Symbol List</guimenuitem>
3623</menuchoice></term>
3624<listitem>
3625<para>Toggle the display of &kate;'s Symbol List displaying Functions, Macros and
3626Structures of the source code in the active document.</para>
3627</listitem>
3628</varlistentry>
3629
3630</variablelist>
3631
3632</sect2>
3633
3634<sect2 id="symbolviewer-config">
3635<title>Configuration</title>
3636
3637<screenshot id="screenshot-symbolviewer-settings">
3638<screeninfo>Symbol Viewer</screeninfo>
3639<mediaobject>
3640<imageobject><imagedata fileref="symbolviewer-settings.png" format="PNG"/></imageobject>
3641<caption><para>Choose the default parser options</para></caption>
3642</mediaobject>
3643</screenshot>
3644
3645</sect2>
3646
3647</sect1>
3648
3649
3650<sect1 id="kate-application-plugin-konsole">
3651<title>Terminal Tool View Plugin</title>
3652
3653<para><indexterm><primary>Terminal emulator</primary></indexterm>
3654The built in Terminal Emulator is a copy of the &kde; &konsole;
3655terminal application, for your convenience. It is available from the
3656<menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3657<guimenuitem>Show Terminal Panel</guimenuitem></menuchoice> menu item and will get the focus
3658whenever displayed. Additionally, if the <link
3659linkend="konsole-config">Automatically synchronize
3660the terminal with the current document when possible</link> option is enabled, it will
3661change to the directory of the current document if
3662possible when it is displayed, or when the current document
3663changes.</para>
3664
3665<para>The default location in the &kate; window is at the bottom,
3666below the editing area.</para>
3667
3668<para>You can configure the &konsole; using its &RMB; menu, for more
3669information, see the <ulink url="help:/konsole/index.html">&konsole; manual</ulink>.</para>
3670
3671<para>The built-in terminal emulator is provided by the Terminal Tool View plugin.</para>
3672
3673<sect2 id="konsole-menus">
3674<title>Menu Structure</title>
3675
3676<variablelist>
3677
3678<varlistentry id="view-toolviews-show-terminal">
3679<term><menuchoice>
3680<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3681<guimenuitem>Show Terminal Panel</guimenuitem>
3682</menuchoice></term>
3683<listitem>
3684<para>Toggles the display of the built-in terminal emulator.</para>
3685<para>When activated for the first time, the terminal will be created.</para>
3686<para>When the terminal emulator is displayed, it will get the focus, so that
3687you can start typing in commands immediately. If the <link
3688linkend="konsole-config">Automatically synchronize the terminal
3689with the current document when possible</link> option is enabled in the
3690<guilabel>Terminal</guilabel> page of the <link
3691linkend="config-dialog">Main configuration dialog</link> the shell session will
3692change to the directory of the active document, if it is a local file.</para>
3693</listitem>
3694</varlistentry>
3695
3696<varlistentry id="view-toolviews-pipe-to-terminal">
3697<term><menuchoice><guimenu>Tools</guimenu><guimenuitem>Pipe to
3698Terminal</guimenuitem></menuchoice></term>
3699<listitem><para>Feed the currently selected text into the built-in terminal
3700emulator. No newline is added after the text.</para></listitem>
3701</varlistentry>
3702
3703<varlistentry id="tools-sync-terminal-document">
3704<term><menuchoice>
3705<guimenu>Tools</guimenu>
3706<guimenuitem>Synchronize Terminal with Current Document</guimenuitem></menuchoice></term>
3707<listitem>
3708<para>This will cause the built-in Terminal to <command>cd</command> into the
3709directory of the active document.</para>
3710
3711<para>Alternatively, you can configure &kate; to always keep the terminal in
3712sync with the current document.  See
3713<xref linkend="konsole-config"/> for more information.</para>
3714</listitem>
3715</varlistentry>
3716
3717<varlistentry id="tools-focus-terminal">
3718<term><menuchoice>
3719<guimenu>Tools</guimenu>
3720<guimenuitem>Focus/Defocus Terminal Panel</guimenuitem>
3721</menuchoice></term>
3722<listitem>
3723<para>Switch the focus from the current document to the terminal and vice versa.
3724</para>
3725</listitem>
3726</varlistentry>
3727
3728</variablelist>
3729</sect2>
3730
3731<sect2 id="konsole-config">
3732<title>Configuration</title>
3733
3734<para>You can configure the Terminal Tool View plugin on the
3735<guilabel>Terminal</guilabel> page of the
3736<link linkend="configuring-kate">configuration dialog</link>.</para>
3737
3738<para>The following options are available:</para>
3739
3740<variablelist>
3741<varlistentry>
3742<term>
3743<guilabel>Automatically synchronize the terminal with the current document when possible</guilabel></term>
3744<listitem><para>This will cause the built-in terminal to
3745<command>cd</command> into the directory of the active document when
3746launched and when a new document gets the focus. If not enabled, you
3747have to do all your navigation in the terminal on your own.
3748</para></listitem>
3749</varlistentry>
3750
3751<varlistentry>
3752<term><guilabel>Set EDITOR environment variable to 'kate -b'</guilabel></term>
3753<listitem><para>This sets the <envar>EDITOR</envar> environment variable so programs
3754run in the built-in terminal that automatically open a file in an editor will open
3755them in &kate; instead of the default editor configured in your shell.  You will
3756not be able to continue using the terminal until you have closed the file in &kate;,
3757so the calling program is aware you have finished editing the file.</para></listitem>
3758</varlistentry>
3759
3760<varlistentry>
3761<term><guilabel>Hide &konsole; on pressing 'Esc'</guilabel></term>
3762<listitem><para>This allows closing the built-in terminal by pressing the &Esc; key. May cause issues with terminal applications
3763that use &Esc; key, &eg; <application>vim</application>. Add such applications in the text input box below.
3764The items in the list should be separated with comma.</para></listitem>
3765</varlistentry>
3766
3767</variablelist>
3768</sect2>
3769
3770</sect1>
3771
3772<sect1 id="kate-application-plugin-textfilter">
3773
3774<title>Text Filter Plugin</title>
3775
3776<sect2 id="textfilter-using">
3777<title>Using the Text Filter Plugin</title>
3778
3779<para>You can use this plugin to process selected text using terminal commands.
3780The selection will be used as input for the command, and the output will either
3781replace the selection or be copied to the clipboard, depending on the user's preference.
3782</para>
3783
3784<itemizedlist>
3785<title>Examples:</title>
3786<listitem><para>
3787<command>less /etc/fstab</command> - paste the contents of this file or copy it to the clipboard
3788</para></listitem>
3789<listitem><para>
3790<command>wc</command> - count lines, words and characters of the selection and
3791paste this into the document or copy it to the clipboard
3792</para></listitem>
3793<listitem><para>
3794<command>sort</command> - sort lines of the selection and paste the result into
3795the document or copy it to the clipboard
3796</para></listitem>
3797</itemizedlist>
3798
3799</sect2>
3800
3801<sect2 id="textfilter-menu">
3802<title>Menu Structure</title>
3803
3804<variablelist>
3805
3806<varlistentry id="tools-textfilter">
3807<term><menuchoice>
3808<shortcut>
3809<keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo><!--FIXME shortcut does not work with a german keyboard \ = AltGr+\-->
3810</shortcut>
3811<guimenu>Tools</guimenu>
3812<guisubmenu>Filter Text</guisubmenu>
3813</menuchoice></term>
3814<listitem>
3815
3816<para><action>Opens</action> the Text Filter dialog:</para>
3817
3818<screenshot id="screenshot-filtertext">
3819<screeninfo>Text Filter dialog</screeninfo>
3820<mediaobject>
3821<imageobject><imagedata fileref="textfilter.png" format="PNG"/></imageobject>
3822</mediaobject>
3823</screenshot>
3824
3825<para>Enter the shell command into the combobox or select a previous command from the history.</para>
3826
3827<variablelist>
3828
3829<varlistentry>
3830<term><guilabel>Copy the result instead of pasting it</guilabel></term>
3831<listitem>
3832<para>Copy the result to clipboard leaving a document unchanged.</para>
3833</listitem>
3834</varlistentry>
3835
3836<varlistentry>
3837<term><guilabel>Merge STDOUT and STDERR</guilabel></term>
3838<listitem>
3839<para>
3840If checked, an output from STDOUT and STDERR will be merged and no errors will be reported.
3841Otherwise, STDERR will be displayed as a passive message.</para>
3842</listitem>
3843</varlistentry>
3844
3845</variablelist>
3846
3847</listitem>
3848</varlistentry>
3849
3850</variablelist>
3851
3852</sect2>
3853
3854</sect1>
3855
3856<sect1 id="kate-application-plugin-xmlcheck">
3857<!-- from doc/kate-addons/xmlcheck.docbook -->
3858<sect1info>
3859<authorgroup><author>
3860&Daniel.Naber; &Daniel.Naber.mail;
3861</author></authorgroup>
3862</sect1info>
3863
3864<title>&XML; Validation</title>
3865
3866<para>This plugin checks &XML; files for validity and being well-formed.</para>
3867<para>This plugin checks the current file. A list of warnings and errors
3868will appear at the bottom of &kate;'s main window. You can click on an error message
3869to jump to the corresponding place in the file. If the file has a <quote>DOCTYPE</quote>
3870the DTD given with this doctype will be used to check the file for validity. The
3871DTD is expected at a position relative to the current file, &eg; if the doctype
3872refers to <quote>DTD/xhtml1-transitional.dtd</quote> and the file is <filename>/home/peter/test.xml</filename>
3873the DTD is expected to be located at <filename>/home/peter/DTD/xhtml1-transitional.dtd</filename>.
3874However, remote DTDs specified via http are supported.</para>
3875
3876<para>If the file has no doctype it will be checked for being well-formed.</para>
3877
3878<para>To learn more about &XML; check out the <ulink url="https://www.w3.org/XML/"> official W3C &XML; pages</ulink>.</para>
3879
3880<para>Internally this plugin calls the external command <command>xmllint</command>, which
3881is part of libxml2. If this command is not correctly installed on your system, the plugin
3882will not work.</para>
3883
3884<para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
3885<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
3886Then select <guilabel>&XML; Validation</guilabel> which will appear
3887in the <guilabel>Application</guilabel> / <guilabel>Plugins</guilabel> section and close the dialog.
3888</para>
3889
3890<sect2 id="xmlcheck-menu">
3891<title>Menu Structure</title>
3892
3893<variablelist>
3894<varlistentry>
3895<term>
3896<menuchoice>
3897<guimenu>&XML;</guimenu>
3898<guimenuitem>Validate &XML;</guimenuitem>
3899</menuchoice>
3900</term>
3901<listitem><para>This will start the check, as described above.</para></listitem>
3902</varlistentry>
3903</variablelist>
3904
3905</sect2>
3906
3907<sect2 id="xmlcheck-thanks-and-acknowledgements">
3908<title>Thanks and Acknowledgments</title>
3909<para>
3910&kate; Plugin <quote>&XML; Validation</quote> copyright 2002 &Daniel.Naber;
3911&Daniel.Naber.mail;.
3912</para>
3913<para>Documentation copyright 2002 &Daniel.Naber;</para>
3914
3915</sect2>
3916</sect1>
3917
3918<sect1 id="kate-application-plugin-xmltools">
3919<!-- from doc/kate-addons/xmlcheck.docbook -->
3920<sect1info>
3921<authorgroup><author>
3922&Daniel.Naber; &Daniel.Naber.mail;
3923</author></authorgroup>
3924</sect1info>
3925<title>&XML; Completion</title>
3926
3927<para>This plugin gives hints about what is allowed at a certain position in
3928an &XML; file, according to the file's DTD. It will list possible
3929elements, attributes, attribute values or entities, depending on the
3930cursor position (&eg; all entities are listed if the character on the left
3931of the cursor is <quote>&amp;</quote>). It's also possible to close the nearest
3932open tag on the left.</para>
3933
3934<para>The <acronym>DTD</acronym> must exist in &XML; format, as produced by the Perl program
3935<command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>.
3936Some meta DTDs are supplied. They are installed in
3937<filename class="directory">katexmltools/</filename> in
3938<userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>,
3939which is also the default folder when you choose
3940<guimenuitem>Assign Meta DTD...</guimenuitem>.
3941To produce your own meta DTDs, get <command>dtdparse</command> from
3942<ulink url="http://dtdparse.sourceforge.net">http://dtdparse.sourceforge.net</ulink>.</para>
3943
3944<sect2 id="xmltools-how-to-use">
3945<title>How to Use</title>
3946
3947<para>Start &kate; and open the configuration dialog under <menuchoice><guimenu>Settings</guimenu>
3948<guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
3949Then select <guilabel>&XML; Completion</guilabel> which will appear
3950in the <menuchoice><guimenu>Application</guimenu>
3951<guimenuitem>Plugins</guimenuitem></menuchoice> page and close the dialog. After
3952that, select <menuchoice><guimenu>&XML;</guimenu><guimenuitem>Assign Meta DTD...</guimenuitem></menuchoice>.
3953If your document contains no <quote>DOCTYPE</quote> or the doctype is unknown, you will have to
3954select a meta DTD from the file system. Otherwise the meta DTD that
3955matches the current document's DOCTYPE will be loaded automatically.</para>
3956
3957<para>You can now use the plugin while typing your text:</para>
3958
3959<variablelist>
3960
3961<varlistentry>
3962<term><keycap>&lt;</keycap> (less than key)</term>
3963<listitem><para>This will trigger a list of possible elements unless the
3964cursor is inside a tag already. Note that you currently cannot use
3965this to insert the top level element (&eg; <quote>&lt;html&gt;</quote>).</para></listitem>
3966</varlistentry>
3967
3968<varlistentry>
3969<term><keycap>&lt;</keycap><keycap>/</keycap>(less than key + slash)</term>
3970<listitem><para>Entering these characters will offer to close the current element
3971(nearest open one to the left of the cursor). Press &Enter; to accept the suggestion.
3972Unlike the <guimenuitem>Close Element</guimenuitem> menu item, this works only with
3973a DTD assigned.</para></listitem>
3974</varlistentry>
3975
3976<varlistentry>
3977<term><keycap>"</keycap> (quote key)</term>
3978<listitem><para>The quote key will trigger a list of possible attribute
3979values (if there are any) if you are inside a tag.</para></listitem>
3980</varlistentry>
3981
3982<varlistentry>
3983<term><keycap>&nbsp;</keycap> (space key)</term>
3984<listitem><para>This key will trigger a list of possible attributes for the
3985current element if you are inside a tag.</para>
3986</listitem>
3987</varlistentry>
3988
3989<varlistentry>
3990<term><keycap>&amp;</keycap> (ampersand key)</term>
3991<listitem><para>This key will trigger a list of named entities.</para></listitem>
3992</varlistentry>
3993</variablelist>
3994
3995</sect2>
3996
3997<sect2 id="xmltools-features-and-limitations">
3998<title>Features and Limitations</title>
3999
4000<para>You can test all functions and limitations by loading
4001<filename>katexmltools/testcases.xml</filename> in
4002<userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>
4003into &kate; and following the instructions.</para>
4004
4005</sect2>
4006
4007
4008<sect2 id="xmltools-menu">
4009<title>Menu Structure</title>
4010
4011<variablelist id="xml-insert-element">
4012<varlistentry>
4013<term><menuchoice>
4014<shortcut>
4015<keycombo action="simul">&Ctrl;&Enter;</keycombo>
4016</shortcut>
4017<guimenu>&XML;</guimenu>
4018<guimenuitem>Insert Element...</guimenuitem>
4019</menuchoice></term>
4020<listitem><para>This will open a dialog that lets you insert an &XML; element.
4021The &lt;, &gt; characters and the closing tag will be inserted automatically.
4022If you have selected text when this menu item is selected, the selected
4023text will be surrounded by the opening and the closing tag.
4024The dialog also offers completion of all elements that may be inserted
4025at the current cursor position if you have assigned a meta DTD by
4026using <guimenuitem>Assign Meta DTD...</guimenuitem>.
4027</para></listitem>
4028</varlistentry>
4029
4030<varlistentry id="xml-close-element">
4031<term><menuchoice>
4032<shortcut>
4033<keycombo action="simul">&Ctrl;<keycap>&lt;</keycap></keycombo>
4034</shortcut>
4035<guimenu>&XML;</guimenu>
4036<guimenuitem>Close Element</guimenuitem>
4037</menuchoice></term>
4038<listitem><para>This will search your text for a tag that is not yet closed
4039and will close it by inserting the corresponding closing tag.
4040The search starts at the cursor position and goes left. If
4041it cannot find an open tag nothing will happen.</para></listitem>
4042</varlistentry>
4043
4044<varlistentry id="xml-assign-metadtd">
4045<term><menuchoice>
4046<guimenu>&XML;</guimenu>
4047<guimenuitem>Assign Meta DTD...</guimenuitem>
4048</menuchoice></term>
4049<listitem><para>This will tell the plugin which meta DTD to use for the
4050current document. Note that this assignment will not be saved.
4051You will have to repeat it when you start &kate; the next time.</para></listitem>
4052</varlistentry>
4053</variablelist>
4054
4055</sect2>
4056
4057<sect2 id="xmltools-thanks-and-acknowledgements">
4058<title>Thanks and Acknowledgments</title>
4059<para>
4060&kate; Plugin <quote>&XML; Completion</quote> copyright 2001,2002 &Daniel.Naber;
4061&Daniel.Naber.mail;.
4062</para>
4063<para>&kde; SC 4 version copyright 2010 Tomáš Trnka</para>
4064<para>Documentation copyright 2001,2002 &Daniel.Naber;</para>
4065</sect2>
4066</sect1>
4067
4068
4069</chapter>
4070