Warning, /utilities/kate/doc/kate/plugins.docbook is written in an unsupported language. File is not indexed.

0001 <chapter id="plugins">
0002 
0003 <chapterinfo>
0004 <authorgroup>
0005 <author>&Anders.Lund; &Anders.Lund.mail;</author>
0006 <!-- TRANS:ROLES_OF_TRANSLATORS -->
0007 </authorgroup>
0008 </chapterinfo>
0009 
0010 <title>Working with Plugins</title>
0011 
0012 <para>You can enable the individual plugins in the <link
0013 linkend="configuring-kate-configdialog">configuration dialog</link>, which also
0014 provides access to additional configuration options for plugins that require
0015 it.</para>
0016 
0017 <sect1 id="kate-application-plugins">
0018 <title>&kate; Application Plugins</title>
0019 
0020 <!-- from doc/kate-addons/index.docbook -->
0021 <para>
0022 &kate; plugins are additional functions for the &kate; editor.  They can
0023 add extra menus and shortcuts, and extend &kate;'s features.  You can
0024 install as many or as few as you like, from within &kate;.
0025 Open &kate;'s configuration dialog with
0026 <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem></menuchoice>
0027 Select <menuchoice><guimenu>Application</guimenu><guimenuitem>Plugins</guimenuitem></menuchoice> to
0028 choose the wanted plugins.
0029 </para>
0030 
0031 <para>
0032 The available application plugins are:
0033 </para>
0034 <itemizedlist>
0035 <listitem>
0036 <para><link linkend="kate-application-plugin-external-tools">External Tools</link>
0037 - Run external tools and applications</para>
0038 </listitem>
0039 <listitem>
0040 <para><link linkend="kate-application-plugin-backtracebrowser">Backtrace Browser</link>
0041 - C/C++ Backtrace navigation tool view</para>
0042 </listitem>
0043 <listitem>
0044 <para><link linkend="kate-application-plugin-build">Build Plugin</link> - Compile or Make and parse error messages</para>
0045 </listitem>
0046 <listitem>
0047 <para><link linkend="kate-application-plugin-closeexceptlike">Close Except/Like</link>
0048 - Close group of documents based on a common path or file extension</para>
0049 </listitem>
0050 <listitem>
0051 <para><link linkend="kate-application-plugin-colorpicker">Color Picker</link>
0052 - Show preview for known color names</para>
0053 </listitem>
0054 <listitem>
0055 <para><link linkend="kate-application-plugin-colored-brackets">Colored Brackets</link>
0056 - Colored brackets for readability</para>
0057 </listitem>
0058 <listitem>
0059 <para><link linkend="kate-application-plugin-ctags">CTags</link> -
0060 Look up definitions/declarations with CTags</para>
0061 </listitem>
0062 <listitem>
0063 <para><link linkend="kate-application-plugin-preview">Document preview</link> -
0064 Preview the document in the target format.</para>
0065 </listitem>
0066 <listitem>
0067 <para><link linkend="kate-application-plugin-documentswitcher">Document switcher</link> -
0068 Quick document switching with <keycombo action="simul">&Alt;&Tab;</keycombo> behavior</para>
0069 </listitem>
0070 <listitem>
0071 <para><link linkend="kate-application-plugin-fsbrowser">File System Browser</link> -
0072   File system browser tool view</para>
0073 </listitem>
0074 <listitem>
0075 <para><link linkend="kate-application-plugin-documents">Document Tree View</link> - Displays the open files in a file tree</para>
0076 </listitem>
0077 <listitem>
0078 <para><link linkend="kate-application-plugin-gdb">&gdb;</link> - Provides a
0079 simple &gdb; frontend</para>
0080 </listitem>
0081 <listitem>
0082 <para><link linkend="kate-application-plugin-projects">Project Plugin</link> - Integration with &git; and other source control systems</para>
0083 </listitem>
0084 <listitem>
0085 <para>Replicode - Constructivist AI language and runtime</para>
0086 </listitem>
0087 <listitem>
0088 <para><link linkend="kate-application-plugin-lspclient">LSP Client</link>
0089 - LSP client providing code navigation and code completion for many languages</para>
0090 </listitem>
0091 <listitem>
0092 <para><link linkend="kate-application-plugin-searchinfiles">Search &amp; Replace</link> -
0093 Search and replace in documents, folders, or projects</para>
0094 </listitem>
0095 <listitem>
0096 <para><link linkend="kate-application-plugin-snippets">Snippets tool view</link> - Tool view embedding the snippets management</para>
0097 </listitem>
0098 <listitem>
0099 <para><link linkend="kate-application-plugin-keyboardmacros">Keyboard Macros</link>
0100 - Record and play keyboard macros (i.e., keyboard action sequences)</para>
0101 </listitem>
0102 <listitem>
0103 <para><link linkend="kate-application-plugin-sql">SQL Plugin</link> - Execute
0104 query on SQL databases</para>
0105 </listitem>
0106 <listitem>
0107 <para><link linkend="kate-application-plugin-symbolviewer">Symbol Viewer</link>
0108 - Extract and show reference symbols from source</para>
0109 </listitem>
0110 <listitem>
0111 <para><link linkend="kate-application-plugin-konsole">Terminal tool view</link> - Have a terminal at the ready, using &kde;'s &konsole; widget</para>
0112 </listitem>
0113 <listitem>
0114 <para><link linkend="kate-application-plugin-textfilter">Text Filter</link> - Process text using terminal commands</para>
0115 </listitem>
0116 <listitem>
0117 <para><link linkend="kate-application-plugin-xmltools">&XML; Completion</link> - Lists &XML; elements,
0118 attributes, attribute values and entities allowed by DTD</para>
0119 </listitem>
0120 <listitem>
0121 <para><link linkend="kate-application-plugin-xmlcheck">&XML; Validation</link>- Validates &XML; files using xmllint</para>
0122 </listitem>
0123 </itemizedlist>
0124 </sect1>
0125 
0126 <sect1 id="kate-application-plugin-external-tools">
0127 <title>External Tools</title>
0128 
0129 <para>The <guilabel>External Tools</guilabel> plugin allows to invoke
0130 external applications with data related to the current document, for example
0131 its URL, directory, text or selection. Once enabled, a config page appears
0132 as depicted below that allows to change or remove existing tools. Similarly,
0133 new tools can be added to your liking. The tools will then appear in the
0134 <guisubmenu>External Tools</guisubmenu> submenu of the <guimenu>Tools</guimenu>
0135 menu of the application.
0136 </para>
0137 
0138 <mediaobject>
0139 <imageobject>
0140 <imagedata format="PNG" fileref="kateexternaltools.png"/>
0141 </imageobject>
0142 </mediaobject>
0143 
0144 <para>
0145 The config page allows to add new external tools by clicking on the
0146 <guilabel>Add</guilabel> button. In this case, a popup menu appears where one
0147 can either add a new external tool, add an existing tool from a predefined list,
0148 or add a new category to organize the external tools into categories. Similarly,
0149 the existing tools can be modified either by double-click or by invoking
0150 <guilabel>Edit...</guilabel>, and <guilabel>Remove</guilabel> removes the
0151 selected tools.
0152 </para>
0153 
0154 <sect2 id="kate-application-plugin-external-tools-edit">
0155 <title>Configuring External Tools</title>
0156 
0157 <para>Editing a tool opens a config dialog that allows fine-grained
0158 configuration of the tool:</para>
0159 
0160 <mediaobject>
0161 <imageobject>
0162 <imagedata format="PNG" fileref="kateeditexternaltool.png"/>
0163 </imageobject>
0164 </mediaobject>
0165 
0166 <variablelist>
0167 <varlistentry>
0168 <term>As can be seen, many details can be defined, namely:</term>
0169 <listitem>
0170 <para><userinput>Name</userinput>, the name of the tool, which will later appear in the menu.</para>
0171 <para><userinput>Icon</userinput>, optional icon that is visible in the menu.</para>
0172 <para><userinput>Executable</userinput>, executable including either a full path, or your executable must be in the <envar>PATH</envar> environment variable.</para>
0173 <para><userinput>Arguments</userinput>, optional arguments that are passed to the executable.</para>
0174 <para><userinput>Input</userinput>, optional input that is passed to the process via stdin.</para>
0175 <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>
0176 <para><userinput>Mime types</userinput>, if set, the tool is active only if the current document’s mime type matches.</para>
0177 <para><userinput>Save</userinput>, when invoked, saves none, the current document, or all documents.</para>
0178 <para><userinput>Trigger</userinput>, a trigger to execute this tool. A trigger will only affect the currently active document and will only execute if the mimetype of current active document matches the mimetype of the external tool.</para>
0179     <variablelist><varlistentry>
0180     <term>Following triggers are available:</term>
0181     <listitem>
0182     <para><userinput>None</userinput>, this is the default, it means the tool has no trigger.</para>
0183     <para><userinput>Before Save</userinput>, this trigger will execute right before saving the document.</para>
0184     <para><userinput>After Save</userinput>, this trigger will execute the tool after the document was saved.</para>
0185     </listitem>
0186     </varlistentry></variablelist>
0187 <para><userinput>Reload current document after execution</userinput>, useful when the current file is modified on disk.</para>
0188 <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>
0189 <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>
0190 </listitem>
0191 </varlistentry>
0192 </variablelist>
0193 
0194 <para>The button <guilabel>Defaults</guilabel> is visible only for tools that
0195 are shipped with Kate. When clicked, all tool’s settings reverted to default
0196 (aka factory) values.
0197 </para>
0198 
0199 </sect2>
0200 
0201 <sect2 id="kate-application-plugin-external-tools-variables">
0202 <title>Variable Expansion</title>
0203 
0204 <para>
0205 Some editing fields such as the <guilabel>Executable</guilabel>, the
0206 <guilabel>Arguments</guilabel>, the <guilabel>Input</guilabel> and the
0207 <guilabel>Working Directory</guilabel> support variables that are expanded
0208 on tool invocation. This is indicated by the icon <guilabel>{}</guilabel>
0209 that appears once one of these text input fields has focus (see red circle):
0210 </para>
0211 
0212 <mediaobject>
0213 <imageobject>
0214 <imagedata format="PNG" fileref="katevariableexpansion.png"/>
0215 </imageobject>
0216 </mediaobject>
0217 
0218 <para>
0219 Hovering over one of these text input fields also shows a tooltip with the
0220 current expanded text. Further, clicking on the <guilabel>{}</guilabel>
0221 action will open a dialog that lists all available variables:
0222 </para>
0223 
0224 <mediaobject>
0225 <imageobject>
0226 <imagedata format="PNG" fileref="kateexternaltoolvariablechooser.png"/>
0227 </imageobject>
0228 </mediaobject>
0229 
0230 <para>
0231 This feature provides a lot of flexibility when defining an external tool since
0232 all variables of the form <userinput>%{...}</userinput> are expanded when the tool
0233 gets invoked. There are two kind of variables supported:
0234 
0235 <itemizedlist>
0236 <listitem><para><userinput>%{variable-name}</userinput></para></listitem>
0237 <listitem><para><userinput>%{variable-name:&lt;value&gt;}</userinput></para></listitem>
0238 </itemizedlist>
0239 The first form <userinput>%{variable-name}</userinput> simply replaces the
0240 variable with its contents. For instance, the variable <userinput>%{Document:FileName}</userinput>
0241 is replaced by the current document’s filename without its path.
0242 The second form <userinput>%{variable-name:&lt;value&gt;}</userinput> gets the
0243 <userinput>&lt;value&gt;</userinput> as contents. For example, this can be used
0244 to expand an environment variable with <userinput>%{ENV:HOME}</userinput>,
0245 or one can obtain the current date in the preferred format like
0246 <userinput>%{Date:yyyy-MM-dd}</userinput>.
0247 </para>
0248 
0249 <variablelist>
0250 <varlistentry>
0251 <term>Supported variables include:</term>
0252 <listitem>
0253 <para><userinput>Document:FileBaseName</userinput>: File base name without path and suffix of the current document.</para>
0254 <para><userinput>Document:FileExtension</userinput>: File extension of the current document.</para>
0255 <para><userinput>Document:FileName</userinput>: File name without path of the current document.</para>
0256 <para><userinput>Document:FilePath</userinput>: Full path of the current document including the file name</para>
0257 <para><userinput>Document:Text</userinput>: Contents of the current document.</para>
0258 <para><userinput>Document:Path</userinput>: Full path of the current document excluding the file name.</para>
0259 <para><userinput>Document:NativeFilePath</userinput>: Full document path including file name, with native path separator (backslash on Windows).</para>
0260 <para><userinput>Document:NativePath</userinput>: Full document path excluding file name, with native path separator (backslash on Windows).</para>
0261 <para><userinput>Document:Cursor:Line</userinput>: Line number of the text cursor position in current document (starts with 0).</para>
0262 <para><userinput>Document:Cursor:Column</userinput>: Column number of the text cursor position in current document (starts with 0).</para>
0263 <para><userinput>Document:Cursor:XPos</userinput>: X component in global screen coordinates of the cursor position.</para>
0264 <para><userinput>Document:Cursor:YPos</userinput>: Y component in global screen coordinates of the cursor position.</para>
0265 <para><userinput>Document:Selection:Text</userinput>: Text selection of the current document.</para>
0266 <para><userinput>Document:Selection:StartLine</userinput>: Start line of selected text of the current document.</para>
0267 <para><userinput>Document:Selection:StartColumn</userinput>: Start column of selected text of the current document.</para>
0268 <para><userinput>Document:Selection:EndLine</userinput>: End line of selected text of the current document.</para>
0269 <para><userinput>Document:Selection:EndColumn</userinput>: End column of selected text of the current document.</para>
0270 <para><userinput>Document:RowCount</userinput>: Number of rows of the current document.</para>
0271 <para><userinput>Document:Variable:&lt;variable&gt;</userinput>: Expand arbitrary <ulink url="help:/katepart/config-variables.html">document variables</ulink>.</para>
0272 <para><userinput>Date:Locale</userinput>: The current date in current locale format.</para>
0273 <para><userinput>Date:ISO</userinput>: The current date (ISO).</para>
0274 <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>
0275 <para><userinput>Time:Locale</userinput>: The current time in current locale format.</para>
0276 <para><userinput>Time:ISO</userinput>: The current time (ISO).</para>
0277 <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>
0278 <para><userinput>ENV:&lt;value&gt;</userinput>: Access to environment variables.</para>
0279 <para><userinput>JS:&lt;expression&gt;</userinput>: Evaluate simple JavaScript statements.</para>
0280 <para><userinput>PercentEncoded:&lt;text&gt;</userinput>: Percent encoded text.</para>
0281 <para><userinput>UUID</userinput>: Generate a new UUID.</para>
0282 </listitem>
0283 </varlistentry>
0284 </variablelist>
0285 
0286 <para>
0287 </para>
0288 
0289 </sect2>
0290 
0291 <sect2 id="kate-application-plugin-external-tools-defaults">
0292 <title>List of Default Tools</title>
0293 
0294 <para>
0295 Several tools are shipped by default. However, if you have more useful tools
0296 please contribute those to <email>kwrite-devel@kde.org</email> so that we can add them to this list.
0297 All default tools are visible in the list view by default. However, all tools can be
0298 changed to your liking, including the category or even deleting tools.
0299 Deleted tools can be added back again by clicking on the <guibutton>Add</guibutton>
0300 button in the config page as described above.
0301 </para>
0302 
0303 <variablelist>
0304 <title>git-cola</title>
0305 
0306 <varlistentry>
0307 <term>git-cola is a graphical git client that enables you to easily stage and commit changes.
0308 If installed, it is available also through the command line by typing <userinput>git-cola</userinput></term>
0309 <listitem>
0310 <para><userinput>Name</userinput>: git-cola</para>
0311 <para><userinput>Icon</userinput>: git-cola</para>
0312 <para><userinput>Executable</userinput>: git-cola</para>
0313 <para><userinput>Arguments</userinput>: -r %{Document:Path}</para>
0314 <para><userinput>Editor command</userinput>: git-cola</para>
0315 </listitem>
0316 </varlistentry>
0317 
0318 </variablelist>
0319 
0320 
0321 <variablelist>
0322 <title>gitk</title>
0323 
0324 <varlistentry>
0325 <term>gitk is a git client as well that allows to nicely visualize the git history.</term>
0326 <listitem>
0327 <para><userinput>Name</userinput>: gitk</para>
0328 <para><userinput>Icon</userinput>: git-gui</para>
0329 <para><userinput>Executable</userinput>: gitk</para>
0330 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0331 <para><userinput>Editor command</userinput>: gitk</para>
0332 </listitem>
0333 </varlistentry>
0334 
0335 </variablelist>
0336 
0337 
0338 <variablelist>
0339 <title>git blame</title>
0340 
0341 <varlistentry>
0342 <term>Starts git blame to easily follow git changes in the current file.</term>
0343 <listitem>
0344 <para><userinput>Name</userinput>: git blame</para>
0345 <para><userinput>Executable</userinput>: git</para>
0346 <para><userinput>Arguments</userinput>: gui blame %{Document:FileName}</para>
0347 <para><userinput>Save</userinput>: Current Document</para>
0348 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0349 <para><userinput>Editor command</userinput>: git-blame</para>
0350 </listitem>
0351 </varlistentry>
0352 
0353 </variablelist>
0354 
0355 
0356 <variablelist>
0357 <title>Run Shell Script</title>
0358 
0359 <varlistentry>
0360 <term>Starts an external konsole in which the current document is executed.
0361 The script needs to state the interpreter in the first line via a shebang <userinput>#!/path/interpreter</userinput>.</term>
0362 <listitem>
0363 <para><userinput>Name</userinput>: Run Shell Script</para>
0364 <para><userinput>Icon</userinput>: system-run</para>
0365 <para><userinput>Executable</userinput>: konsole</para>
0366 <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>
0367 <para><userinput>Save</userinput>: Current Document</para>
0368 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0369 <para><userinput>Editor command</userinput>: run-script</para>
0370 </listitem>
0371 </varlistentry>
0372 
0373 </variablelist>
0374 
0375 
0376 <variablelist>
0377 <title>Google Selected Text</title>
0378 
0379 <varlistentry>
0380 <term>Search in google for the selected text.</term>
0381 <listitem>
0382 <para><userinput>Name</userinput>: Google Selected Text</para>
0383 <para><userinput>Icon</userinput>: globe</para>
0384 <para><userinput>Executable</userinput>: xdg-open</para>
0385 <para><userinput>Arguments</userinput>: &quot;https://www.google.com/search?q=%{Document:Selection:Text}&quot;</para>
0386 <para><userinput>Editor command</userinput>: google</para>
0387 </listitem>
0388 </varlistentry>
0389 
0390 </variablelist>
0391 
0392 
0393 <variablelist>
0394 <title>Insert UUID</title>
0395 
0396 <varlistentry>
0397 <term>Inserts a new UUID each time this action is invoked.</term>
0398 <listitem>
0399 <para><userinput>Name</userinput>: Insert UUID</para>
0400 <para><userinput>Executable</userinput>: echo</para>
0401 <para><userinput>Arguments</userinput>: %{UUID}</para>
0402 <para><userinput>Output</userinput>: Insert at Cursor Position</para>
0403 <para><userinput>Editor command</userinput>: uuid</para>
0404 </listitem>
0405 </varlistentry>
0406 
0407 </variablelist>
0408 
0409 
0410 <variablelist>
0411 <title>Clang Format Full File</title>
0412 
0413 <varlistentry>
0414 <term>Runs clang-format on the current file on disk. The document is reloaded afterwards.</term>
0415 <listitem>
0416 <para><userinput>Name</userinput>: Clang Format Full File</para>
0417 <para><userinput>Executable</userinput>: clang-format</para>
0418 <para><userinput>Arguments</userinput>: -i %{Document:FileName}</para>
0419 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0420 <para><userinput>Save</userinput>: Current Document</para>
0421 <para><userinput>Reload</userinput>: Yes</para>
0422 <para><userinput>Editor command</userinput>: clang-format-file</para>
0423 </listitem>
0424 </varlistentry>
0425 
0426 </variablelist>
0427 
0428 
0429 <variablelist>
0430 <title>Clang Format Selected Text</title>
0431 
0432 <varlistentry>
0433 <term>Runs clang-format just on the selected text in the current document.</term>
0434 <listitem>
0435 <para><userinput>Name</userinput>: Clang Format Selected Text</para>
0436 <para><userinput>Executable</userinput>: clang-format</para>
0437 <para><userinput>Arguments</userinput>: -assume-fileName: %{Document:FileName}</para>
0438 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0439 <para><userinput>Input</userinput>: %{Document:Selection:Text}</para>
0440 <para><userinput>Output</userinput>: Replace Selected Text</para>
0441 <para><userinput>Editor command</userinput>: clang-format-selection</para>
0442 </listitem>
0443 </varlistentry>
0444 
0445 </variablelist>
0446 
0447 
0448 <variablelist>
0449 <title>Qt Quick 2 Preview (qmlscene)</title>
0450 
0451 <varlistentry>
0452 <term>Previews the current qml file in qmlscene.</term>
0453 <listitem>
0454 <para><userinput>Name</userinput>: Qt Quick 2 Preview (qmlscene)</para>
0455 <para><userinput>Executable</userinput>: qmlscene</para>
0456 <para><userinput>Arguments</userinput>: %{Document:FileName}</para>
0457 <para><userinput>Save</userinput>: Current Document</para>
0458 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0459 <para><userinput>Editor command</userinput>: qml-preview</para>
0460 </listitem>
0461 </varlistentry>
0462 
0463 </variablelist>
0464 
0465 
0466 <variablelist>
0467 <title>JSON Format Full File</title>
0468 
0469 <varlistentry>
0470 <term>Format the entire JSON file.</term>
0471 <listitem>
0472 <para><userinput>Name</userinput>: JSON Format Full File</para>
0473 <para><userinput>Icon</userinput>: application-json</para>
0474 <para><userinput>Executable</userinput>: jq</para>
0475 <para><userinput>Arguments</userinput>: %{Document:FileName}</para>
0476 <para><userinput>Save</userinput>: Current Document</para>
0477 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0478 <para><userinput>Output</userinput>: Replace Current Document</para>
0479 <para><userinput>Editor command</userinput>: json-format-file</para>
0480 </listitem>
0481 </varlistentry>
0482 
0483 </variablelist>
0484 
0485 
0486 <variablelist>
0487 <title>XML Format Full File</title>
0488 
0489 <varlistentry>
0490 <term>Format the entire XML file.</term>
0491 <listitem>
0492 <para><userinput>Name</userinput>: JSON Format Full File</para>
0493 <para><userinput>Icon</userinput>: application-xml</para>
0494 <para><userinput>Executable</userinput>: xmllint</para>
0495 <para><userinput>Arguments</userinput>: --format %{Document:FileName}</para>
0496 <para><userinput>Save</userinput>: Current Document</para>
0497 <para><userinput>Working directory</userinput>: %{Document:Path}</para>
0498 <para><userinput>Output</userinput>: Replace Current Document</para>
0499 <para><userinput>Editor command</userinput>: xml-format-file</para>
0500 </listitem>
0501 </varlistentry>
0502 
0503 </variablelist>
0504 
0505 </sect2>
0506 </sect1>
0507 
0508 <sect1 id="kate-application-plugin-backtracebrowser">
0509 <!--https://kate-editor.org/2008/08/12/kate-fast-backtrace-navigation/-->
0510 <title>Backtrace Browser Plugin</title>
0511 
0512 <sect2 id="backtracebrowser-using">
0513 <title>Using the Backtrace Browser Plugin</title>
0514 
0515 <para>This plugin is meant for developers and probably of little use for users.
0516 It shows a backtrace delivered by gdb in a listview in a &kate; toolview.
0517 Clicking on an item opens the selected file and jumps to the correct line number.
0518 It works for backtraces generated on your own machine, but it will also work for
0519 backtraces from other people, &ie; with <filename>/home/dummy/qt-copy/…/qwidget.cpp</filename>
0520 will still be found on other machines. For that to work, you have to index the
0521 directories where the source code is located.
0522 </para>
0523 
0524 <para>Sometimes there are several files with the same name, &eg;</para>
0525 
0526 <simplelist>
0527 <member><filename>kdegraphics/okular/generators/dvi/config.h</filename></member>
0528 <member><filename>kdepim-runtime/resources/gmail/saslplugin/config.h</filename></member>
0529 </simplelist>
0530 
0531 <para>To pick the right choice, the plugin picks the last two parts of the &URL;,
0532 in this case this would be</para>
0533 
0534 <simplelist>
0535 <member><filename>dvi/config.h</filename></member>
0536 <member><filename>saslplugin/config.h</filename></member>
0537 </simplelist>
0538 
0539 <para>And then usually the plugin finds the correct one.</para>
0540 
0541 <para>Indexing master and a branches of course will lead to a clash.</para>
0542 
0543 </sect2>
0544 
0545 <sect2 id="backtracebrowser-config">
0546 <title>Configuration</title>
0547 
0548 <para>On the configuration page add the directories containing the source code.</para>
0549 
0550 <screenshot id="screenshot-backtrace-settings">
0551 <screeninfo>Backtrace Browser</screeninfo>
0552 <mediaobject>
0553 <imageobject><imagedata fileref="backtrace-settings.png" format="PNG"/></imageobject>
0554 <caption>Configure Paths in Backtrace browser tool view</caption>
0555 </mediaobject>
0556 </screenshot>
0557 
0558 <para>Clicking <guibutton>OK</guibutton> will start indexing.
0559 When indexing is finished, open the toolview <guilabel>Backtrace Browser</guilabel>.</para>
0560 <para>Now you can load a backtrace from the clipboard (&eg;, when you clicked
0561 <guibutton>Copy to Clipboard</guibutton> in &drkonqi;) or from a file.</para>
0562 
0563 </sect2>
0564 
0565 </sect1>
0566 
0567 <sect1 id="kate-application-plugin-build">
0568 <!--https://kate-editor.org/2011/06/21/kate-plugin-updates-part-1/ -->
0569 <sect1info>
0570 <authorgroup>
0571 <author><firstname>Salma</firstname> <surname>Sultana</surname></author>
0572 <author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
0573 </authorgroup>
0574 </sect1info>
0575 <title>Build Plugin</title>
0576 
0577 <sect2 id="build-intro">
0578 <title>Introduction</title>
0579 
0580 <para>The Build plugin allows you to run actions like build, clean and compile
0581 on a project.</para>
0582 
0583 </sect2>
0584 
0585 <sect2 id="build-using">
0586 <title>Using the Build Plugin</title>
0587 
0588 <para>The Build plugin adds a <guilabel>Build Output</guilabel> tool view at the
0589 bottom and a <guimenu>Build</guimenu> menu on the menubar. The tool view can be used to configure
0590 build target settings, while the menu can be used to perform build, clean and
0591 compile actions.</para>
0592 
0593 <screenshot id="screenshot-build-output">
0594 <screeninfo>Build Output</screeninfo>
0595 <mediaobject>
0596 <imageobject><imagedata fileref="build-output.png" format="PNG"/></imageobject>
0597 </mediaobject>
0598 </screenshot>
0599 
0600 <para>The <guilabel>Build Output</guilabel> tool view has two tabs:</para>
0601 
0602 <itemizedlist>
0603 <listitem><para><guilabel>Target Settings</guilabel></para></listitem>
0604 <listitem><para><guilabel>Output</guilabel></para></listitem>
0605 </itemizedlist>
0606 
0607 <sect3 id="build-using-target-settings">
0608 <title>Target Settings tab</title>
0609 
0610 <para>The target settings tab can be used to configure various build targets and define targets sets.</para>
0611 
0612 <para>To change the names or commands double click on the entries in the table and use the
0613 dropdown box to select the active target set. Use the checkbox in front of each target to define a default.</para>
0614 
0615 <para>A new target set contains several configuration options:</para>
0616 
0617 <variablelist>
0618 <varlistentry>
0619 <term><guilabel>Working Directory</guilabel></term>
0620 <listitem><para>You can set the path to the project here. Leave this empty to
0621 use the directory the current document is located in.</para></listitem>
0622 </varlistentry>
0623 
0624 <varlistentry>
0625 <term><guilabel>Build</guilabel></term>
0626 <listitem><para>This option lets you define the build command. It is set to
0627 <command>make</command> by default.</para></listitem>
0628 </varlistentry>
0629 
0630 <varlistentry>
0631 <term><guilabel>Clean</guilabel></term>
0632 <listitem><para>The option lets you define the clean command. It is set to
0633 <command>make clean</command> by default.</para></listitem>
0634 </varlistentry>
0635 
0636 <varlistentry>
0637 <term><guilabel>Config</guilabel></term>
0638 <listitem><para>This option lets you define the config command. It is set
0639 to <command>cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local ../</command>
0640 by default.</para></listitem>
0641 </varlistentry>
0642 </variablelist>
0643 
0644 <para>On the top this plugin has a toolbar with the following buttons :</para>
0645 
0646 <simplelist>
0647 <member>
0648 <guiicon><inlinemediaobject><imageobject><imagedata fileref="dialog-ok-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
0649 Build the selected target</member>
0650 <member>
0651 <guiicon><inlinemediaobject><imageobject><imagedata fileref="list-add-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
0652 Add a new build target</member>
0653 <member>
0654 <guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
0655 Create a new build target set</member>
0656 <member>
0657 <guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-copy-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
0658 Copy a command or target set</member>
0659 <member>
0660 <guiicon><inlinemediaobject><imageobject><imagedata fileref="edit-delete-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
0661 Delete the current command or target set</member>
0662 </simplelist>
0663 
0664 </sect3>
0665 
0666 <sect3 id="build-using-output">
0667 <title>Output tab</title>
0668 
0669 <para>The <guilabel>Output</guilabel> tab shows the console output generated by
0670 the last command.</para>
0671 
0672 <para>Use the slider at the top to show or hide categories of output:</para>
0673 
0674 <para><guilabel>Full Output</guilabel>, <guilabel>Parsed Output</guilabel>,
0675 <guilabel>Errors and Warnings</guilabel> or <guilabel>Only Errors</guilabel>
0676 </para>
0677 
0678 <para>Each line contains a message and the file name and line number if available.
0679 Clicking on the error or warning takes you to the appropriate file and places
0680 the cursor on the corresponding line number.</para>
0681 
0682 <para>To navigate to the previous error, press
0683 <keycombo action="simul">&Alt;&Shift;&Left;</keycombo>.
0684 To navigate to the next error, press
0685 <keycombo action="simul">&Alt;&Shift;&Right;</keycombo>.</para>
0686 
0687 </sect3>
0688 </sect2>
0689 
0690 <sect2 id="build-menu">
0691 <title>Menu Structure</title>
0692 
0693 <variablelist id="build-build">
0694 <varlistentry>
0695 <term><menuchoice id="build-targets">
0696 <guimenu>Build</guimenu><guisubmenu>Select Target</guisubmenu>
0697 </menuchoice></term>
0698 <listitem><para>Select from a list of targets configured by the user.</para></listitem>
0699 </varlistentry>
0700 
0701 <varlistentry id="build-default">
0702 <term><menuchoice>
0703 <guimenu>Build</guimenu><guimenuitem>Build Default Target</guimenuitem>
0704 </menuchoice></term>
0705 <listitem><para>Builds the target defined as default in the active target set.</para></listitem>
0706 </varlistentry>
0707 
0708 <varlistentry id="build-previous">
0709 <term><menuchoice>
0710 <guimenu>Build</guimenu><guimenuitem>Build Previous Target</guimenuitem>
0711 </menuchoice></term>
0712 <listitem><para>Switch to the previous target configured by the user.</para></listitem>
0713 </varlistentry>
0714 
0715 <varlistentry id="build-stop">
0716 <term><menuchoice>
0717 <guimenu>Build</guimenu><guimenuitem>Stop</guimenuitem>
0718 </menuchoice></term>
0719 <listitem><para>Stop building a target.</para></listitem>
0720 </varlistentry>
0721 
0722 <varlistentry id="build-previous-error">
0723 <term><menuchoice>
0724 <shortcut><keycombo action="simul">&Ctrl;&Alt;&Left;</keycombo></shortcut>
0725 <guimenu>Build</guimenu><guimenuitem>Previous Error</guimenuitem>
0726 </menuchoice></term>
0727 <listitem><para>Moves the cursor to the location of the previous error in the
0728 document.</para></listitem>
0729 </varlistentry>
0730 
0731 <varlistentry id="build-next-error">
0732 <term><menuchoice>
0733 <shortcut><keycombo action="simul">&Ctrl;&Alt;&Right;</keycombo></shortcut>
0734 <guimenu>Build</guimenu><guimenuitem>Next Error</guimenuitem>
0735 </menuchoice></term>
0736 <listitem><para>Moves the cursor to the location of the next error in the
0737 document.</para></listitem>
0738 </varlistentry>
0739 
0740 </variablelist>
0741 </sect2>
0742 
0743 <sect2 id="build-ack">
0744 <title>Thanks and Acknowledgments</title>
0745 <para>The &kate; Build Plugin was written by Kåre Särs.</para>
0746 <para>Special thanks to Google Code-In 2011 participant Salma Sultana for
0747 writing much of this section.</para>
0748 </sect2>
0749 </sect1>
0750 
0751 <sect1 id="kate-application-plugin-closeexceptlike">
0752 
0753 <title>Close Except/Like Plugin</title>
0754 
0755 <sect2 id="closeexceptlike-intro">
0756 <title>Introduction</title>
0757 
0758 <para>This plugin allows you to close a group of documents based on their extension and path.</para>
0759 
0760 </sect2>
0761 
0762 <sect2 id="closeexceptlike-using">
0763 <title>Using the Close Except/Like Plugin</title>
0764 
0765 <para>Assumed you have these documents opened in &kate;:</para>
0766 
0767 <simplelist>
0768 <member>/tmp/subfolder/test.h</member>
0769 <member>/tmp/test.cpp</member>
0770 <member>/tmp/test.txt</member>
0771 </simplelist>
0772 
0773 <para>Then you have the following options to close documents as displayed in the screenshot:</para>
0774 
0775 <screenshot id="screenshot-closeexceptlike">
0776 <screeninfo>Close Except</screeninfo>
0777 <mediaobject>
0778 <imageobject><imagedata fileref="close-except-like.png" format="PNG"/></imageobject>
0779 </mediaobject>
0780 </screenshot>
0781 
0782 <para>Use the checkbox in the last item of the list to enable or disable a confirmation dialog.
0783 The selected option will be applied to both close actions.
0784 </para>
0785 
0786 </sect2>
0787 
0788 <sect2 id="closeexceptlike-menu">
0789 <title>Menu Structure</title>
0790 
0791 <variablelist>
0792 <varlistentry id="file-close-except">
0793 <term><menuchoice>
0794 <guimenu>File</guimenu>
0795 <guisubmenu>Close Except</guisubmenu>
0796 </menuchoice></term>
0797 <listitem>
0798 <para><action>Close</action> all open documents, <emphasis>except</emphasis>
0799 those which match the path or file extension selected from the submenu.</para>
0800 </listitem>
0801 </varlistentry>
0802 
0803 <varlistentry id="file-close-like">
0804 <term><menuchoice>
0805 <guimenu>File</guimenu>
0806 <guisubmenu>Close Like</guisubmenu>
0807 </menuchoice></term>
0808 <listitem>
0809 <para><action>Close</action> all open documents
0810 which match the path or file extension selected from the submenu.</para>
0811 </listitem>
0812 </varlistentry>
0813 
0814 </variablelist>
0815 
0816 </sect2>
0817 
0818 </sect1>
0819 
0820 <sect1 id="kate-application-plugin-colorpicker">
0821 
0822 <title>Color Picker Plugin</title>
0823 
0824 <sect2 id="colorpicker-intro">
0825 <title>Introduction</title>
0826 
0827 <para>This plugin adds an inline color preview/picker to colors in the text (&eg;, <literal>#FFFFFF</literal>,
0828 <literal>white</literal>).</para>
0829 
0830 <para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
0831 <guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
0832 Then select <guilabel>Color Picker</guilabel> and close the dialog.
0833 </para>
0834 </sect2>
0835 
0836 <sect2 id="colorpicker-config">
0837 <title>Configuration</title>
0838 
0839 <para>On the Color Picker settings page in &kate;'s configuration, you can configure the following options of the plugin behavior.</para>
0840 
0841 <variablelist>
0842 
0843 <varlistentry>
0844 <term><guilabel>Show preview for known color names</guilabel></term>
0845 <listitem>
0846 <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>
0847 </listitem>
0848 </varlistentry>
0849 
0850 <varlistentry>
0851 <term><guilabel>Place preview after text color</guilabel></term>
0852 <listitem>
0853 <para>Whether to place the inline preview after text color in the text.</para>
0854 </listitem>
0855 </varlistentry>
0856 
0857 <varlistentry>
0858 <term><guilabel>Hex color matching</guilabel></term>
0859 <listitem>
0860 <para>Here, you can choose the best matching option for the colors used in your code.</para>
0861 </listitem>
0862 </varlistentry>
0863 
0864 </variablelist>
0865 
0866 </sect2>
0867 
0868 </sect1>
0869 
0870 <sect1 id="kate-application-plugin-colored-brackets">
0871 <title>Colored Brackets</title>
0872 
0873 <sect2><title>Introduction</title>
0874 <para>
0875 Colored brackets plugin colors matching bracket pairs in different colors to enhance readability. However, not all brackets get colored. A bracket whose matching opener or closer is not visible will be ignored. Similarly, a bracket pair that is the sole bracket pair on a line will not get colored.
0876 </para>
0877 </sect2>
0878 
0879 <sect2><title>Configuration</title>
0880 <para>The plugin doesn't provide any configurations.</para>
0881 </sect2>
0882 </sect1>
0883 
0884 <sect1 id="kate-application-plugin-ctags">
0885 <!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate/-->
0886 <title>CTags Plugin</title>
0887 
0888 <sect2 id="ctags-intro">
0889 <title>Introduction</title>
0890 
0891 <para><ulink url="https://en.wikipedia.org/wiki/Ctags">CTags</ulink> generates an
0892 index (or tag) file of language objects found in source files that allows these
0893 items to be quickly and easily located using this plugin in &kate;.
0894 </para>
0895 <para>A tag signifies a language object for which an index entry is available
0896 (or, alternatively, the index entry created for that object).</para>
0897 
0898 <para>Tag generation is supported for these
0899 <ulink url="http://ctags.sourceforge.net/languages.html">programming languages</ulink>.
0900 </para>
0901 </sect2>
0902 
0903 <sect2 id="ctags-config">
0904 <title>Configuration</title>
0905 
0906 <para>The CTags plugin uses two different database files for the index.</para>
0907 
0908 <para>On the CTags settings page in &kate;'s configuration you can add or remove
0909 directories containing the source code and regenerate the common CTags database.</para>
0910 
0911 <sect3 id="ctags-config-common">
0912 <title>Common Index</title>
0913 
0914 <screenshot id="screenshot-ctags-global-settings">
0915 <screeninfo>CTags Settings</screeninfo>
0916 <mediaobject>
0917 <imageobject><imagedata fileref="ctags-global-setting.png" format="PNG"/></imageobject>
0918 <caption>Configure CTags Global Database</caption>
0919 </mediaobject>
0920 </screenshot>
0921 
0922 <para>At the bottom of the settings page you can adapt the <guilabel>CTags command</guilabel>.
0923 </para>
0924 
0925 <para>For more information about all available options please read the CTags man page. This man page
0926 is available in &khelpcenter; and you can also enter the &URL; <emphasis>man:/ctags</emphasis>
0927 directly into &konqueror;
0928 </para>
0929 
0930 <para>Clicking <guibutton>Update</guibutton> will start indexing.
0931 When indexing is finished, close the dialog.</para>
0932 </sect3>
0933 
0934 <sect3 id="ctags-config-session">
0935 <title>Session Index</title>
0936 
0937 <para>To configure the session index open the <guilabel>CTags</guilabel> view.</para>
0938 
0939 <variablelist>
0940 <varlistentry>
0941 <term><menuchoice>
0942 <guimenu>Index Targets</guimenu>
0943 </menuchoice></term>
0944 <listitem>
0945 <para>On this tab you can add or remove directories containing the source code and manually
0946 regenerate the session specific CTags database.</para>
0947 </listitem>
0948 </varlistentry>
0949 
0950 <varlistentry>
0951 <term><menuchoice>
0952 <guimenu>Database</guimenu>
0953 </menuchoice></term>
0954 <listitem>
0955 <screenshot id="screenshot-ctags-session-settings">
0956 <screeninfo>Database Settings</screeninfo>
0957 <mediaobject>
0958 <imageobject><imagedata fileref="ctags-session-setting.png" format="PNG"/></imageobject>
0959 <caption>Configure CTags Session Database</caption>
0960 </mediaobject>
0961 </screenshot>
0962 <para>Select another CTags database file, configure the CTags command or revert
0963 to the default command.</para>
0964 </listitem>
0965 </varlistentry>
0966 
0967 </variablelist>
0968 
0969 </sect3>
0970 
0971 </sect2>
0972 
0973 <sect2 id="ctags-using">
0974 <title>Using the CTags Plugin</title>
0975 
0976 <para>
0977 You place the mouse cursor on the language object like function, symbol &etc;
0978 that you are interested in and then select one of the actions in the
0979 <guimenu>CTags</guimenu> menu to jump to the line and file where the object is
0980 defined or declared.</para>
0981 <para>By default the actions in the <guimenu>CTags</guimenu> menu have no shortcuts assigned.
0982 Use the <ulink url="help:/fundamentals/shortcuts.html">keyboard shortcut editor</ulink>
0983 to configure your own shortcuts.</para>
0984 
0985 <para>Alternatively use the search field on the <guilabel>Lookup</guilabel> tab of the
0986 CTags view.</para>
0987 <para>Entering characters into the search field will start the search and display matching names
0988 of language objects like functions, classes, symbols &etc; together with type and filename.</para>
0989 <para>Select an item in the list to jump to the corresponding line in the source file.</para>
0990 <!--FIXME why Tag Type here but Name Kind in Project plugin, is there really any difference?-->
0991 
0992 <!--FIXME completion as in Project plugin? -->
0993 
0994 </sect2>
0995 
0996 <sect2 id="ctags-menu">
0997 <title>Menu Structure</title>
0998 
0999 <variablelist>
1000 
1001 <varlistentry id="ctags-jumpback">
1002 <term><menuchoice>
1003 <guimenu>CTags</guimenu>
1004 <guisubmenu>Jump back one step</guisubmenu>
1005 </menuchoice></term>
1006 <listitem>
1007 <para>Navigate back in the history to the last visited tag.</para>
1008 </listitem>
1009 </varlistentry>
1010 
1011 <varlistentry id="ctags-lookup">
1012 <term><menuchoice>
1013 <guimenu>CTags</guimenu>
1014 <guisubmenu>Lookup Current Text</guisubmenu>
1015 </menuchoice></term>
1016 <listitem>
1017 <para>Opens the <guilabel>Lookup</guilabel> tab of the CTags view and displays all
1018 language objects matching the current text selection in the list.</para>
1019 </listitem>
1020 </varlistentry>
1021 
1022 <varlistentry id="ctags-gotodeclaration">
1023 <term><menuchoice>
1024 <guimenu>CTags</guimenu>
1025 <guisubmenu>Go to Declaration</guisubmenu>
1026 </menuchoice></term>
1027 <listitem>
1028 <para>If the cursor is in a definition object this will open the document
1029 containing the corresponding declaration if needed, activate its view and
1030 place the cursor at the start of the declaration.</para>
1031 </listitem>
1032 </varlistentry>
1033 
1034 <varlistentry id="ctags-gotodefinition">
1035 <term><menuchoice>
1036 <guimenu>CTags</guimenu>
1037 <guisubmenu>Go to Definition</guisubmenu>
1038 </menuchoice></term>
1039 <listitem>
1040 <para>If the cursor is in a declaration object this will open the document
1041 containing the corresponding definition if needed, activate its view and
1042 place the cursor at the start of the definition.</para>
1043 </listitem>
1044 </varlistentry>
1045 
1046 </variablelist>
1047 
1048 <!--context menu with Lookup Current Text, Goto Declaration, Goto Definition -->
1049 
1050 </sect2>
1051 
1052 </sect1>
1053 <!--https://frinring.wordpress.com/2017/11/07/ktexteditorpreviewplugin-0-2-1-last-stand-alone/-->
1054 <!-- https://frinring.wordpress.com/2017/08/21/look-what-you-have-donewwdo/-->
1055 <sect1 id="kate-application-plugin-preview">
1056 <title>Document Preview Plugin</title>
1057 
1058 <sect2 id="preview-introduction">
1059 <title>Introduction</title>
1060 <para>
1061 The plugin enables a live preview of the currently edited text document in the
1062 final format in the sidebar. So when editing &eg; a &Markdown; text or an &SVG; image,
1063 the result is instantly visible next to the source text.
1064 </para>
1065 
1066 <para>For the display the plugin uses that &kparts; plugin which is currently selected
1067 as the preferred one for the &MIME; type of the document.
1068 If there is no &kparts; plugin for that type, no preview is possible.
1069 </para>
1070 
1071 <para>To change the preferred plugin open the <guilabel>File Associations</guilabel>
1072 module in the &systemsettings; and edit the <guilabel>Services Preference Order</guilabel>
1073 on the <guilabel>Embedding</guilabel> tab.
1074 </para>
1075 
1076 <table>
1077 <title>Some available &kparts; plugins</title>
1078 <tgroup cols="2">
1079 <tbody>
1080 <row>
1081 <entry>&MIME; type</entry><entry>&kparts; plugin</entry>
1082 </row>
1083 <row>
1084 <entry>&Markdown; text</entry><entry>KMarkdownWebViewPart or OkularPart</entry>
1085 </row>
1086 <row>
1087 <entry>&SVG; image</entry><entry>SVGPart</entry>
1088 </row>
1089 <row>
1090 <entry>&Qt; UI files</entry><entry>KUIViewerPart</entry>
1091 </row>
1092 <row>
1093 <entry>&DOT; graph files</entry><entry>KGraphviewerPart</entry>
1094 </row>
1095 </tbody>
1096 </tgroup>
1097 </table>
1098 </sect2>
1099 
1100 <sect2 id="preview-menu">
1101 <title>Menu Structure</title>
1102 <variablelist>
1103 
1104 <varlistentry id="view-toolviews-show-preview">
1105 <term><menuchoice>
1106 <guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
1107 <guimenuitem>Show Preview</guimenuitem>
1108 </menuchoice></term>
1109 <listitem>
1110 <para>Toggle the display of &kate;'s Document preview in a sidebar.</para>
1111 </listitem>
1112 </varlistentry>
1113 </variablelist>
1114 </sect2>
1115 
1116 <sect2 id="preview-interface">
1117 <title>Interface</title>
1118 <para>The buttons at the top of the preview window provide these actions:
1119 </para>
1120 <itemizedlist>
1121 <listitem>
1122 <para>Lock the preview to a given document. Selecting this option ensures
1123 that if switching the focus to the view of another document in the same &kate;
1124 window, the preview will not follow to that document, but keep previewing
1125 this document.</para>
1126 </listitem>
1127 <listitem>
1128 <para>Enable or disable updates of the preview of the current document content</para>
1129 </listitem>
1130 <listitem>
1131 <para>Manually update the preview of the current document content</para>
1132 </listitem>
1133 <listitem>
1134 <para>A dropdown menu with actions from the &kparts; plugin</para>
1135 </listitem>
1136 </itemizedlist>
1137 </sect2>
1138 
1139 </sect1>
1140 
1141 <sect1 id="kate-application-plugin-documentswitcher">
1142 
1143 <title>Document Switcher Plugin</title>
1144 
1145 <sect2 id="documentswitcher-menu">
1146 <title>Menu Structure</title>
1147 
1148 <variablelist>
1149 
1150 <varlistentry id="view-documentswitcher">
1151 <term><menuchoice>
1152 <shortcut>
1153 <keycombo action="simul">&Ctrl;&Tab;</keycombo>
1154 </shortcut>
1155 <guimenu>View</guimenu>
1156 <guisubmenu>Last Used Views</guisubmenu>
1157 </menuchoice></term>
1158 <term><menuchoice>
1159 <shortcut>
1160 <keycombo action="simul">&Ctrl;&Shift;&Tab;</keycombo>
1161 </shortcut>
1162 <guimenu>View</guimenu>
1163 <guisubmenu>Last Used Views (Reverse)</guisubmenu>
1164 </menuchoice></term>
1165 <listitem>
1166 
1167 <para><action>Opens</action> a list with the last viewed documents:</para>
1168 
1169 <screenshot id="screenshot-documentswitcher">
1170 <screeninfo>Last viewed documents</screeninfo>
1171 <mediaobject>
1172 <imageobject><imagedata fileref="documentswitcher.png" format="PNG"/></imageobject>
1173 </mediaobject>
1174 </screenshot>
1175 
1176 <para>Keep the &Ctrl; key pressed and use the &Tab; key to cycle forward through the list.
1177 Additionally press the &Shift; key to reverse the direction.
1178 </para>
1179 
1180 <para>Keep the shortcut <keycombo action="simul">&Ctrl;&Tab;</keycombo> pressed and
1181 can use the &Up;, &Down;, &Home; or
1182 &End; keys to navigate in the list. Pressing a char key consecutively
1183 will cycle through all items with the first matching in the list.
1184 If you release the shortcut keys the view will switch to the selected document in the list.
1185 </para>
1186 </listitem>
1187 </varlistentry>
1188 
1189 </variablelist>
1190 
1191 </sect2>
1192 
1193 </sect1>
1194 
1195 
1196 <sect1 id="kate-application-plugin-fsbrowser">
1197 
1198 <title>File System Browser</title>
1199 
1200 <para>The File System Browser is a folder viewer, allowing you to open
1201 files from a displayed folder in the current frame.</para>
1202 
1203 <sect2 id="fsbrowser-menu">
1204 <title>Menu Structure</title>
1205 <variablelist>
1206 
1207 <varlistentry id="view-toolviews-show-filebrowser">
1208 <term><menuchoice>
1209 <guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
1210 <guimenuitem>Show Filesystem Browser</guimenuitem>
1211 </menuchoice></term>
1212 <listitem>
1213 <para>Toggle the display of &kate;'s Filesystem Browser.</para>
1214 </listitem>
1215 </varlistentry>
1216 
1217 </variablelist>
1218 </sect2>
1219 
1220 <sect2 id="fsbrowser-interface">
1221 <title>Interface</title>
1222 
1223 <para>From the top down, the Filesystem Browser consists of the following
1224 elements:</para>
1225 
1226 <variablelist>
1227 <varlistentry>
1228 <term>A Toolbar</term>
1229 <listitem>
1230 <para>This contains standard navigations tool buttons:</para>
1231 <variablelist>
1232 <varlistentry>
1233 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-previous-22.png" format="PNG"/></imageobject></inlinemediaobject> Back</guiicon></term>
1234 <listitem><para>Causes the folder view to <command>cd</command> to the previously displayed folder in the history.
1235 This button is disabled, if there is no previous item.</para></listitem>
1236 </varlistentry>
1237 <varlistentry>
1238 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-next-22.png" format="PNG"/></imageobject></inlinemediaobject> Forward</guiicon></term>
1239 <listitem><para>Causes the folder view to <command>cd</command> to the next folder in the history.
1240 This button is disabled, if there is no next folder.</para></listitem>
1241 </varlistentry>
1242 <!--varlistentry>
1243 <term><guibutton>Parent Folder</guibutton></term>
1244 <listitem><para>This will cause the folder view to <command>cd</command> to the immediate parent of the currently displayed
1245 folder if possible.</para></listitem>
1246 </varlistentry-->
1247 <varlistentry>
1248 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="bookmarks-22.png" format="PNG"/></imageobject></inlinemediaobject> Bookmarks</guiicon></term>
1249 <listitem><para>Opens a submenu to edit or add bookmarks and to add a new bookmark folder.</para></listitem>
1250 </varlistentry>
1251 <varlistentry>
1252 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="system-switch-user-22.png" format="PNG"/></imageobject></inlinemediaobject> Current Document Folder</guiicon></term>
1253 <listitem><para>This button will cause the folder view to
1254 <command>cd</command> to the folder of the currently active
1255 document if possible. This button is disabled, if the active document
1256 is a new, unsaved file, or the folder in which it resides can not
1257 be decided.</para></listitem>
1258 </varlistentry>
1259 <varlistentry>
1260 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject> Options</guiicon></term>
1261 <listitem>
1262 <variablelist>
1263 <varlistentry>
1264 <term><guimenuitem>Short View</guimenuitem></term>
1265 <listitem><para>Displays only the filenames.</para></listitem>
1266 </varlistentry>
1267 <varlistentry>
1268 <term><guimenuitem>Detailed View</guimenuitem></term>
1269 <listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel> and
1270 <guilabel>Size</guilabel> of the files.</para></listitem>
1271 </varlistentry>
1272 <varlistentry>
1273 <term><guimenuitem>Tree View</guimenuitem></term>
1274 <listitem><para>Like Short View, but folders can be expanded to view their contents.</para></listitem>
1275 </varlistentry>
1276 <varlistentry>
1277 <term><guimenuitem>Detailed Tree View</guimenuitem></term>
1278 <listitem><para>This also allows folders to be expanded, but displays the additional columns
1279 available in Detailed View.</para></listitem>
1280 </varlistentry>
1281 <varlistentry>
1282 <term><guimenuitem>Show Hidden Files</guimenuitem></term>
1283 <listitem><para>Displays files normally hidden by your &OS;.</para></listitem>
1284 </varlistentry>
1285 <varlistentry>
1286 <term><guimenuitem>Automatically synchronize with current document</guimenuitem></term>
1287 <listitem><para>When this option is enabled the filesystem browser will automatically <command>cd</command>
1288 to the folder of the document currently open in the editing area every time it changes.</para></listitem>
1289 </varlistentry>
1290 </variablelist>
1291 </listitem>
1292 </varlistentry>
1293 </variablelist>
1294 </listitem>
1295 </varlistentry>
1296 
1297 <varlistentry>
1298 <term>A Location Entry</term>
1299 <listitem>
1300 <para>This displays a breadcrumb navigation to the currently open folder, similarly to
1301 &dolphin;.  You can click on a any folder to browse to it, or click on one of the
1302 arrows to the left of a folder to select any folders beneath it.  You may also
1303 select from your list of Places by clicking the leftmost icon in the breadcrumb
1304 navigation, which displays an icon that represents your current Place.</para>
1305 
1306 <para>You can also click to the right of the breadcrumbs to change them to a text box
1307 where you can type the path of a folder to browse. The &URL;
1308 entry maintains a list of previously typed paths. To choose one, use
1309 the arrow button to the right of the entry.</para>
1310 <tip><para>The &URL; entry has folder auto-completion. The completion
1311 method can be set using the &RMB; menu of the text
1312 entry.</para></tip>
1313 </listitem>
1314 </varlistentry>
1315 
1316 <varlistentry>
1317 <term>A Folder View</term>
1318 <listitem><para>This is a standard &kde; folder view.</para></listitem>
1319 </varlistentry>
1320 
1321 <varlistentry>
1322 <term>A Filter Entry</term>
1323 <listitem>
1324 <para>The Filter entry allows you to enter a filter for the files
1325 displayed in the folder view. The filter uses standard globs; patterns
1326 must be separated by white space. Example: <userinput>*.cpp *.h
1327 *.moc</userinput></para>
1328 <para>To display all files, enter a single asterisk
1329 <userinput>*</userinput>.</para>
1330 <para>The filter entry saves the last 10 filters entered between
1331 sessions.  To use one, press the arrow button on the right of the entry
1332 and select the desired filter string.  You can disable the filter by pressing
1333 the <guibutton>Clear text</guibutton> button to the left of the autocompletion
1334 arrow button.</para>
1335 </listitem>
1336 </varlistentry>
1337 
1338 </variablelist>
1339 </sect2>
1340 
1341 
1342 <sect2 id="fsbrowser-config">
1343 <title>Configuration</title>
1344 
1345 <para>This plugin can be configured on the <guilabel>Filesystem Browser</guilabel> page
1346 of <link linkend="configuring-kate-configdialog">&kate;'s configuration</link>.</para>
1347 
1348 <variablelist>
1349 <varlistentry>
1350 <term><guilabel>Toolbar</guilabel></term>
1351 <listitem><para>Configure the buttons on the Filesystem Browser toolbar
1352 by moving the ones you want enabled to the <guilabel>Selected Actions</guilabel>
1353 list, and order them using the arrow buttons at the side of the list.</para>
1354  </listitem>
1355 </varlistentry>
1356 
1357 </variablelist>
1358 </sect2>
1359 </sect1>
1360 
1361 <sect1 id="kate-application-plugin-documents">
1362 <title>The Documents List</title>
1363 <!-- https://kate-editor.org/2010/09/12/kate-tree-view-plugin-update/-->
1364 <sect2 id="documents-intro">
1365 <title>Introduction</title>
1366 
1367 <para><indexterm><primary>Documents list</primary></indexterm>
1368 The documents list displays a list of all documents currently open in
1369 &kate;. Modified files will have a small <guiicon>floppy
1370 disk</guiicon> icon on their left to indicate that state.</para>
1371 
1372 <para>On the top the Documents list has a toolbar with the following buttons:</para>
1373 
1374 <simplelist>
1375 <member>
1376 <guiicon><inlinemediaobject><imageobject><imagedata fileref="document-new-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1377 Create new document</member>
1378 <member>
1379 <guiicon><inlinemediaobject><imageobject><imagedata fileref="document-open-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1380 Open an existing document</member>
1381 <member>
1382 <guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1383 Previous Document</member>
1384 <member>
1385 <guiicon><inlinemediaobject><imageobject><imagedata fileref="go-down-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1386 Next Document</member>
1387 <member>
1388 <guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1389 Save the current document</member>
1390 <member>
1391 <guiicon><inlinemediaobject><imageobject><imagedata fileref="document-save-as-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
1392 Save the current document under a new name</member>
1393 </simplelist>
1394 
1395 <para>By default, the Documents list appears in
1396 <guimenuitem>Tree Mode</guimenuitem>, which displays the folder structure
1397 surrounding all currently open documents. Also available is
1398 <guimenuitem>List Mode</guimenuitem>, which displays a simple list of all
1399 open documents. You can switch modes by right-clicking on the list and selecting
1400 from the <guisubmenu>View Mode</guisubmenu> menu.</para>
1401 
1402 <para>If two or more files with the same name (located in different
1403 folders) are open in <guimenuitem>List Mode</guimenuitem>, the names of the second will be prepended
1404 <quote>(2)</quote> and so on. The tool-tip for the file will
1405 display its full name including the path, allowing you to choose the
1406 desired one.</para> <para>To display a document in the currently
1407 active frame, click the document name in the list.</para>
1408 
1409 <para>The context menu has some common actions from the <guimenu>File</guimenu> menu.</para>
1410 
1411 <para>Additionally there are filemanager actions to rename or delete the file. With
1412 <guimenuitem>Copy Location</guimenuitem> you can copy the full path of the document
1413 to the clipboard.</para>
1414 
1415 <para>You can sort the list in a few different ways by right clicking the
1416 list and selecting from the <guisubmenu>Sort By</guisubmenu> menu.
1417 
1418 The options are:
1419 <variablelist>
1420 
1421 <varlistentry>
1422 <term><guimenuitem>Document Name</guimenuitem></term>
1423 <listitem><para>Lists the documents alphabetically by their name.</para></listitem>
1424 </varlistentry>
1425 
1426 <varlistentry>
1427 <term><guimenuitem>Document Path</guimenuitem></term>
1428 <listitem><para>Lists the documents alphabetically by the path to them.</para></listitem>
1429 </varlistentry>
1430 
1431 <varlistentry>
1432 <term><guimenuitem>Opening Order</guimenuitem></term>
1433 <listitem><para>Lists the documents in the order of opening.</para></listitem>
1434 </varlistentry>
1435 
1436 </variablelist>
1437 
1438 </para>
1439 
1440 <para>The document list will per default visualize your history by shading the
1441 entries for the most recent documents with a background color. If the document
1442 was edited, an extra color is blended in. The most recent document has the
1443 strongest color, so that you can easily find the documents you are working on.
1444 This feature can be disabled in the
1445 <link linkend="config-dialog-documents">Documents</link> page
1446 of the configuration dialog.</para>
1447 <para>The default location of the document list in the &kate; window is to the left of the
1448 editing area.</para>
1449 
1450 </sect2>
1451 
1452 <sect2 id="documents-menus">
1453 <title>Menu Structure</title>
1454 
1455 <variablelist>
1456 
1457 <varlistentry id="view-document-previous">
1458 <term><menuchoice>
1459 <shortcut>
1460 <keycombo action="simul">&Alt;&Up;</keycombo>
1461 </shortcut>
1462 <guimenu>View</guimenu>
1463 <guimenuitem>Previous Document</guimenuitem>
1464 </menuchoice></term>
1465 <listitem>
1466 <para>Opens the document displayed above the currently open document in the Documents list.</para>
1467 </listitem>
1468 </varlistentry>
1469 
1470 <varlistentry id="view-document-next">
1471 <term><menuchoice>
1472 <shortcut>
1473 <keycombo action="simul">&Alt;&Down;</keycombo>
1474 </shortcut>
1475 <guimenu>View</guimenu>
1476 <guimenuitem>Next Document</guimenuitem>
1477 </menuchoice></term>
1478 <listitem>
1479 <para>Opens the document displayed below the currently open document in the Documents list.</para>
1480 </listitem>
1481 </varlistentry>
1482 
1483 <varlistentry id="view-active">
1484 <term><menuchoice>
1485 <guimenu>View</guimenu>
1486 <guimenuitem>Show Active</guimenuitem>
1487 </menuchoice></term>
1488 <listitem>
1489 <para>Displays the currently open document in the Documents list.</para>
1490 </listitem>
1491 </varlistentry>
1492 
1493 </variablelist>
1494 
1495 </sect2>
1496 
1497 <sect2 id="config-dialog-documents">
1498 <title>Configuration</title>
1499 
1500 <variablelist>
1501 <varlistentry>
1502 <term><guilabel>Background Shading</guilabel></term>
1503 <listitem><para>This section allows you to enable or disable the background
1504 shading visualization of your recent activity, and choose which colors to use if
1505 enabled.</para></listitem>
1506 </varlistentry>
1507 
1508 <varlistentry>
1509 <term><guilabel>Sort By</guilabel></term>
1510 <listitem><para>Set how you want the document list sorted. This can be set
1511 from the &RMB; menu in the document list as well.</para></listitem>
1512 </varlistentry>
1513 
1514 <varlistentry>
1515 <term><guilabel>View Mode</guilabel></term>
1516 <listitem><para>This provides two options that effect the display of the
1517 Documents tool view.  The <guilabel>Tree View</guilabel> option will display
1518 the documents in a tree underneath the folders they are in, while the
1519 <guilabel>List View</guilabel> option will display a flat list of documents.
1520 </para></listitem>
1521 </varlistentry>
1522 
1523 <varlistentry>
1524 <term><guilabel>Show Full Path</guilabel></term>
1525 <listitem><para>When Tree View and this option are enabled, the folder entries
1526 displayed in the Documents tool view will display the full filesystem path to
1527 the folder in addition to the name of the folder.  It has no effect in List
1528 View.</para></listitem>
1529 </varlistentry>
1530 
1531 <varlistentry>
1532 <term><guilabel>Show Toolbar</guilabel></term>
1533 <listitem><para>When Tree View and this option are enabled, a toolbar with
1534 actions like <guibutton>Save</guibutton> is displayed above the
1535 list of documents. Uncheck this option if the toolbar should be
1536 hidden.</para></listitem>
1537 </varlistentry>
1538 
1539 <varlistentry>
1540 <term><guilabel>Show Close Button</guilabel></term>
1541 <listitem><para>When this option is enabled, &kate; will show a close button
1542 for opened documents on hover.</para></listitem>
1543 </varlistentry>
1544 
1545 </variablelist>
1546 
1547 </sect2>
1548 
1549 </sect1>
1550 
1551 <sect1 id="kate-application-plugin-gdb">
1552 <!--https://kate-editor.org/2011/06/23/kate-plugin-updates-part-2/-->
1553 <sect1info>
1554 <authorgroup>
1555 <author><firstname>Martin</firstname> <surname>Gergov</surname></author>
1556 <author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
1557 </authorgroup>
1558 </sect1info>
1559 <title>&gdb; Plugin</title>
1560 
1561 <sect2 id="gdb-intro">
1562 <title>Introduction</title>
1563 
1564 <para>&kate;'s &gdb; plugin provides a simple frontend to the popular &GNU;
1565 Project Debugger.</para>
1566 
1567 <important>
1568 <para>Previous experience with &gdb; is strongly recommended.  For more
1569 information on using &gdb;, visit <ulink url="https://www.gnu.org/software/gdb/">the
1570 &gdb; website</ulink>.</para>
1571 </important>
1572 
1573 <para>You can enable the &gdb; plugin in
1574 <link linkend="config-dialog-plugins">the Plugins section of &kate;'s
1575 configuration</link>.</para>
1576 
1577 <para>For the plugin to work properly, you must have a source file (of any type
1578 supported by &gdb;) and an executable.</para>
1579 
1580 <tip>
1581 <para>If you compile using &gcc;/<command>g++</command> you might want to use
1582 the <command><parameter>-ggdb</parameter></command> command line argument.
1583 </para>
1584 </tip>
1585 
1586 <para>After these preparations are made, open the source file in &kate;,
1587 enter the path to the executable in the <guilabel>Settings</guilabel> tab of the
1588 <guilabel>Debug View</guilabel> tool view, and select
1589 <menuchoice><guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem></menuchoice>
1590 from the menu to get started.</para>
1591 
1592 </sect2>
1593 
1594 <sect2 id="gdb-menus">
1595 <title>Menu and Toolbar Structure</title>
1596 
1597 <para>All of these options are available in &kate;'s menus, and many are
1598 available on the Debug toolbar as well.</para>
1599 
1600 <variablelist>
1601 
1602 <varlistentry id="gdb-menus-show-debug-view">
1603 <term><menuchoice>
1604 <guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Debug View</guimenuitem>
1605 </menuchoice></term>
1606 <listitem><para>Shows a tool view containing &gdb; output, the &gdb; command
1607 line used, and other settings.</para></listitem>
1608 </varlistentry>
1609 
1610 <varlistentry id="gdb-menus-show-locals-and-stack">
1611 <term><menuchoice>
1612 <guimenu>View</guimenu><guisubmenu>Tool View</guisubmenu><guimenuitem>Show Locals and Stack</guimenuitem>
1613 </menuchoice></term>
1614 <listitem><para>Shows a list of all currently loaded variables and their values and a &gdb; backtrace.
1615 </para></listitem>
1616 </varlistentry>
1617 
1618 <varlistentry id="gdb-menus-targets">
1619 <term><menuchoice>
1620 <guimenu>Debug</guimenu><guisubmenu>Targets</guisubmenu>
1621 </menuchoice></term>
1622 <listitem><para>A submenu containing a list of targets (executables).
1623 </para></listitem>
1624 </varlistentry>
1625 
1626 <varlistentry id="gdb-menus-start">
1627 <term><menuchoice>
1628 <guimenu>Debug</guimenu><guimenuitem>Start Debugging</guimenuitem>
1629 </menuchoice></term>
1630 <listitem><para>Starts &gdb; with a target.</para></listitem>
1631 </varlistentry>
1632 
1633 <varlistentry id="gdb-menus-kill">
1634 <term><menuchoice>
1635 <guimenu>Debug</guimenu><guimenuitem>Kill / Stop Debugging</guimenuitem>
1636 </menuchoice></term>
1637 <listitem><para>Stops &gdb;.</para></listitem>
1638 </varlistentry>
1639 
1640 <varlistentry id="gdb-menus-restart">
1641 <term><menuchoice>
1642 <guimenu>Debug</guimenu><guimenuitem>Restart Debugging</guimenuitem>
1643 </menuchoice></term>
1644 <listitem><para>Restarts &gdb;.</para></listitem>
1645 </varlistentry>
1646 
1647 <varlistentry id="gdb-menus-break">
1648 <term><menuchoice>
1649 <guimenu>Debug</guimenu><guimenuitem>Toggle Breakpoint / Break</guimenuitem>
1650 </menuchoice></term>
1651 <listitem><para>Set a breakpoint at the current cursor position.
1652 </para></listitem>
1653 </varlistentry>
1654 
1655 <varlistentry id="gdb-menus-step-in">
1656 <term><menuchoice>
1657 <guimenu>Debug</guimenu><guimenuitem>Step In</guimenuitem>
1658 </menuchoice></term>
1659 <listitem><para>Execute the present statement (function call will be debugged).
1660 </para></listitem>
1661 </varlistentry>
1662 
1663 <varlistentry id="gdb-menus-step-over">
1664 <term><menuchoice>
1665 <guimenu>Debug</guimenu><guimenuitem>Step Over</guimenuitem>
1666 </menuchoice></term>
1667 <listitem><para>Execute the present statement (function call will not be
1668 debugged).</para></listitem>
1669 </varlistentry>
1670 
1671 <varlistentry id="gdb-menus-step-out">
1672 <term><menuchoice>
1673 <guimenu>Debug</guimenu><guimenuitem>Step Out</guimenuitem>
1674 </menuchoice></term>
1675 <listitem><para>Resumes execution until the program that is executing
1676 terminates.</para></listitem>
1677 </varlistentry>
1678 
1679 <varlistentry id="gdb-menus-move-pc">
1680 <term><menuchoice>
1681 <guimenu>Debug</guimenu><guimenuitem>Move PC</guimenuitem>
1682 </menuchoice></term>
1683 <listitem><para>Move program counter (next execution).</para></listitem>
1684 </varlistentry>
1685 
1686 <varlistentry id="gdb-menus-run-to-cursor">
1687 <term><menuchoice>
1688 <guimenu>Debug</guimenu><guimenuitem>Run To Cursor</guimenuitem>
1689 </menuchoice></term>
1690 <listitem><para>Runs the program until it reaches current cursor position.
1691 </para></listitem>
1692 </varlistentry>
1693 
1694 <varlistentry id="gdb-menus-continue">
1695 <term><menuchoice>
1696 <guimenu>Debug</guimenu><guimenuitem>Continue</guimenuitem>
1697 </menuchoice></term>
1698 <listitem><para>Ignores any breakpoints and executes program until it terminates
1699 (successfully or not).</para></listitem>
1700 </varlistentry>
1701 
1702 <varlistentry id="gdb-menus-print-value">
1703 <term><menuchoice>
1704 <guimenu>Debug</guimenu><guimenuitem>Print Value</guimenuitem>
1705 </menuchoice></term>
1706 <listitem><para>Prints the value of the variable that the cursor is currently
1707 pointing to.</para></listitem>
1708 </varlistentry>
1709 
1710 <varlistentry id="gdb-menus-toolbar">
1711 <term><menuchoice>
1712 <guimenu>Settings</guimenu><guisubmenu>Toolbars Shown</guisubmenu><guimenuitem>&gdb; Plugin</guimenuitem>
1713 </menuchoice></term>
1714 <listitem><para>Display the debugging toolbar.</para></listitem>
1715 </varlistentry>
1716 
1717 </variablelist>
1718 
1719 </sect2>
1720 
1721 <sect2 id="gdb-debug-view">
1722 <title>Debug View</title>
1723 
1724 <para>The <guilabel>Debug View</guilabel> tool view consists of several tabs:
1725 </para>
1726 
1727 <variablelist>
1728 
1729 <varlistentry>
1730 <term><guilabel>&gdb; Output</guilabel></term>
1731 <listitem>
1732 <para>Contains output from &gdb; and a &gdb; command line.</para>
1733 
1734 <screenshot id="screenshot-gdb-output">
1735 <screeninfo>The Output Tab</screeninfo>
1736 <mediaobject>
1737 <imageobject><imagedata fileref="gdb-output.png" format="PNG"/></imageobject>
1738 <textobject><phrase>The Output tab.</phrase></textobject>
1739 <caption><para>The <guilabel>Output</guilabel> tab displaying the output from a
1740 debugging session.</para></caption>
1741 </mediaobject>
1742 </screenshot>
1743 
1744 </listitem>
1745 </varlistentry>
1746 
1747 <varlistentry>
1748 <term><guilabel>Settings</guilabel></term>
1749 <listitem>
1750 <variablelist>
1751 
1752 <varlistentry>
1753 <term><guilabel>Executable</guilabel></term>
1754 <listitem><para>Path to the target (executable) for debugging.</para></listitem>
1755 </varlistentry>
1756 
1757 <varlistentry>
1758 <term><guilabel>Working Directory</guilabel></term>
1759 <listitem><para>The current working directory provided to the target.
1760 </para></listitem>
1761 </varlistentry>
1762 
1763 <varlistentry>
1764 <term><guilabel>Arguments</guilabel></term>
1765 <listitem><para>Arguments passed to the program.</para></listitem>
1766 </varlistentry>
1767 
1768 <varlistentry>
1769 <term><guilabel>Keep focus</guilabel></term>
1770 <listitem><para>Keeps focus on the &gdb; command line.</para></listitem>
1771 </varlistentry>
1772 
1773 <varlistentry>
1774 <term><guilabel>Redirect IO</guilabel></term>
1775 <listitem><para>Opens a new <guilabel>IO</guilabel> tab in the <guilabel>Debug
1776 View</guilabel> where you can view output and provide input to the running
1777 program.</para></listitem>
1778 </varlistentry>
1779 
1780 </variablelist>
1781 
1782 <screenshot id="screenshot-gdb-settings">
1783 <screeninfo>The Settings dialog</screeninfo>
1784 <mediaobject>
1785 <imageobject><imagedata fileref="gdb-settings.png" format="PNG"/></imageobject>
1786 <textobject><phrase>The Settings dialog</phrase></textobject>
1787 <caption><para>The <guilabel>Settings</guilabel> dialog displaying the configuration
1788 of a debugging session.</para></caption>
1789 </mediaobject>
1790 </screenshot>
1791 
1792 </listitem>
1793 </varlistentry>
1794 
1795 <varlistentry>
1796 <term><guilabel>IO</guilabel></term>
1797 <listitem>
1798 <para>Contains an area that displays output from the running program and a
1799 command line where you may provide input to it.</para>
1800 
1801 <screenshot id="screenshot-gdb-io">
1802 <screeninfo>The IO Tab</screeninfo>
1803 <mediaobject>
1804 <imageobject><imagedata fileref="gdb-io.png" format="PNG"/></imageobject>
1805 <textobject><phrase>The IO tab.</phrase></textobject>
1806 <caption><para>The <guilabel>IO</guilabel> tab displaying output from a simple
1807 test program.</para></caption>
1808 </mediaobject>
1809 </screenshot>
1810 
1811 </listitem>
1812 </varlistentry>
1813 
1814 </variablelist>
1815 
1816 </sect2>
1817 
1818 <sect2 id="gdb-other">
1819 <title>Call Stack and Locals</title>
1820 
1821 <para>The <guilabel>Call Stack</guilabel> tool view contains a list of the formatted
1822 backtrace returned from &gdb;.</para>
1823 
1824 <screenshot id="screenshot-gdb-call-stack">
1825 <screeninfo>The &gdb; Call Stack Tool View</screeninfo>
1826 <mediaobject>
1827 <imageobject><imagedata fileref="gdb-call-stack.png" format="PNG"/></imageobject>
1828 <textobject><phrase>The Call Stack tool view.</phrase></textobject>
1829 <caption><para>The &gdb; Plugin's <guilabel>Call Stack</guilabel> tool view.
1830 </para></caption>
1831 </mediaobject>
1832 </screenshot>
1833 
1834 <para>The <guilabel>Locals</guilabel> tool view contains a list of all currently
1835 loaded variables from the program and their corresponding values.</para>
1836 
1837 <screenshot id="screenshot-gdb-locals">
1838 <screeninfo>The &gdb; Locals Tool View</screeninfo>
1839 <mediaobject>
1840 <imageobject><imagedata fileref="gdb-locals.png" format="PNG"/></imageobject>
1841 <textobject><phrase>The Locals tool view.</phrase></textobject>
1842 <caption><para>The &gdb; Plugin's <guilabel>Locals</guilabel> tool view.
1843 </para></caption>
1844 </mediaobject>
1845 </screenshot>
1846 
1847 </sect2>
1848 
1849 <sect2 id="gdb-ack">
1850 <title>Thanks and Acknowledgments</title>
1851 
1852 <para>Special thanks to Google Code-In 2011 participant Martin Gergov for
1853 writing much of this section.</para>
1854 
1855 </sect2>
1856 
1857 </sect1>
1858 
1859 <sect1 id="kate-application-plugin-projects">
1860 <!--https://kate-editor.org/2012/11/02/using-the-projects-plugin-in-kate -->
1861 
1862 <title>Project Plugin</title>
1863 
1864 <sect2 id="project-intro">
1865 <title>Introduction</title>
1866 
1867 <para>The basic idea of the Project plugin is to have a structured list of
1868 files belonging to the project with the following properties:</para>
1869 
1870 <orderedlist>
1871 <listitem><para>Provide a structured view of the files</para></listitem>
1872 <listitem><para>Make it easy and very fast to open and switch projects</para></listitem>
1873 <listitem><para>Support search and replace for a project</para></listitem>
1874 <listitem><para>Provide simple auto completion</para></listitem>
1875 <listitem><para>Make it simple to quickly open files in the project</para></listitem>
1876 <listitem><para>Support for building the project</para></listitem>
1877 </orderedlist>
1878 </sect2>
1879 
1880 <sect2 id="project-view">
1881 <title>Structured View of the Files</title>
1882 
1883 <para>Once the Project plugin is loaded in the &kate; configuration page, open a file
1884 in a project and a sidebar
1885 appears that lists all projects as well as the project files as follows:</para>
1886 
1887 <screenshot id="screenshot-project-view">
1888 <screeninfo>Project View</screeninfo>
1889 <mediaobject>
1890 <imageobject><imagedata fileref="project-view.png" format="PNG"/></imageobject>
1891 </mediaobject>
1892 </screenshot>
1893 
1894 <para>As you can see, the currently active project is <quote>Kate</quote>, and its contents is
1895 listed in the tree view. Clicking on files in the tree view opens the file in the
1896 editor. Further, a context menu is provided with which you can open files with
1897 other applications, such as a <filename class="extension">.ui</filename> file with Qt Designer.</para>
1898 <para>You can filter the items by typing parts of the file name you are looking for into the search bar
1899 at the bottom of the list.</para>
1900 </sect2>
1901 
1902 <sect2 id="project-switch">
1903 <title>Switching Projects</title>
1904 
1905 <para>The idea is that you never have to open a project manually, this is even not
1906 supported at all. Hence, what happens if you open a file, the Project plugin quickly
1907 scans the folder and its parent folders for a <filename>.kateproject</filename> file. If found, the project
1908 is automatically loaded.</para>
1909 
1910 <para>Furthermore, if you open another document in &kate;, that belongs to another project,
1911 the Project plugin automatically switches the current project. So intuitively, always the
1912 correct project is active. Of course, you can also switch the currently active project
1913 using the combo box.</para>
1914 
1915 </sect2>
1916 
1917 <sect2 id="project-search-replace">
1918 <title>Search and Replace in Projects</title>
1919 
1920 <para>&kate; has a Search and Replace plugin that shows up in the
1921 bottom sidebar. If a project is loaded, open the Search and Replace sidebar,
1922 and switch to the mode to search and replace in the current project:</para>
1923 
1924 <screenshot id="screenshot-projects-search">
1925 <screeninfo>Search in Projects</screeninfo>
1926 <mediaobject>
1927 <imageobject><imagedata fileref="project-search.png" format="PNG"/></imageobject>
1928 </mediaobject>
1929 </screenshot>
1930 
1931 </sect2>
1932 
1933 <sect2 id="project-autocompletition">
1934 <title>Simple Auto Completion</title>
1935 
1936 <para>With the knowledge of all files belonging to a project, the Project plugin provides
1937 simple auto completion facilities based on CTags. If a project is initially opened, CTags
1938 parses all project files in a background thread and saves the CTags information to
1939 <filename class="directory">/tmp</filename>. This file then is used to populate the auto
1940 completion popup in &kate;.</para>
1941 
1942 <para>In contrast, without this auto completion, &kate; is only capable of showing auto
1943 completion items based on the words in the current file. So the auto completion provided
1944 by the Project plugin is much more powerful.</para>
1945 
1946 <screenshot id="screenshot-completion-search">
1947 <screeninfo>Completion in Projects</screeninfo>
1948 <mediaobject>
1949 <imageobject><imagedata fileref="project-completition.png" format="PNG"/></imageobject>
1950 </mediaobject>
1951 </screenshot>
1952 
1953 <para>If CTags is missing, a passive popup warns you about this issue. It is also noteworthy,
1954 that the CTags file in <filename class="directory">/tmp</filename> is cleaned up when &kate;
1955 exits, so the plugin does not pollute any folder with unwanted files.</para>
1956 
1957 </sect2>
1958 
1959 <sect2 id="project-build">
1960 <title>Support for Building the Project</title>
1961 
1962 <para>Another feature is to have support for the <link linkend="projects-build-support">Build Plugin</link>,
1963 so that it automatically is configured correctly.</para>
1964 
1965 </sect2>
1966 
1967 <sect2 id="project-create">
1968 <title>Creating Projects</title>
1969 
1970 <sect3 id="project-autoload">
1971 <!--https://kate-editor.org/2014/10/12/autoloading-projects-plugin-kate-5/-->
1972 <title>Loading Projects Automatically</title>
1973 
1974 <para>The Project plugin has an auto-loading feature. You can read the file list from
1975 the version control system. To this end, auto-loading for the respective version control
1976 system needs to be enabled in the settings (enabled by default):
1977 </para>
1978 
1979 <screenshot id="screenshot-project-configure">
1980 <screeninfo>Project Plugin Configuration</screeninfo>
1981 <mediaobject>
1982 <imageobject><imagedata fileref="project-configure.png" format="PNG"/></imageobject>
1983 </mediaobject>
1984 </screenshot>
1985 
1986 </sect3>
1987 
1988 <sect3 id="project-manual">
1989 <title>Creating Projects Manually</title>
1990 <para>
1991 You just have to create a <filename>.kateproject</filename> file in the root folder of the project.
1992 For instance, the <quote>Kate</quote> <filename>.kateproject</filename> file looks like this:
1993 </para>
1994 
1995 <screen>
1996 {
1997   "name": "Kate",
1998   "files": [
1999     {
2000       "git": 1
2001     }
2002   ]
2003 }
2004 </screen>
2005 
2006 <para>The file content is written in &JSON; syntax. The project name is <quote>Kate</quote>, and
2007 the files contained in should be read from &git;.
2008 </para>
2009 
2010 <para>
2011 Also supported instead of <literal>git</literal> is subversion through <literal>svn</literal> and
2012 mercurial through <literal>hg</literal>.
2013 
2014 If you do not want to read files from a version control system, you can just invoke kate from command line as:
2015 <screen>
2016 kate /path/to/folder
2017 </screen>
2018 or you can tell it to recursively load files from directories as follows:
2019 </para>
2020 
2021 <screen>
2022 {
2023   "name": "Kate",
2024   "files": [
2025     {
2026       "directory": "kate",
2027       "filters": [
2028         "*.cpp",
2029         "*.h",
2030         "*.ui",
2031         "CMakeLists.txt",
2032         "Find*.cmake"
2033       ],
2034       "recursive": 1,
2035       "hidden": 1
2036     }
2037   ],
2038   "exclude_patterns" : [
2039     "^build/.*"
2040   ]
2041 }
2042 </screen>
2043 
2044 <para>
2045 Here, subfolders and filters define what’s part of the project.
2046 You can also mix version control and files based on filters.
2047 Hidden files will not be retrieved if the option <code>"hidden"</code> is 0.
2048 <code>"exclude_patterns"</code> is a list of regex patterns that can be used 
2049 to exclude folders and files from the project tree. In this example, All files
2050 and folders in a directory <filename>build</filename> from the root will be excluded.
2051 </para>
2052 
2053 <para id="projects-build-support">If you want to add support for the building, you can write a
2054 <filename>.kateproject</filename> like this:</para>
2055 
2056 <screen>
2057 {
2058   "name": "Kate",
2059   "files": [
2060     {
2061       "git": 1
2062     }
2063   ],
2064   "build": {
2065     "directory": "build",
2066     "build": "make all",
2067     "clean": "make clean",
2068     "install": "make install",
2069     "targets": [
2070       {
2071         "name": "all",
2072         "build_cmd": "ninja"
2073         "run_cmd": "./bin/kate"
2074       },
2075       {
2076         "name": "kate",
2077         "build_cmd": "ninja kate-bin"
2078       }
2079     ]
2080   }
2081 }
2082 </screen>
2083 
2084 <para>
2085 The targets specified above will then appear in the <link linkend="kate-application-plugin-build">Build Plugin </link> under <emphasis role="bold">
2086 "Project Plugin Targets"</emphasis>.
2087 
2088 If the <code>"targets"</code> array is specified then <code>"build"</code>, <code>"clean"</code> and <code>"install"</code> are ignored. Each element in the array specifies a target. <code>"name"</code> is the name of the target, <code>"build_cmd"</code> will be used to build the target, <code>"run_cmd"</code> will be used to run the target. Most important of all is <code>"directory"</code>, this is where the commands will be executed.
2089 
2090 </para>
2091 
2092 <para>
2093 In case you have a <filename>.kateproject</filename> file tracked by a control
2094 version system, but you need to tweak the configuration for a particular
2095 workspace, you can save those changes to a separated file named
2096 <filename>.kateproject.local</filename>. The content of this file will take
2097 precedence over <filename>.kateproject</filename>.
2098 </para>
2099 
2100 </sect3>
2101 
2102 </sect2>
2103 
2104 <sect2 id="project-current">
2105 <title>Current Project</title>
2106 
2107 <para>Using <menuchoice><shortcut><keycombo action="simul">&Alt;<keycap>1</keycap></keycombo></shortcut>
2108 <guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem></menuchoice> you can open the
2109 <guilabel>Current Project</guilabel> view at the bottom of the editor window with four tabs:</para>
2110 
2111 <screenshot id="screenshot-project-current">
2112 <screeninfo>Current Project</screeninfo>
2113 <mediaobject>
2114 <imageobject><imagedata fileref="project-current-analysis.png" format="PNG"/></imageobject>
2115 </mediaobject>
2116 </screenshot>
2117 
2118 <variablelist>
2119 
2120 <varlistentry>
2121 <term>
2122 <guimenu>Terminal Panel</guimenu>
2123 </term>
2124 <listitem>
2125 <para>A <link linkend="kate-application-plugin-konsole">Terminal emulator</link> starting in the
2126 root folder of the project.</para>
2127 </listitem>
2128 </varlistentry>
2129 
2130 <varlistentry>
2131 <term>
2132 <guimenu>Code Index</guimenu>
2133 </term>
2134 <listitem>
2135 <para>Entering characters into the search bar will start the search and display matching names
2136 of functions, classes, symbols &etc; together with kind, filename and line number.</para>
2137 <para>Select an item in the list to jump to the corresponding line in the source file.</para>
2138 </listitem>
2139 </varlistentry>
2140 
2141 <varlistentry>
2142 <term>
2143 <guimenu>Code Analysis</guimenu>
2144 </term>
2145 <listitem>
2146 <para>Click <guilabel>Start Analysis</guilabel> to run a static code analysis for the C and C++
2147 using <command>cppcheck</command> and to generate a report showing filename, line number, severity
2148 (style, warning &etc;) and the issue found.</para>
2149 <para>Select an item in the list to jump to the corresponding line in the source file.</para>
2150 </listitem>
2151 </varlistentry>
2152 <!--FIXME options for cppcheck? configurable?-->
2153 <varlistentry>
2154 <term>
2155 <guimenu>Notes</guimenu>
2156 </term>
2157 <listitem>
2158 <para>Text entered in this tab will be saved in the file
2159 <filename>.kateproject.notes</filename>.</para>
2160 </listitem>
2161 </varlistentry>
2162 
2163 </variablelist>
2164 
2165 </sect2>
2166 
2167 <sect2 id="projects-menu">
2168 <title>The Projects Menu</title>
2169 
2170 <para>The <guimenu>Projects</guimenu> menu allows you to switch between
2171 currently open projects.  It is displayed by the Project plugin.</para>
2172 
2173 <variablelist>
2174 
2175 <varlistentry id="projects-back">
2176 <term><menuchoice>
2177 <shortcut>
2178 <keycombo action="simul">&Ctrl;&Alt;&Left;</keycombo>
2179 </shortcut>
2180 <guimenu>Projects</guimenu>
2181 <guimenuitem>Back</guimenuitem>
2182 </menuchoice></term>
2183 <listitem>
2184 <para>Switch to the previous project.</para>
2185 </listitem>
2186 </varlistentry>
2187 
2188 <varlistentry id="projects-forward">
2189 <term><menuchoice>
2190 <shortcut>
2191 <keycombo action="simul">&Ctrl;&Alt;&Right;</keycombo>
2192 </shortcut>
2193 <guimenu>Projects</guimenu>
2194 <guimenuitem>Forward</guimenuitem>
2195 </menuchoice></term>
2196 <listitem>
2197 <para>Switch to the next project.</para>
2198 </listitem>
2199 </varlistentry>
2200 
2201 <varlistentry id="projects-goto">
2202 <term><menuchoice>
2203 <shortcut>
2204 <keycombo action="simul">&Alt;<keycap>1</keycap></keycombo>
2205 </shortcut>
2206 <guimenu>Projects</guimenu><guimenuitem>Go To</guimenuitem>
2207 </menuchoice></term>
2208 <listitem>
2209 <para>Open the <guilabel>Current Project</guilabel> view at the bottom of the editor window.</para>
2210 </listitem>
2211 </varlistentry>
2212 
2213 </variablelist>
2214 
2215 </sect2>
2216 <!--
2217 context menu Project->Lookup:xxx
2218 -->
2219 
2220 </sect1>
2221 
2222 <!--FIXME Replicode
2223 Projects Replicode run / stop-->
2224 
2225 <sect1 id="kate-application-plugin-lspclient">
2226 <title>LSP Client Plugin</title>
2227 
2228 <para>The LSP Client plugin provides many language features such as code completion, code navigation or finding references
2229 based on the <ulink url="https://microsoft.github.io/language-server-protocol/">Language Server Protocol</ulink>.</para>
2230 
2231 <para>Once you have enabled the LSP Client in the plugin page, a new
2232 page called LSP Client will appear in your &kate; configuration dialog.
2233 </para>
2234 
2235 <sect2 id="lspclient-menu">
2236 <title>Menu Structure</title>
2237 
2238 <para>
2239 If appropriate, a corresponding LSP command is also mentioned in the
2240 explanation below, the documentation of which may then provide additional
2241 background and interpretation, though it may vary depending on the actual
2242 language. The phrase 'current symbol' refers to the symbol corresponding to the
2243 current cursor position, as so determined by the language and server
2244 implementation.
2245 </para>
2246 
2247 <variablelist>
2248 
2249 <varlistentry id="lspclient-definition">
2250 <term><menuchoice>
2251 <guimenu>LSP Client</guimenu>
2252 <guisubmenu>Go to Definition</guisubmenu>
2253 </menuchoice></term>
2254 <listitem>
2255 <para>[textDocument/definition] Go to current symbol definition.</para>
2256 </listitem>
2257 </varlistentry>
2258 
2259 <varlistentry id="lspclient-declaration">
2260 <term><menuchoice>
2261 <guimenu>LSP Client</guimenu>
2262 <guisubmenu>Go to Declaration</guisubmenu>
2263 </menuchoice></term>
2264 <listitem>
2265 <para>[textDocument/declaration] Go to current symbol declaration.</para>
2266 </listitem>
2267 </varlistentry>
2268 
2269 <varlistentry id="lspclient-typedefinition">
2270 <term><menuchoice>
2271 <guimenu>LSP Client</guimenu>
2272 <guisubmenu>Go to Type Definition</guisubmenu>
2273 </menuchoice></term>
2274 <listitem>
2275 <para>[textDocument/typeDefinition] Go to current symbol type definition.</para>
2276 </listitem>
2277 </varlistentry>
2278 
2279 <varlistentry id="lspclient-references">
2280 <term><menuchoice>
2281 <guimenu>LSP Client</guimenu>
2282 <guisubmenu>Find References</guisubmenu>
2283 </menuchoice></term>
2284 <listitem>
2285 <para>[textDocument/references] Find references to current symbol.</para>
2286 </listitem>
2287 </varlistentry>
2288 
2289 <varlistentry id="lspclient-implementation">
2290 <term><menuchoice>
2291 <guimenu>LSP Client</guimenu>
2292 <guisubmenu>Find Implementations</guisubmenu>
2293 </menuchoice></term>
2294 <listitem>
2295 <para>[textDocument/implementation] Find implementations of current symbol.</para>
2296 </listitem>
2297 </varlistentry>
2298 
2299 <varlistentry id="lspclient-highlight">
2300 <term><menuchoice>
2301 <guimenu>LSP Client</guimenu>
2302 <guisubmenu>Highlight</guisubmenu>
2303 </menuchoice></term>
2304 <listitem>
2305 <para>[textDocument/documentHighlight] Highlight current symbol references in current document.</para>
2306 </listitem>
2307 </varlistentry>
2308 
2309 <varlistentry id="lspclient-hover">
2310 <term><menuchoice>
2311 <guimenu>LSP Client</guimenu>
2312 <guisubmenu>Hover</guisubmenu>
2313 </menuchoice></term>
2314 <listitem>
2315 <para>[textDocument/hover] Hover info for current symbol.</para>
2316 </listitem>
2317 </varlistentry>
2318 
2319 <varlistentry id="lspclient-format">
2320 <term><menuchoice>
2321 <guimenu>LSP Client</guimenu>
2322 <guisubmenu>Format</guisubmenu>
2323 </menuchoice></term>
2324 <listitem>
2325 <para>[textDocument/formatting] [textDocument/rangeFormatting]
2326 Format the current document or current selection.</para>
2327 </listitem>
2328 </varlistentry>
2329 
2330 <varlistentry id="lspclient-rename">
2331 <term><menuchoice>
2332 <guimenu>LSP Client</guimenu>
2333 <guisubmenu>Rename</guisubmenu>
2334 </menuchoice></term>
2335 <listitem>
2336 <para>[textDocument/rename] Rename current symbol.</para>
2337 </listitem>
2338 </varlistentry>
2339 
2340 <varlistentry id="lspclient-quick-fix">
2341 <term><menuchoice>
2342 <guimenu>LSP Client</guimenu>
2343 <guisubmenu>Quick Fix</guisubmenu>
2344 </menuchoice></term>
2345 <listitem>
2346 <para>[textDocument/codeAction, workspace/executeCommand]
2347 Computes and applies a quick fix for a diagnostic on current position (or line).</para>
2348 </listitem>
2349 </varlistentry>
2350 
2351 <varlistentry id="lspclient-completion-documentation">
2352 <term><menuchoice>
2353 <guimenu>LSP Client</guimenu>
2354 <guisubmenu>Show selected completion documentation</guisubmenu>
2355 </menuchoice></term>
2356 <listitem>
2357 <para>Show documentation for a selected item in the completion list.</para>
2358 </listitem>
2359 </varlistentry>
2360 
2361 <varlistentry id="lspclient-signature-help">
2362 <term><menuchoice>
2363 <guimenu>LSP Client</guimenu>
2364 <guisubmenu>Enable signature help with auto completion</guisubmenu>
2365 </menuchoice></term>
2366 <listitem>
2367 <para>Also show signature help in the completion list.</para>
2368 </listitem>
2369 </varlistentry>
2370 
2371 <varlistentry id="lspclient-declaration-references">
2372 <term><menuchoice>
2373 <guimenu>LSP Client</guimenu>
2374 <guisubmenu>Include declaration in references</guisubmenu>
2375 </menuchoice></term>
2376 <listitem>
2377 <para>Request to include a symbol's declaration when requesting references.</para>
2378 </listitem>
2379 </varlistentry>
2380 
2381 <varlistentry id="lspclient-completion-parens">
2382 <term><menuchoice>
2383 <guimenu>LSP Client</guimenu>
2384 <guisubmenu>Add parentheses upon function completion</guisubmenu>
2385 </menuchoice></term>
2386 <listitem>
2387 <para>Automatically add a pair of parentheses after completion of a function.</para>
2388 </listitem>
2389 </varlistentry>
2390 
2391 <varlistentry id="lspclient-show-hover">
2392 <term><menuchoice>
2393 <guimenu>LSP Client</guimenu>
2394 <guisubmenu>Show hover information</guisubmenu>
2395 </menuchoice></term>
2396 <listitem>
2397 <para>Show hover information upon (mouse cursor) hover.
2398 Regardless of this setting, the request can always be manually initiated.
2399 </para>
2400 </listitem>
2401 </varlistentry>
2402 
2403 <varlistentry id="lspclient-format-typing">
2404 <term><menuchoice>
2405 <guimenu>LSP Client</guimenu>
2406 <guisubmenu>Format on typing</guisubmenu>
2407 </menuchoice></term>
2408 <listitem>
2409 <para>[document/onTypeFormatting] Format parts of document when typing certain trigger characters.
2410 For example, this might apply indentation upon newline, or as otherwise determined by LSP Server.
2411 Note that editor indentation scripts might be trying to do the same (depending on the mode)
2412 and so it may not be advisable to have both enabled at the same time.
2413 </para>
2414 </listitem>
2415 </varlistentry>
2416 
2417 <varlistentry id="lspclient-incremental-sync">
2418 <term><menuchoice>
2419 <guimenu>LSP Client</guimenu>
2420 <guisubmenu>Incremental document synchronization</guisubmenu>
2421 </menuchoice></term>
2422 <listitem>
2423 <para>Send partial document edits to update the server rather than whole document text (if supported).</para>
2424 </listitem>
2425 </varlistentry>
2426 
2427 <varlistentry id="lspclient-highlight-goto">
2428 <term><menuchoice>
2429 <guimenu>LSP Client</guimenu>
2430 <guisubmenu>Highlight goto location</guisubmenu>
2431 </menuchoice></term>
2432 <listitem>
2433 <para>Provide a transient visual cue after performing a goto to a location (of definition, declaration, etc).</para>
2434 </listitem>
2435 </varlistentry>
2436 
2437 <varlistentry id="lspclient-diagnostics">
2438 <term><menuchoice>
2439 <guimenu>LSP Client</guimenu>
2440 <guisubmenu>Show diagnostics notifications</guisubmenu>
2441 </menuchoice></term>
2442 <listitem>
2443 <para>[textDocument/publishDiagnostics] Process and show diagnostics notifications sent by server.</para>
2444 </listitem>
2445 </varlistentry>
2446 
2447 <varlistentry id="lspclient-diagnostics-highlight">
2448 <term><menuchoice>
2449 <guimenu>LSP Client</guimenu>
2450 <guisubmenu>Show diagnostics highlights</guisubmenu>
2451 </menuchoice></term>
2452 <listitem>
2453 <para>Add text highlights for ranges indicated in diagnostics.</para>
2454 </listitem>
2455 </varlistentry>
2456 
2457 <varlistentry id="lspclient-diagnostics-marks">
2458 <term><menuchoice>
2459 <guimenu>LSP Client</guimenu>
2460 <guisubmenu>Show diagnostics marks</guisubmenu>
2461 </menuchoice></term>
2462 <listitem>
2463 <para>Add document marks for lines indicated in diagnostics.</para>
2464 </listitem>
2465 </varlistentry>
2466 
2467 <varlistentry id="lspclient-diagnostics-tab">
2468 <term><menuchoice>
2469 <guimenu>LSP Client</guimenu>
2470 <guisubmenu>Switch to diagnostic tab</guisubmenu>
2471 </menuchoice></term>
2472 <listitem>
2473 <para>Switch to the diagnostic tab in the plugin toolview.</para>
2474 </listitem>
2475 </varlistentry>
2476 
2477 <varlistentry id="lspclient-close-non-diagnostics">
2478 <term><menuchoice>
2479 <guimenu>LSP Client</guimenu>
2480 <guisubmenu>Close all non-diagnostics tabs</guisubmenu>
2481 </menuchoice></term>
2482 <listitem>
2483 <para>Close all non-diagnostics (&eg; references) tabs in plugin toolview.</para>
2484 </listitem>
2485 </varlistentry>
2486 
2487 <varlistentry id="lspclient-restart">
2488 <term><menuchoice>
2489 <guimenu>LSP Client</guimenu>
2490 <guisubmenu>Restart LSP Server</guisubmenu>
2491 </menuchoice></term>
2492 <listitem>
2493 <para>Restart current document's LSP Server.</para>
2494 </listitem>
2495 </varlistentry>
2496 
2497 <varlistentry id="lspclient-restart-all">
2498 <term><menuchoice>
2499 <guimenu>LSP Client</guimenu>
2500 <guisubmenu>Restart all LSP Servers</guisubmenu>
2501 </menuchoice></term>
2502 <listitem>
2503 <para>Stop all LSP Servers which will then be (re)started as needed.</para>
2504 </listitem>
2505 </varlistentry>
2506 
2507 </variablelist>
2508 
2509 </sect2>
2510 
2511 <sect2 id="lspclient-go-to-symbol">
2512 <title>Goto Symbol support</title>
2513 <para>
2514 LSP Client can help you jump to any symbol in your project or current file.
2515 
2516 To jump to any symbol in the file, use the toolview "LSP Client Symbol Outline"
2517 on the right border of kate. This toolview lists all symbols found by the server
2518 in current document.
2519 </para>
2520 
2521 <sect3 id="lspclient-symbol-outline-config">
2522 <title>Configuring LSP Client Symbol Outline</title>
2523 
2524 <para>
2525 By default the symbols are sorted by their occurrence in the
2526 document but you can change the sort to be alphabetical. To do so, right click in
2527 the toolview and check "Sort Alphabetically".
2528 </para>
2529 
2530 <para>
2531 The toolview shows the symbols in tree mode by default, however you can change it to a list using the
2532 context menu.
2533 </para>
2534 </sect3>
2535 
2536 <sect3 id="lspclient-global-go-to-symbol">
2537 <title>Global Goto symbol support</title>
2538 <para>
2539 To jump to any symbol in your project, you can open the goto symbol dialog using
2540 <keycombo action="simul">&Ctrl;&Alt;<keycap>p</keycap></keycombo>.
2541 The dialog is empty when it opens but as soon as you type something the dialog will start showing
2542 you matching symbols. The quality of matches as well as filtering capabilities depend upon the server
2543 that you use. For example, clangd supports fuzzy filtering but some other server may not.
2544 </para>
2545 </sect3>
2546 
2547 </sect2>
2548 
2549 <sect2 id="lspclient-extra">
2550 <title>Other Features</title>
2551 
2552 <para>
2553 Clangd switch source header command is supported. To switch source header in a C or C++ project either use the "Switch Source Header"
2554 option from the context menu or the shortcut <keycombo action="simul"><keycap>F12</keycap></keycombo>.
2555 </para>
2556 
2557 <para>
2558 You can jump to a symbol quickly by putting your mouse over the symbol and then pressing
2559 <keycombo action="simul">&Ctrl;</keycombo> + left mouse button.
2560 </para>
2561 
2562 </sect2>
2563 
2564 <sect2 id="lspclient-configuration">
2565 <title>Configuration</title>
2566 
2567 <para>
2568 The plugin's configuration page mostly allows for persistent configuration of
2569 some of the above menu items.  However, there is one additional entry
2570 to specify the Server Configuration file.  This is a &JSON; file that
2571 can be used to specify the LSP server to start (and then to communicate
2572 with over stdin/stdout).  For convenience, some default configuration
2573 is included, which can be inspected in the plugin's configuration page.
2574 To aid in the explanation below, an excerpt of that configuration is given here:
2575 </para>
2576 
2577 <screen>
2578 {
2579     "servers": {
2580         "bibtex": {
2581             "use": "latex",
2582             "highlightingModeRegex": "^BibTeX$"
2583         },
2584         "c": {
2585             "command": ["clangd", "-log=error", "--background-index"],
2586             "commandDebug": ["clangd", "-log=verbose", "--background-index"],
2587             "url": "https://clang.llvm.org/extra/clangd/",
2588             "highlightingModeRegex": "^(C|ANSI C89|Objective-C)$"
2589         },
2590         "cpp": {
2591             "use": "c",
2592             "highlightingModeRegex": "^(C\\+\\+|ISO C\\+\\+|Objective-C\\+\\+)$"
2593         },
2594         "d": {
2595             "command": ["dls", "--stdio"],
2596             "url": "https://github.com/d-language-server/dls",
2597             "highlightingModeRegex": "^D$"
2598         },
2599         "fortran": {
2600             "command": ["fortls"],
2601             "rootIndicationFileNames": [".fortls"],
2602             "url": "https://github.com/hansec/fortran-language-server",
2603             "highlightingModeRegex": "^Fortran.*$"
2604         },
2605         "javascript": {
2606             "command": ["typescript-language-server", "--stdio"],
2607             "rootIndicationFileNames": ["package.json", "package-lock.json"],
2608             "url": "https://github.com/theia-ide/typescript-language-server",
2609             "highlightingModeRegex": "^JavaScript.*$",
2610             "documentLanguageId": false
2611         },
2612         "latex": {
2613             "command": ["texlab"],
2614             "url": "https://texlab.netlify.com/",
2615             "highlightingModeRegex": "^LaTeX$"
2616         },
2617         "go": {
2618             "command": ["go-langserver"],
2619             "commandDebug": ["go-langserver", "-trace"],
2620             "url": "https://github.com/sourcegraph/go-langserver",
2621             "highlightingModeRegex": "^Go$"
2622         },
2623         "python": {
2624             "command": ["python3", "-m", "pyls", "--check-parent-process"],
2625             "url": "https://github.com/palantir/python-language-server",
2626             "highlightingModeRegex": "^Python$"
2627         },
2628         "rust": {
2629             "command": ["rls"],
2630             "path": ["%{ENV:HOME}/.cargo/bin", "%{ENV:USERPROFILE}/.cargo/bin"],
2631             "rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
2632             "url": "https://github.com/rust-lang/rls",
2633             "highlightingModeRegex": "^Rust$"
2634         },
2635         "ocaml": {
2636             "command": ["ocamlmerlin-lsp"],
2637             "url": "https://github.com/ocaml/merlin",
2638             "highlightingModeRegex": "^Objective Caml.*$"
2639         }
2640     }
2641 }
2642 </screen>
2643 
2644 <para>
2645 Note that each "command" may be an array or a string (in which case it is
2646 split into an array). Also, a top-level "global" entry (next to "server") is
2647 considered as well (see further below).
2648 The specified binary is searched for in the usual way, e.g. using <literal>PATH</literal>.
2649 If it is installed in some custom location, then the latter may have to be
2650 extended.  Or alternatively, a (sym)link or wrapper script may be used in a location
2651 that is within the usual <literal>PATH</literal>.  As illustrated above,
2652 one may also specify a "path" that will be searched for after the standard locations.
2653 </para>
2654 
2655 <para>
2656 All of the entries in "command", "root" and "path" are subject to variable expansion.
2657 </para>
2658 
2659 <para>
2660 The "highlightingModeRegex" is used to map the highlighting mode as used by &kate;
2661 to the language id of the server. If no regular expression is given, the language id
2662 itself is used.  If a "documentLanguageId" entry is set to false, then no
2663 language id is provided to the server when opening the document.  This may
2664 have better results for some servers that are more precise in determining
2665 the document type than doing so based on a kate mode.
2666 </para>
2667 
2668 <para>
2669 From the above example, the gist is presumably clear.  In addition, each server
2670 entry object may also have an "initializationOptions" entry, which is passed
2671 along to the server as part of the 'initialize' method.
2672 If present, a "settings" entry is passed to the server by means of the
2673 'workspace/didChangeConfiguration' notification.
2674 Either of "completionTriggerCharacters" or "signatureTriggerCharacters" may be
2675 specified as a JSON object with string members "exclude" and/or "include".
2676 These will be used to respectively exclude or add some characters to
2677 the respective trigger set as provided by the server.
2678 </para>
2679 
2680 <para>
2681 Various stages of override/merge are applied;
2682 <itemizedlist>
2683 <listitem>
2684 <para>user configuration (loaded from file) overrides (internal) default configuration</para>
2685 </listitem>
2686 <listitem>
2687 <para>"lspclient" entry in <filename>.kateproject</filename> project configuration overrides the above</para>
2688 </listitem>
2689 <listitem>
2690 <para>the resulting "global" entry is used to supplement (not override) any server entry</para>
2691 </listitem>
2692 </itemizedlist>
2693 </para>
2694 
2695 <para> One server instance is used per (root, servertype) combination. If "root"
2696 is specified as an absolute path, then it used as-is, otherwise it is relative
2697 to the <quote>projectBase</quote> (as determined by the <link
2698 linkend="kate-application-plugin-projects">Project plugin</link>) if applicable,
2699 or otherwise relative to the document's directory. If not specified and
2700 "rootIndicationFileNames" is an array as filenames, then a parent directory of
2701 current document containing such a file is selected.
2702 Alternatively, if "root" is not specified and "rootIndicationFilePatterns" is
2703 an array of file patterns, then a parent directory of the current document
2704 matching the file pattern is selected. As a last fallback, the
2705 home directory is selected as "root". For any document, the resulting "root"
2706 then determines whether or not a separate instance is needed. If so, the "root"
2707 is passed as rootUri/rootPath. </para>
2708 
2709 <para>
2710 In general, it is recommended to leave root unspecified, as it is not that
2711 important for a server (your mileage may vary though).  Fewer server instances
2712 are obviously more efficient, and they also have a 'wider' view than
2713 the view of many separate instances.
2714 </para>
2715 
2716 <para>
2717 As mentioned above, several entries are subject to variable expansion.
2718 A suitable application of that combined with "wrapper script" approaches
2719 allows for customization to a great many circumstances.
2720 For example, consider a python development scenario that consists of multiple
2721 projects (e.g. git repos), each with its own virtualenv setup.  Using the default
2722 configuration, the python language server will not be aware of the virtual env.
2723 However, that can be remedied with the following approach.  First, the following
2724 fragment can be entered in LSPClient plugin's "User Server Settings":
2725 </para>
2726 <screen>
2727 {
2728         "servers":
2729         {
2730                 "python":
2731                 {
2732                         "command": ["pylsp_in_env", "%{Project:NativePath}"],
2733                         "root": "."
2734                 }
2735         }
2736 }
2737 </screen>
2738 <para>
2739 The root entry above is relative to the project directory and ensures that a
2740 separate language server is started for each project, which is necessary in
2741 this case as each has a distinct virtual environment.
2742 </para>
2743 <para>
2744 <filename>pylsp_in_env</filename> is a small "wrapper script" that should be placed
2745 in <literal>PATH</literal> with the following (to-be-adjusted) content:
2746 </para>
2747 <screen>
2748 #!/bin/bash
2749 cd $1
2750 # run the server (python-lsp-server) within the virtualenv
2751 # (i.e. with virtualenv variables setup)
2752 # so source the virtualenv
2753 source XYZ
2754 # server mileage or arguments may vary
2755 exec myserver
2756 </screen>
2757 
2758 
2759 <sect3 id="lspclient-customization">
2760 <title>LSP Server Configuration</title>
2761 
2762 <para>
2763 
2764 Each particular LSP server has its own way of customization and may use
2765 language/tool specific means for configuration, &eg;
2766 <filename>tox.ini</filename> (a.o. for python),
2767 <filename>.clang-format</filename> for C++ style format. Such configuration may
2768 then also be used by other (non-LSP) tools (such as then
2769 <application>tox</application> or <application>clang-format</application>). On
2770 top of that, some LSP servers also load configuration from custom files (&eg;
2771 <filename>.ccls</filename>). Furthermore, custom server configuration can also
2772 be passed through LSP (protocol), see the aforementioned
2773 "initializationOptions" and "settings" entries in server configuration.
2774 
2775 </para>
2776 
2777 <para>
2778 Since various level of override/merge are applied, the following example
2779 of user specified client configuration tweaks some python-language-server
2780 configuration.
2781 </para>
2782 
2783 <screen>
2784 {
2785     "servers": {
2786         "python": {
2787             "settings": {
2788                 "pyls": {
2789                     "plugins": {
2790                         "pylint": {
2791                             "enable": true
2792                         }
2793                     }
2794                 }
2795             }
2796         }
2797     }
2798 }
2799 </screen>
2800 
2801 <para>
2802 Unfortunately, LSP server configuration/customization is often not so well
2803 documented, in ways that only examining the source code shows configuration
2804 approaches and the set of available configuration options.  In particular,
2805 the above example's server supports many more options in "settings".
2806 See <ulink url="https://github.com/neoclide/coc.nvim/wiki/Language-servers">
2807 another LSP client's documentation</ulink> for various other language server
2808 examples and corresponding settings, which can easily and readily be
2809 transformed to the &JSON; configuration that is used here and outlined above.
2810 </para>
2811 
2812 </sect3>
2813 
2814 <sect3 id="lspclient-format-on-save">
2815 <title>LSP Server Format On Save</title>
2816 
2817 <para>
2818 You can enable "format on save" from LSP settings in configure dialog.
2819 </para>
2820 
2821 </sect3>
2822 
2823 <sect3 id="lspclient-diagnostics-suppression">
2824 <title>LSP Server Diagnostic Suppression</title>
2825 
2826 <para>
2827 It may happen that diagnostics are reported which are not quite useful.
2828 This can be quite cumbersome, especially if there are many (often of the same
2829 kind). In some cases, this may be tweaked by language (server) specific means.
2830 For example, the <ulink url="https://clangd.llvm.org/config.html">clangd
2831 configuration  mechanism</ulink> allows tweaking of some diagnostics aspects. In
2832 general, however, it may not always be evident how to do so, or it may not even
2833 be possible at all in desired ways due to server limitations or bug.
2834 </para>
2835 
2836 <para>
2837 As such, the plugin supports diagnostics suppression similar to e.g. valgrind
2838 suppressions. The most fine-grained configuration can be supplied in a
2839 "suppressions" key in the (merged) &JSON; configuration.
2840 </para>
2841 
2842 <screen>
2843 {
2844     "servers": {
2845         "c": {
2846             "suppressions": {
2847                 "rulename": ["filename", "foo"],
2848                 "clang_pointer": ["", "clang-tidy", "clear_pointer"],
2849             }
2850         }
2851     }
2852 }
2853 </screen>
2854 
2855 <para>
2856 Each (valid) rule has an arbitrary name and is defined by an array of length
2857 2 or 3 which provides a regex to match against the (full) filename, a regex
2858 to match against the diagnostic (text) and an optional regex matched against
2859 the (source code range of) text to which the diagnostic applies.
2860 </para>
2861 
2862 <para>
2863 In addition to the above fine-grained configuration, the context menu in the
2864 diagnostics tab also supports add/remove of suppressions that match a particular
2865 diagnostic (text) exactly, either globally (any file) or locally (the specific
2866 file in question).  These suppression are stored in and loaded from session config.
2867 </para>
2868 
2869 </sect3>
2870 
2871 <sect3 id="lspclient-troubleshooting">
2872 <title>LSP Server Troubleshooting</title>
2873 
2874 <para>
2875 It is one thing to describe how to configure a (custom) LSP server for
2876 any particular language, it is another to end up with the server running
2877 smoothly. Usually, the latter is fortunately the case.  Sometimes, however,
2878 problems may arise due to either some "silly" misconfiguration or a more
2879 fundamental problem with the server itself.  The latter might typically manifest
2880 itself as a couple of attempts at starting the server, as so reported in &kate;
2881 Output tab. The latter, however, is only meant to convey high-level messages or
2882 progress rather than to provide detailed diagnostics, and even less so for what
2883 is in fact another process (the LSP server).
2884 </para>
2885 
2886 <para>
2887 The usual way to diagnose this is to add some flag(s) to the startup
2888 command (of the language server) that enables (additional) logging (to
2889 some file or standard error), in as far as it does not do so by default. If
2890 &kate; is then started on the command line, then one might be able to obtain
2891 more (in)sight in what might be going wrong.
2892 </para>
2893 
2894 <para>
2895 It may also be informative to examine the protocol exchange between &kate;'s
2896 LSP client and the LSP server.  Again, the latter usually has ways to trace
2897 that.  The LSP client also provides additional debug tracing (to stderr)
2898 when &kate; is invoked with the following
2899 <literal>QT_LOGGING_RULES=katelspclientplugin=true</literal> suitably
2900 <literal>export</literal>'ed.
2901 </para>
2902 
2903 </sect3>
2904 
2905 </sect2>
2906 
2907 <!--TODO: Supported languages, describe features and actions a bit -->
2908 
2909 <!--<screenshot id="screenshot-rust-configuration">
2910 <screeninfo>Rust Configuration</screeninfo>
2911 <mediaobject>
2912 <imageobject><imagedata fileref="rust-configuration.png" format="PNG"/></imageobject>
2913 </mediaobject>
2914 </screenshot>
2915 
2916 <para>Edit the command to run <ulink url="https://github.com/phildawes/racer">Racer</ulink>,
2917 an utility intended to provide Rust code completion for editors.</para>
2918 
2919 <para>You also need the Rust source code and have to provide the path to the source tree.
2920 </para>
2921 
2922 <para>While typing code a popup list appears with items for completion:
2923 </para>
2924 
2925 <screenshot id="screenshot-rust-completion">
2926 <screeninfo>Rust Completion</screeninfo>
2927 <mediaobject>
2928 <imageobject><imagedata fileref="rust-completion.png" format="PNG"/></imageobject>
2929 </mediaobject>
2930 </screenshot>
2931 
2932 <para>In addition to code completion popups, the plugin also installs
2933 a <guimenuitem>Go to Definition</guimenuitem> action in the <guimenu>Edit</guimenu> menu and
2934 in the context menu. You can configure a keyboard shortcut for it as well.
2935 </para>
2936 
2937 <para>This action will open the document containing the definition if needed, activate
2938 its view and place the cursor at the start of the definition.
2939 </para>-->
2940 
2941 </sect1>
2942 
2943 <sect1 id="kate-application-plugin-searchinfiles">
2944 <sect1info>
2945 <authorgroup><author>
2946 &TC.Hollingsworth; &TC.Hollingsworth.mail;
2947 </author></authorgroup>
2948 </sect1info>
2949 <title>Search &amp; Replace</title>
2950 
2951 <sect2 id="searchinfiles-intro">
2952 <title>Introduction</title>
2953 <para>&kate;'s Search &amp; Replace plugin allows you to search for text or
2954 <ulink url="help:/katepart/regular-expressions.html">regular expressions</ulink>
2955 in many different files at once.  You can search all open files, all the files
2956 in one directory and optionally its subdirectories, or in the active file.
2957 You can even filter by filename, for instance searching only files
2958 that end with a particular file extension.</para>
2959 
2960 </sect2>
2961 
2962 <sect2 id="searchinfiles-ui">
2963 <title>Interface</title>
2964 
2965 <sect3 id="searchinfiles-ui-query">
2966 <title>Search Query</title>
2967 
2968 <para>The following options are always displayed at the top of the Search in
2969 Files tool view:</para>
2970 
2971 <variablelist>
2972 
2973 <varlistentry>
2974 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="tab-new-22.png" format="PNG"/>
2975 </imageobject></inlinemediaobject></guiicon></term>
2976 <listitem><para>
2977 You can have as many searches as you want open at the same time.  Simply click
2978 the new tab button at the top-left corner of the Search
2979 tool view and a new results tab will open permitting you to perform another
2980 search.
2981 </para></listitem>
2982 </varlistentry>
2983 
2984 <varlistentry>
2985 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
2986 </imageobject></inlinemediaobject></guiicon></term>
2987 <listitem><para>
2988 The button in the top right-corner of the Search in Files tool view will
2989 toggle the bottom half of the tool view between displaying additional options
2990 for the Search in Folder mode and the results of your search.
2991 </para></listitem>
2992 </varlistentry>
2993 
2994 <varlistentry>
2995 <term><guilabel>Find</guilabel></term>
2996 <listitem><para>
2997 This is where you type in what you want to find.  You may enter standard text,
2998 or a regular expression if enabled.
2999 </para></listitem>
3000 </varlistentry>
3001 
3002 <varlistentry>
3003 <term><guilabel>Replace</guilabel> (text box)</term>
3004 <listitem><para>
3005 Replacement text that will be added to file(s) in place of the text in the
3006 <guilabel>Find</guilabel> text box.
3007 </para></listitem>
3008 </varlistentry>
3009 
3010 <varlistentry>
3011 <term><guibutton>Search</guibutton></term>
3012 <listitem><para>
3013 When you've finished configuring everything, just press the
3014 <guibutton>Search</guibutton> button to perform your search.  You may also press
3015 &Enter; in the <guilabel>Find</guilabel> text box to do the same.
3016 </para></listitem>
3017 </varlistentry>
3018 
3019 <varlistentry>
3020 <term><guibutton>Replace</guibutton></term>
3021 <listitem><para>
3022 When you've finished configuring everything, just press the
3023 <guibutton>Replace</guibutton> button to replace the text entered in the
3024 <guilabel>Find</guilabel> text box with that of the <guilabel>Replace</guilabel>
3025 text box.  You may also press &Enter; in the <guilabel>Replace</guilabel> text
3026 box to do the same.
3027 </para></listitem>
3028 </varlistentry>
3029 
3030 <varlistentry>
3031 <term><guibutton>Next</guibutton></term>
3032 <listitem><para>
3033 Go to the next match of your search query, switching files if necessary.
3034 </para></listitem>
3035 </varlistentry>
3036 
3037 <varlistentry>
3038 <term><guibutton>Replace Checked</guibutton></term>
3039 <listitem><para>
3040 The same as <guibutton>Replace</guibutton>, but will only perform replacements
3041 in files that are checked in the pane below.
3042 </para></listitem>
3043 </varlistentry>
3044 
3045 </variablelist>
3046 </sect3>
3047 
3048 <sect3 id="searchinfiles-ui-folder">
3049 <title>Search in Folder Options</title>
3050 
3051 <para>These options are displayed below the aforementioned query options. If search
3052 results are being displayed instead, press the <guiicon><inlinemediaobject><imageobject>
3053 <imagedata fileref="games-config-options-22.png" format="PNG"/></imageobject></inlinemediaobject></guiicon>
3054 button to display them.</para>
3055 
3056 <variablelist>
3057 
3058 <varlistentry>
3059 <term><guilabel>Search in</guilabel></term>
3060 <listitem><para>
3061 This has three options.  Select <guilabel>Open Files</guilabel> to search all
3062 files currently open in &kate;.  Select <guilabel>Folder</guilabel> to
3063 search inside a folder and optionally its subfolders.  Select <guilabel>Current
3064 File</guilabel> to search only in the active file.
3065 </para>
3066 <para>If the <guilabel>Projects</guilabel> plugin is loaded, you can also search in
3067 the <guilabel>Current Project</guilabel> or in <guilabel>All Open Projects</guilabel>.
3068 </para>
3069 </listitem>
3070 </varlistentry>
3071 
3072 <varlistentry>
3073 <term><guilabel>Match case</guilabel></term>
3074 <listitem><para>
3075 Restricts search results to only those that have the exact same combination
3076 of upper and lower case letters as your search query.
3077 </para></listitem>
3078 </varlistentry>
3079 
3080 <varlistentry>
3081 <term><guilabel>Regular expressions</guilabel></term>
3082 <listitem><para>
3083 Permits you to use <ulink url="help:/katepart/regular-expressions.html">regular
3084 expressions</ulink> instead of simple text as your search query.
3085 </para></listitem>
3086 </varlistentry>
3087 
3088 <varlistentry>
3089 <term><guilabel>Expand results</guilabel></term>
3090 <listitem><para>
3091 Display all the results found in each file, instead of just a list of files
3092 that contain the search query.
3093 </para></listitem>
3094 </varlistentry>
3095 
3096 <varlistentry>
3097 <term><guilabel>Folder</guilabel></term>
3098 <listitem><para>
3099 You may enter the path of the folder you wish to search.  For instance, you might
3100 enter <userinput>~/development/kde/kate/</userinput> if you wished to search the
3101 &kate; source code.  This option is only available when using
3102 <guilabel>in Folder</guilabel> mode.
3103 </para></listitem>
3104 </varlistentry>
3105 
3106 <varlistentry>
3107 <term><guiicon>Open file dialog</guiicon></term>
3108 <listitem><para>
3109 Press this button to locate the folder in your desktop's folder browser. This
3110 button only works when using <guilabel>Folder</guilabel> mode.
3111 </para></listitem>
3112 </varlistentry>
3113 
3114 <varlistentry>
3115 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="go-up-22.png" format="PNG"/>
3116 </imageobject></inlinemediaobject></guiicon></term>
3117 <listitem><para>
3118 Press this button to change <guilabel>Folder</guilabel> to the parent of the
3119 currently selected folder. This button only works when using
3120 <guilabel>Folder</guilabel> mode.
3121 </para></listitem>
3122 </varlistentry>
3123 
3124 <varlistentry>
3125 <term><guiicon><inlinemediaobject><imageobject><imagedata fileref="view-refresh-22.png" format="PNG"/>
3126 </imageobject></inlinemediaobject></guiicon></term>
3127 <listitem><para>
3128 This button will set the <guilabel>Folder</guilabel> entry to the folder in which
3129 the currently open document is located. This button only works when using
3130 <guilabel>Folder</guilabel> mode.
3131 </para></listitem>
3132 </varlistentry>
3133 
3134 <varlistentry>
3135 <term><guilabel>Filter</guilabel></term>
3136 <listitem><para>
3137 This permits you to only search filenames that match a particular pattern. For
3138 instance, to only search files written in C++, change it to
3139 <userinput>*.cpp</userinput>.  To search only files beginning with
3140 <literal>kate</literal>, change it to <userinput>kate*</userinput>. You can
3141 enter multiple filters separated with a comma (<userinput>,</userinput>). This
3142 option is not available when using <guilabel>Open files</guilabel> mode.
3143 </para></listitem>
3144 </varlistentry>
3145 
3146 <varlistentry>
3147 <term><guilabel>Exclude</guilabel></term>
3148 <listitem><para>
3149 The opposite of <guilabel>Filter</guilabel>, this prevents &kate; from
3150 searching files that match the specified patterns. As with
3151 <guilabel>Filter</guilabel>, you can enter multiple patterns separated with a
3152 comma (<userinput>,</userinput>). This option is not available when using
3153 <guilabel>Open files</guilabel> mode.
3154 </para></listitem>
3155 </varlistentry>
3156 
3157 <varlistentry>
3158 <term><guilabel>Recursive</guilabel></term>
3159 <listitem><para>
3160 If this option is enabled, &kate; will also search in all subfolders of the
3161 selected folder. This option is only available when using
3162 <guilabel>Folder</guilabel> mode.
3163 </para></listitem>
3164 </varlistentry>
3165 
3166 <varlistentry>
3167 <term><guilabel>Include hidden</guilabel></term>
3168 <listitem><para>
3169 If this option is enabled, &kate; will also search in files or folders that
3170 are typically hidden by your &OS;. This option is only available when using
3171 <guilabel>Folder</guilabel> mode.
3172 </para></listitem>
3173 </varlistentry>
3174 
3175 <varlistentry>
3176 <term><guilabel>Follow symbolic links</guilabel></term>
3177 <listitem><para>
3178 The Search in Files plugin typically does not follow
3179 <ulink url="https://en.wikipedia.org/wiki/Symbolic_link">symbolic links</ulink>.
3180 When this option is enabled, the plugin will follow them instead and search inside
3181 the files or folders they reference. This option is only available when using
3182 <guilabel>Folder</guilabel> mode.
3183 </para>
3184 <warning><para>It's possible for symbolic links to reference a folder that is the
3185 parent of the folder currently being searched, or other folders that contain
3186 symbolic links to their parent.  If there is such a link in the folder being
3187 searched and this option is enabled, &kate; will repeatedly follow the link
3188 and search the folder, and the search will never complete.</para></warning>
3189 </listitem>
3190 </varlistentry>
3191 
3192 <varlistentry>
3193 <term><guilabel>Include binary files</guilabel></term>
3194 <listitem><para>
3195 If enabled, &kate; will also search in files that do not appear to be text
3196 files.
3197 </para></listitem>
3198 </varlistentry>
3199 
3200 </variablelist>
3201 </sect3>
3202 
3203 <sect3 id="searchinfiles-ui-results">
3204 <title>Search Results</title>
3205 
3206 <para>The results of your search are displayed below the query options.  If
3207 options for Search in Folder mode are displayed, simply press the
3208 <guiicon><inlinemediaobject><imageobject><imagedata fileref="games-config-options-22.png" format="PNG"/>
3209 </imageobject></inlinemediaobject></guiicon>
3210 button to display them.  They will also
3211 automatically be displayed as soon as a search is performed.</para>
3212 
3213 <para>The search results display a list of files that contains text that matches
3214 your search query, followed by the number of matches found in that file.</para>
3215 
3216 <para>To see a list of matches in that file, simply click the expansion arrow
3217 to the left of the file name.  (If you selected the <guilabel>Expand
3218 results</guilabel> option, this will already be done for you.)  The line number
3219 each match is found on will be displayed, followed by the contents of that line,
3220 with your search query indicated in bold text.</para>
3221 
3222 <para>To open the file your result was found in, simply double-click it.  &kate;
3223 will open the file if needed.  You can also move the cursor to the location of
3224 a particular match by double-clicking on its listing instead of the file name.
3225 </para>
3226 
3227 </sect3>
3228 </sect2>
3229 
3230 <sect2 id="searchinfiles-menu">
3231 <title>Menu Structure</title>
3232 
3233 <variablelist>
3234 
3235 <varlistentry id="edit-searchinfiles">
3236 <term><menuchoice>
3237 <shortcut>
3238 <keycombo action="simul">&Ctrl;&Alt;<keycap>F</keycap></keycombo>
3239 </shortcut>
3240 <guimenu>Edit</guimenu>
3241 <guimenuitem>Search in Files</guimenuitem>
3242 </menuchoice></term>
3243 <listitem>
3244 <para>Launches the Search and Replace tool view.</para>
3245 </listitem>
3246 </varlistentry>
3247 
3248 <varlistentry id="edit-next-match">
3249 <term><menuchoice>
3250 <guimenu>Edit</guimenu>
3251 <guimenuitem>Go to Next Match</guimenuitem>
3252 </menuchoice></term>
3253 <listitem>
3254 <para>Go to the next match in a search performed by the Search and Replace
3255 plugin.</para>
3256 </listitem>
3257 </varlistentry>
3258 
3259 <varlistentry id="edit-previous-match">
3260 <term><menuchoice>
3261 <guimenu>Edit</guimenu>
3262 <guimenuitem>Go to Previous Match</guimenuitem>
3263 </menuchoice></term>
3264 <listitem>
3265 <para>Go to the previous match in a search performed by the Search and Replace
3266 plugin.</para>
3267 </listitem>
3268 </varlistentry>
3269 
3270 <varlistentry id="view-toolviews-searchandreplace">
3271 <term><menuchoice>
3272 <guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3273 <guimenuitem>Show Search and Replace</guimenuitem>
3274 </menuchoice></term>
3275 <listitem>
3276 <para>Toggle the display of &kate;'s <guilabel>Search and Replace</guilabel> tool.
3277 </para>
3278 </listitem>
3279 </varlistentry>
3280 
3281 </variablelist>
3282 
3283 </sect2>
3284 </sect1>
3285 
3286 <sect1 id="kate-application-plugin-snippets">
3287 <sect1info>
3288 <authorgroup>
3289 <author><firstname>Martin</firstname> <surname>Gergov</surname></author>
3290 <author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
3291 </authorgroup>
3292 </sect1info>
3293 <title>&kate; Snippets</title>
3294 
3295 <sect2 id="snippets-intro">
3296 <title>Introduction</title>
3297 <para>&kate; Snippets is a plugin used to save you some time by adding support for
3298 so-called <quote>snippets</quote> (re-usable source code, machine code or text). The plugin
3299 also supports code completion and &javascript;.</para>
3300 </sect2>
3301 
3302 <sect2 id="snippets-menu">
3303 <title>Menu Structure</title>
3304 
3305 <variablelist>
3306 <varlistentry>
3307 <term><menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3308 <guimenuitem>Show Snippets</guimenuitem></menuchoice></term>
3309 <listitem><para>Shows snippets panel containing all snippets in your repository
3310 that are for the currently opened file type.</para></listitem>
3311 </varlistentry>
3312 
3313 <varlistentry id="tools-create-snippet">
3314 <term><menuchoice>
3315 <guimenu>Tools</guimenu>
3316 <guimenuitem>Create Snippet</guimenuitem>
3317 </menuchoice></term>
3318 <listitem>
3319 <para>Create a new snippet, which is a reusable chunk of text you
3320 may insert in any part of any document.</para>
3321 </listitem>
3322 </varlistentry>
3323 
3324 </variablelist>
3325 
3326 </sect2>
3327 
3328 <sect2 id="snippets-panel">
3329 <title>Snippets panel</title>
3330 
3331 <screenshot id="screenshot-snippets-panel">
3332 <screeninfo>&kate; Snippets Panel</screeninfo>
3333 <mediaobject>
3334 <imageobject><imagedata fileref="snippets-panel.png" format="PNG"/></imageobject>
3335 <textobject><phrase>The &kate; snippets panel.</phrase></textobject>
3336 <caption><para>The panel for &kate; Snippets.</para></caption>
3337 </mediaobject>
3338 </screenshot>
3339 
3340 <para>In the panel you should see a list of snippet repositories,
3341 along with options to create your own, get them from the Internet or load
3342 them from a local file.  Each repository has a checkbox that can be used to
3343 activate or deactivate it.  There are also buttons to edit and delete existing
3344 repositories.</para>
3345 
3346 <sect3 id="snippets-repo-internet">
3347 <title>Loading Snippet Repository Files</title>
3348 <para>You can download snippet repositories from the Internet.  Just click
3349 <guibutton>Get New Snippets</guibutton> and a window with a list of snippet
3350 repositories will open.  After downloading the desired snippet, make sure that
3351 you have activated it.</para>
3352 <!--FIXME no way to load a local file ?
3353 <para>You can also load snippet repositories from a local file using the file
3354 browser at the bottom of the panel.  Click <guibutton>Copy to repository</guibutton>
3355 when finished.</para>-->
3356 </sect3>
3357 
3358 <sect3 id="snippets-repo-editor">
3359 <title>Creating and Editing Repositories</title>
3360 
3361 <para>To create a new snippet repository, click <guibutton>Add Repository</guibutton>.
3362 You should now see a dialog that asks for the name of the snippet file, license and
3363 author. After choosing the desired options, click <guibutton>OK</guibutton>.</para>
3364 
3365 <screenshot id="screenshot-snippets-repository">
3366 <screeninfo>Snippet Editor</screeninfo>
3367 <mediaobject>
3368 <imageobject><imagedata fileref="snippets-repository.png" format="PNG"/></imageobject>
3369 <textobject><phrase>The repository editor.</phrase></textobject>
3370 <caption><para>The repository editor interface.</para></caption>
3371 </mediaobject>
3372 </screenshot>
3373 
3374 <para>The snippet repository editor contains the following options:</para>
3375 
3376 <variablelist>
3377 
3378 <varlistentry>
3379 <term><guilabel>Name</guilabel></term>
3380 <listitem><para>Appears in the list of snippets in the tool view and is also
3381 searched when using the code completion feature.</para></listitem>
3382 </varlistentry>
3383 
3384 <varlistentry>
3385 <term><guilabel>Namespace</guilabel></term>
3386 <listitem><para>Prefix used while using code completion.</para></listitem>
3387 </varlistentry>
3388 
3389 <varlistentry>
3390 <term><guilabel>License</guilabel></term>
3391 <listitem><para>Select the license for you snippet repository.</para></listitem>
3392 </varlistentry>
3393 
3394 <varlistentry>
3395 <term><guilabel>Authors</guilabel></term>
3396 <listitem><para>Enter the name(s) of the author(s) of the snippet file.</para></listitem>
3397 </varlistentry>
3398 
3399 <varlistentry>
3400 <term><guilabel>File types</guilabel></term>
3401 <listitem><para>Select the file type(s) you want the snippet repository to apply
3402 to.  It is set to <quote></quote> by default, so the repository applies to all files. You
3403 can change it to something like <userinput>C++</userinput> for instance, or select
3404 from a list by clicking on the items.  You can specify more
3405 than one file type pressing the &Shift; while adding types.</para></listitem>
3406 </varlistentry>
3407 
3408 </variablelist>
3409 
3410 </sect3>
3411 
3412 <sect3 id="snippets-editor">
3413 <title>Creating and Editing Snippets</title>
3414 
3415 <screenshot id="screenshot-snippets-form">
3416 <screeninfo>Snippet Editor</screeninfo>
3417 <mediaobject>
3418 <imageobject><imagedata fileref="snippets-form.png" format="PNG"/></imageobject>
3419 <textobject><phrase>The snippet editor.</phrase></textobject>
3420 <caption><para>The snippet editor interface.</para></caption>
3421 </mediaobject>
3422 </screenshot>
3423 
3424 <variablelist>
3425 
3426 <varlistentry>
3427 <term><guilabel>Name</guilabel></term>
3428 <listitem><para>The name will be shown in the completion list.</para></listitem>
3429 </varlistentry>
3430 
3431 <varlistentry>
3432 <term>Shortcut</term>
3433 <listitem><para>Pressing this shortcut will insert the snippet into the document.</para></listitem>
3434 </varlistentry>
3435 
3436 <varlistentry>
3437 <term><guilabel>Snippets</guilabel></term>
3438 <listitem><para>The text your snippet will insert into the document.</para>
3439 <para>A snippet can contain editable fields. They can be cycled by
3440 pressing &Tab;. The following expressions can be used in the template
3441 text to create fields:</para>
3442 <para><userinput>${<replaceable>field_name</replaceable>}</userinput> creates a
3443 simple, editable field. All subsequent occurrences of the same
3444 <replaceable>field_name</replaceable> create fields which mirror the contents
3445 of the first during editing.</para>
3446 <para><userinput>${<replaceable>field_name=default</replaceable>}</userinput>
3447 can be used to specify a default value for the field.
3448 <replaceable>default</replaceable> can be any &javascript; expression.</para>
3449 <para>Use <userinput>${<replaceable>field_name</replaceable>=<replaceable>text</replaceable>}</userinput>
3450 to specify a fixed string as default value.</para>
3451 <para><userinput>${func(<replaceable>other_field1</replaceable>,
3452 <replaceable>other_field2</replaceable>, ...)}</userinput> can be used to create a
3453 field which evaluates a &javascript; function on each edit and contains its
3454 contents. See the <guilabel>Scripts</guilabel> tab for more information.</para>
3455 <para><userinput>${cursor}</userinput> can be used to mark the end position
3456 of the cursor after everything else was filled in.</para>
3457 </listitem>
3458 </varlistentry>
3459 
3460 <varlistentry>
3461 <term><guilabel>Scripts</guilabel></term>
3462 <listitem><para>&javascript; helper functions to use in your snippets.</para>
3463 <para>All &javascript; functions should return the contents you want to place in a
3464 template field as a string.</para>
3465 <para>Functions are called in a scope which contains the contents of all
3466 editable template fields as local variables. For example in a snippet
3467 containing <userinput>${<replaceable>field</replaceable>}</userinput>,
3468 a variable called <userinput>field</userinput> will be present which contains
3469 the up-to-date contents of the template field. Those variables can either
3470 be used in the function statically or passed as arguments, by using the
3471 <userinput>${func(field)}</userinput> or <userinput>${<replaceable>field2=func(field)</replaceable>}</userinput>
3472 syntax in the snippet string.</para>
3473 <para>You can use
3474 the <ulink url="help:/katepart/dev-scripting.html#dev-scripting-api">&kate; scripting API</ulink>
3475 to get the selected text, full text, file name and
3476 more by using the appropriate methods of the <userinput>document</userinput>
3477 and <userinput>view</userinput> objects. Refer to the scripting API
3478 documentation for more information.</para>
3479 <para>For more complex scripts it may be important to understand that
3480 <emphasis>first</emphasis>, the raw snippet is inserted into the document, and <emphasis>then</emphasis>
3481 functions are being evaluated. E.g., if a function retrieves the text on the
3482 line where the snippet is being inserted, that text will also contain
3483 <userinput>${functionCall()}</userinput>.</para>
3484 <para>As an example of working with selections using the scripting API, a simple way
3485 to wrap selected text inside tags is this snippet:
3486 <userinput>&lt;strong&gt;${view.selectedText()}&lt;/strong&gt;</userinput>
3487 </para>
3488 <para>The following example invokes a script that inserts a default text in case
3489 there is no selection. Snippet:</para>
3490 <para>
3491 <userinput>${rangeCommand("&lt;strong&gt;%%1&lt;/strong&gt;", "Bold")}</userinput></para>
3492 <para>Script:
3493 <programlisting>
3494 function rangeCommand(command, def) {
3495     if (view.selectedText().length > 0) {
3496         return command.replace("%%1", view.selectedText());
3497     } else {
3498         return command.replace("%%1", def);
3499     }
3500 }
3501 </programlisting>
3502 </para>
3503 </listitem>
3504 </varlistentry>
3505 
3506 </variablelist>
3507 </sect3>
3508 </sect2>
3509 
3510 <sect2 id="snippets-using">
3511 <title>Using Snippets</title>
3512 
3513 <screenshot id="screenshot-snippets-usage">
3514 <screeninfo>&kate; Snippets in Action</screeninfo>
3515 <mediaobject>
3516 <imageobject><imagedata fileref="snippets-usage.png" format="PNG"/></imageobject>
3517 <textobject><phrase>Accessing &kate; Snippets from a tool view and a drop down menu.</phrase></textobject>
3518 <caption><para>Selecting from a list of snippets.</para></caption>
3519 </mediaobject>
3520 </screenshot>
3521 
3522 <para>You can call snippets in two ways:</para>
3523 
3524 <itemizedlist>
3525 <listitem><para>By choosing the snippet from the tool view.</para></listitem>
3526 <listitem><para>While writing, you can press <keycombo action="simul">&Ctrl;
3527 &Space;</keycombo>, which will display all the snippets in a
3528 convenient window from which you can choose.  This key combination provides
3529 functionality similar to code completion.</para></listitem>
3530 </itemizedlist>
3531 
3532 <para>If the snippet contains variables (besides <literal>${cursor}</literal>)
3533 the cursor will automatically go to the first occurrence of a variable and will
3534 wait for you to write something. When you are done, you can press &Tab; to move
3535 to the next variable, and so on.</para>
3536 
3537 </sect2>
3538 
3539 <sect2 id="snippets-ack">
3540 <title>Thanks and Acknowledgments</title>
3541 <para>&kate; Snippets was written by Joseph Wenninger.</para>
3542 <para>Special thanks to Google Code-In 2011 participant Martin Gergov for
3543 writing much of this section.</para>
3544 </sect2>
3545 
3546 </sect1>
3547 
3548 <sect1 id="kate-application-plugin-keyboardmacros">
3549 <sect1info>
3550 <authorgroup>
3551 <!--author>&Pablo.Rauzy; &Pablo.Rauzy.mail;</author--> <!-- TODO: use that when the version of KDocTools that Kate depends on has it -->
3552 <author><firstname>Pablo</firstname> <surname>Rauzy</surname> <email>r .at. uzy.me</email></author>
3553 </authorgroup>
3554 </sect1info>
3555 <title>Keyboard Macros Plugin</title>
3556 
3557 <sect2 id="keyboardmacros-intro">
3558 <title>Introduction</title>
3559 <para>Record and play keyboard macros (i.e., keyboard action sequences).</para>
3560 </sect2>
3561 
3562 <sect2 id="keyboardmacros-basicusage">
3563 <title>Basic usage</title>
3564 
3565 <sect3 id="keyboardmacros-basicusage-record">
3566 <title>To start recording a keyboard macro:</title>
3567 <para>
3568 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Record Macro...</guimenuitem></menuchoice>
3569 (<keycombo action="simul">&Ctrl;&Shift;<keycap>K</keycap></keycombo>).
3570 </para>
3571 <para>The plugin will record every key presses until you end recording.</para>
3572 </sect3>
3573 
3574 <sect3 id="keyboardmacros-basicusage-record-end">
3575 <title>To end recording:</title>
3576 <para>
3577 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>End Macro Recording</guimenuitem></menuchoice>
3578 (<keycombo action="simul">&Ctrl;&Shift;<keycap>K</keycap></keycombo>).
3579 </para>
3580 <para>The plugin will stop recording key presses and save the sequence as the current macro.</para>
3581 </sect3>
3582 
3583 <sect3 id="keyboardmacros-basicusage-record-cancel">
3584 <title>To cancel recording:</title>
3585 <para>
3586 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Cancel Macro Recording</guimenuitem></menuchoice>
3587 (<keycombo action="simul">&Ctrl;&Alt;&Shift;<keycap>K</keycap></keycombo>).
3588 </para>
3589 <para>The plugin will stop recording key presses but the current macro won't change.</para>
3590 </sect3>
3591 
3592 <sect3 id="keyboardmacros-basicusage-play">
3593 <title>To play the current macro:</title>
3594 <para>
3595 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Play Macro</guimenuitem></menuchoice>
3596 (<keycombo action="simul">&Ctrl;&Alt;<keycap>K</keycap></keycombo>).
3597 </para>
3598 <para>The plugin will play the current macro.</para>
3599 <para>The <userinput>kmplay</userinput> command without any arguments will also play the current macro.</para>
3600 </sect3>
3601 
3602 </sect2>
3603 
3604 <sect2 id="keyboardmacros-namedmacros">
3605 <title>Named macros</title>
3606 
3607 <para>It is possible to save keyboard macros by giving them a name.</para>
3608 <para>Named macros are persistent between Kate's sessions, they're saved in the <filename>keyboardmacros.json</filename> file in Kate's user data directory (usually <filename>~/.local/share/kate/</filename>).</para>
3609 
3610 <sect3 id="keyboardmacros-namedmacros-save">
3611 <title>To save the current macro:</title>
3612 <para>
3613 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Save Current Macro</guimenuitem></menuchoice>
3614 (<keycombo action="simul">&Alt;&Shift;<keycap>K</keycap></keycombo>).
3615 </para>
3616 <para>The plugin will prompt you for a name and save the macro under it.</para>
3617 <para>The <userinput>kmsave <replaceable>name</replaceable></userinput> command will save the current macro under the name <userinput><replaceable>name</replaceable></userinput>.</para>
3618 </sect3>
3619 
3620 <sect3 id="keyboardmacros-namedmacros-load">
3621 <title>To load a saved macro as the current one:</title>
3622 <para>
3623 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Load Named Macro...</guimenuitem></menuchoice>.
3624 </para>
3625 <para>The plugin lists saved macros as items in this submenu, activating an item will load the corresponding macro as the current one.</para>
3626 <para>The <userinput>kmload <replaceable>name</replaceable></userinput> command will load the macro saved under the name <userinput><replaceable>name</replaceable></userinput> as the current one.</para>
3627 </sect3>
3628 
3629 <sect3 id="keyboardmacros-namedmacros-play">
3630 <title>To play a saved macro without loading it:</title>
3631 <para>
3632 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Play Named Macro...</guimenuitem></menuchoice>.
3633 </para>
3634 <para>The plugin lists saved macros as items in this submenu, activating an item will play the corresponding macro without loading it.</para>
3635 <para>Note that each saved macros is an action that is part of the current action collection so that a custom shortcut can be assigned to it through the <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure Keyboard Shortcuts...</guimenuitem></menuchoice> interface.</para>
3636 <para>The <userinput>kmplay <replaceable>name</replaceable></userinput> command will play the macro saved under the name <userinput><replaceable>name</replaceable></userinput> without loading it.</para>
3637 </sect3>
3638 
3639 <sect3 id="keyboardmacros-namedmacros-wipe">
3640 <title>To wipe (i.e., delete) a saved macro:</title>
3641 <para>
3642 <menuchoice><guimenu>Tools</guimenu><guimenuitem>Keyboard Macros</guimenuitem><guimenuitem>Wipe Named Macro...</guimenuitem></menuchoice>.
3643 </para>
3644 <para>The plugin lists saved macros as items in this submenu, activating an item will wipe (i.e., delete) the corresponding macro.</para>
3645 <para>The <userinput>kmwipe <replaceable>name</replaceable></userinput> command will wipe the macro saved under the name <userinput><replaceable>name</replaceable></userinput>.</para>
3646 </sect3>
3647 
3648 <sect3 id="keyboardmacros-namedmacros-command-tips">
3649 <title>Tips for commands:</title>
3650 <para>Note that after the <userinput>km</userinput> prefix, all these commands use a different letter so you can efficiently call them using tab-completion!</para>
3651 </sect3>
3652 
3653 </sect2>
3654 
3655 <sect2 id="keyboardmacros-limitations">
3656 <title>Limitations</title>
3657 
3658 <para>As of now, keyboard macros fail to play properly if some types of GUI widgets are used: QMenu, QuickOpenLineEdit, or TabSwitcherTreeView, for example.
3659 I'm not sure why but my first guess would be that these widgets work in a non-standard way regarding keyboard events.</para>
3660 
3661 </sect2>
3662 
3663 </sect1>
3664 
3665 
3666 <sect1 id="kate-application-plugin-sql">
3667 <sect1info>
3668 <authorgroup>
3669 <author><firstname>Ömer</firstname> <othername>Faruk</othername> <surname>ORUÇ</surname></author>
3670 <author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
3671 </authorgroup>
3672 </sect1info>
3673 <title>SQL Plugin</title>
3674 
3675 <sect2 id="sql-intro">
3676 <title>Introduction</title>
3677 
3678 <para>The Structured Query Language (SQL) is a specialized language for updating,
3679 deleting, and requesting information from databases.</para>
3680 
3681 <para>The &kate; SQL Plugin allows you to:</para>
3682 
3683 <itemizedlist>
3684 <listitem><para>Create a database</para></listitem>
3685 <listitem><para>Connect to existing databases</para></listitem>
3686 <listitem><para>Insert and delete data in the database</para></listitem>
3687 <listitem><para>Execute queries</para></listitem>
3688 <listitem><para>Display results in a table</para></listitem>
3689 </itemizedlist>
3690 
3691 </sect2>
3692 
3693 <sect2 id="sql-connecting">
3694 <title>Connecting to a Database</title>
3695 
3696 <para>Select <guibutton>Add Connection</guibutton> from the <guimenu>SQL</guimenu>
3697 menu or toolbar, and then select the &Qt; database driver you want to use (including
3698 QSQLITE, QMYSQL3, QMYSQL, QODBC3, QODBC, QPSQL7, and QPSQL).  If you can't see
3699 the desired driver, you need to install it.  Then, press <guibutton>Next</guibutton>.
3700 </para>
3701 
3702 <para>If the database you selected uses a file, simply indicate the database's
3703 location and press the <guibutton>Next</guibutton> button.  If it requires connecting
3704 to a server, you must enter the hostname of the server, your username and password,
3705 and any other information that particular driver may require. Then press
3706 <guibutton>Next</guibutton>.</para>
3707 
3708 <para>Finally, give a name to your connection, and press <guibutton>Finish</guibutton>.</para>
3709 
3710 </sect2>
3711 
3712 <sect2 id="sql-querying">
3713 <title>Running Queries</title>
3714 
3715 <sect3 id="sql-querying-insert-delete-update">
3716 <title>INSERT/DELETE/UPDATE</title>
3717 
3718 <para>You can insert, delete, and update data using the SQL plugin just as
3719 you would from the command line or from within a program.  Simply enter a query
3720 and press the <guibutton>Run query</guibutton> button in the toolbar or
3721 use <menuchoice><guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem></menuchoice>
3722 (<keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo>).</para>
3723 
3724 <example>
3725 <title>Some Example Queries</title>
3726 <variablelist>
3727 
3728 <varlistentry>
3729 <term><command>INSERT</command></term>
3730 <listitem><para><programlisting>
3731 INSERT INTO <replaceable>table_name</replaceable> ("<replaceable>feature1</replaceable>", "<replaceable>feature2</replaceable>", "<replaceable>feature3</replaceable>", "<replaceable>feature4</replaceable>", "<replaceable>feature5</replaceable>")
3732 VALUES ("<replaceable>value1</replaceable>", "<replaceable>value2</replaceable>", "<replaceable>value3</replaceable>", "<replaceable>value4</replaceable>", "<replaceable>value5</replaceable>" )
3733 </programlisting></para></listitem>
3734 </varlistentry>
3735 
3736 <varlistentry>
3737 <term><command>DELETE</command></term>
3738 <listitem><para><programlisting>
3739 DELETE FROM <replaceable>table_name</replaceable> WHERE name = "<replaceable>text</replaceable>"
3740 </programlisting></para></listitem>
3741 </varlistentry>
3742 
3743 <varlistentry>
3744 <term><command>UPDATE</command></term>
3745 <listitem><para><programlisting>
3746 UPDATE <replaceable>table_name</replaceable> SET "<replaceable>feature1</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature2</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature3</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature4</replaceable>" = "<replaceable>text</replaceable>", "<replaceable>feature5</replaceable>" = "<replaceable>text</replaceable>"
3747 </programlisting></para></listitem>
3748 </varlistentry>
3749 
3750 </variablelist>
3751 </example>
3752 
3753 </sect3>
3754 
3755 <sect3 id="sql-querying-select">
3756 <title>SELECT</title>
3757 
3758 <para>After running a  <command>SELECT</command> query, you can view the results
3759 as a table that will appear in the <guilabel>SQL Data Output</guilabel> tool view at
3760 the bottom of &kate;, or as text in the <guilabel>SQL Text Output</guilabel>.
3761 If there is an error, you can see it in the text output.</para>
3762 
3763 <example>
3764 <title>Example <command>SELECT</command> Query</title>
3765 <para><programlisting>
3766 SELECT * FROM <replaceable>table_name</replaceable>
3767 </programlisting></para>
3768 </example>
3769 
3770 <para>In the <guilabel>SQL Data Output</guilabel> tool view, there are several buttons:</para>
3771 
3772 <variablelist>
3773 
3774 <varlistentry>
3775 <term><guibutton>Resize columns to contents</guibutton></term>
3776 <listitem><para>Changes the size of columns to fit their contents.</para></listitem>
3777 </varlistentry>
3778 
3779 <varlistentry>
3780 <term><guibutton>Resize rows to contents</guibutton></term>
3781 <listitem><para>Changes the size of rows to fit their contents.</para></listitem>
3782 </varlistentry>
3783 
3784 <varlistentry>
3785 <term><guibutton>Copy</guibutton></term>
3786 <listitem><para>Selects all of the table contents and copies it to the clipboard buffer.</para></listitem>
3787 </varlistentry>
3788 
3789 <varlistentry>
3790 <term><guibutton>Export</guibutton></term>
3791 <listitem><para>Exports all of the table contents to a file, the clipboard, or the
3792 current document in the Comma Separated Values format.</para></listitem>
3793 </varlistentry>
3794 
3795 <varlistentry>
3796 <term><guibutton>Clear</guibutton></term>
3797 <listitem><para>Removes everything from the table view.</para></listitem>
3798 </varlistentry>
3799 
3800 <!--FIXME Use system locale -->
3801 
3802 </variablelist>
3803 
3804 <para>You can now change the colors displayed in the table in the <guilabel>SQL</guilabel>
3805 section of <menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem>
3806 </menuchoice>.</para>
3807 
3808 </sect3>
3809 </sect2>
3810 
3811 <sect2 id="sql-browsing">
3812 <title>Browsing</title>
3813 
3814 <para>You can browse your database using the <guilabel>Database schema</guilabel> browser
3815 tool view on the left.  The information displayed varies depending on which
3816 database driver you are using.</para>
3817 
3818 <para>To refresh this list, right-click anywhere in the tool view and select
3819 <guimenuitem>Refresh</guimenuitem>.  To generate a query on any entry in the list,
3820 right-click on an entry, select <guisubmenu>Generate</guisubmenu>, and select the
3821 query type (<guimenuitem>SELECT</guimenuitem>, <guimenuitem>UPDATE</guimenuitem>,
3822 <guimenuitem>INSERT</guimenuitem>, or <guimenuitem>DELETE</guimenuitem>) from
3823 the submenu that appears.</para>
3824 
3825 </sect2>
3826 
3827 <sect2 id="sql-menus">
3828 <title>Menu Structure</title>
3829 <variablelist>
3830 
3831 <varlistentry>
3832 <term><menuchoice>
3833 <guimenu>SQL</guimenu><guimenuitem>Add connection...</guimenuitem>
3834 </menuchoice></term>
3835 <listitem><para>
3836 Adds a new connection using any database driver.
3837 </para></listitem>
3838 </varlistentry>
3839 
3840 <varlistentry>
3841 <term><menuchoice>
3842 <guimenu>SQL</guimenu><guimenuitem>Remove connection</guimenuitem>
3843 </menuchoice></term>
3844 <listitem><para>
3845 Removes the selected connection.
3846 </para></listitem>
3847 </varlistentry>
3848 
3849 <varlistentry>
3850 <term><menuchoice>
3851 <guimenu>SQL</guimenu><guimenuitem>Edit connection...</guimenuitem>
3852 </menuchoice></term>
3853 <listitem><para>
3854 Edits the current connection's settings.
3855 </para></listitem>
3856 </varlistentry>
3857 
3858 <varlistentry>
3859 <term>Connections</term>
3860 <listitem><para>
3861 All database connections you have created are listed between the
3862 <guimenuitem>Edit connection</guimenuitem> and <guimenuitem>Run query</guimenuitem>
3863 menu items.  Select one to run queries or make modifications to it.
3864 </para></listitem>
3865 </varlistentry>
3866 
3867 <varlistentry>
3868 <term><menuchoice>
3869 <shortcut><keycombo action="simul">&Ctrl;<keycap>E</keycap></keycombo></shortcut>
3870 <guimenu>SQL</guimenu><guimenuitem>Run query</guimenuitem>
3871 </menuchoice></term>
3872 <listitem><para>
3873 Runs your query.
3874 </para></listitem>
3875 </varlistentry>
3876 
3877 </variablelist>
3878 </sect2>
3879 
3880 <sect2 id="sql-ack">
3881 <title>Thanks and Acknowledgments</title>
3882 
3883 <para>The SQL Plugin was written by Marco Mentasti.</para>
3884 <para>Special thanks to Google Code-In 2011 participant Ömer Faruk ORUÇ for
3885 writing much of this section.</para>
3886 
3887 </sect2>
3888 
3889 </sect1>
3890 
3891 <sect1 id="kate-application-plugin-symbolviewer">
3892 <!--https://kate-editor.org/2010/10/27/php-treeview-improvements-in-kate/?-->
3893 <title>Symbol Viewer Plugin</title>
3894 
3895 <sect2 id="symbolviewer-using">
3896 <title>Using the Close Except/Like Plugin</title>
3897 
3898 <para>It allows developers to view symbols (functions, macros and structures) from source code.</para>
3899 <para>By clicking the parsed information you can easily browse the code.</para>
3900 <para>At the moment the following languages are supported:</para>
3901 <para>C/C++, &Java;, Perl, PHP, Python, Ruby, XSLT, Tcl/Tk, Fortran</para>
3902 
3903 <para>Feature list:</para>
3904 <simplelist>
3905 <member>List/Tree mode</member>
3906 <member>Enable/disable sorting</member>
3907 <member>Hide/Show Functions Parameters</member>
3908 <member>Expand/collapse tree mode</member>
3909 <member>Auto-update on document change</member>
3910 <member>Code parsing is based on the Syntax-Highlighting framework from &kde-frameworks;</member>
3911 </simplelist>
3912 
3913 </sect2>
3914 
3915 <sect2 id="symbolviewer-menu">
3916 <title>Menu Structure</title>
3917 <variablelist>
3918 
3919 <varlistentry id="tools-symbolviewer">
3920 <term><menuchoice>
3921 <shortcut>
3922 <keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo>
3923 </shortcut>
3924 <guimenu>View</guimenu>
3925 <guisubmenu>Tool Views</guisubmenu>
3926 <guimenuitem>Show Symbol List</guimenuitem>
3927 </menuchoice></term>
3928 <listitem>
3929 <para>Toggle the display of &kate;'s Symbol List displaying Functions, Macros and
3930 Structures of the source code in the active document.</para>
3931 </listitem>
3932 </varlistentry>
3933 
3934 </variablelist>
3935 
3936 </sect2>
3937 
3938 <sect2 id="symbolviewer-config">
3939 <title>Configuration</title>
3940 
3941 <screenshot id="screenshot-symbolviewer-settings">
3942 <screeninfo>Symbol Viewer</screeninfo>
3943 <mediaobject>
3944 <imageobject><imagedata fileref="symbolviewer-settings.png" format="PNG"/></imageobject>
3945 <caption><para>Choose the default parser options</para></caption>
3946 </mediaobject>
3947 </screenshot>
3948 
3949 </sect2>
3950 
3951 </sect1>
3952 
3953 
3954 <sect1 id="kate-application-plugin-konsole">
3955 <title>Terminal Tool View Plugin</title>
3956 
3957 <para><indexterm><primary>Terminal emulator</primary></indexterm>
3958 The built in Terminal Emulator is a copy of the &kde; &konsole;
3959 terminal application, for your convenience. It is available from the
3960 <menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3961 <guimenuitem>Show Terminal Panel</guimenuitem></menuchoice> menu item and will get the focus
3962 whenever displayed. Additionally, if the <link
3963 linkend="konsole-config">Automatically synchronize
3964 the terminal with the current document when possible</link> option is enabled, it will
3965 change to the directory of the current document if
3966 possible when it is displayed, or when the current document
3967 changes.</para>
3968 
3969 <para>The default location in the &kate; window is at the bottom,
3970 below the editing area.</para>
3971 
3972 <para>You can configure the &konsole; using its &RMB; menu, for more
3973 information, see the <ulink url="help:/konsole/index.html">&konsole; manual</ulink>.</para>
3974 
3975 <para>The built-in terminal emulator is provided by the Terminal Tool View plugin.</para>
3976 
3977 <sect2 id="konsole-menus">
3978 <title>Menu Structure</title>
3979 
3980 <variablelist>
3981 
3982 <varlistentry id="view-toolviews-show-terminal">
3983 <term><menuchoice>
3984 <guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
3985 <guimenuitem>Show Terminal Panel</guimenuitem>
3986 </menuchoice></term>
3987 <listitem>
3988 <para>Toggles the display of the built-in terminal emulator.</para>
3989 <para>When activated for the first time, the terminal will be created.</para>
3990 <para>When the terminal emulator is displayed, it will get the focus, so that
3991 you can start typing in commands immediately. If the <link
3992 linkend="konsole-config">Automatically synchronize the terminal
3993 with the current document when possible</link> option is enabled in the
3994 <guilabel>Terminal</guilabel> page of the <link
3995 linkend="config-dialog">Main configuration dialog</link> the shell session will
3996 change to the directory of the active document, if it is a local file.</para>
3997 </listitem>
3998 </varlistentry>
3999 
4000 <varlistentry id="view-toolviews-pipe-to-terminal">
4001 <term><menuchoice><guimenu>Tools</guimenu><guimenuitem>Pipe to
4002 Terminal</guimenuitem></menuchoice></term>
4003 <listitem><para>Feed the currently selected text into the built-in terminal
4004 emulator. No newline is added after the text.</para></listitem>
4005 </varlistentry>
4006 
4007 <varlistentry id="tools-sync-terminal-document">
4008 <term><menuchoice>
4009 <guimenu>Tools</guimenu>
4010 <guimenuitem>Synchronize Terminal with Current Document</guimenuitem></menuchoice></term>
4011 <listitem>
4012 <para>This will cause the built-in Terminal to <command>cd</command> into the
4013 directory of the active document.</para>
4014 
4015 <para>Alternatively, you can configure &kate; to always keep the terminal in
4016 sync with the current document.  See
4017 <xref linkend="konsole-config"/> for more information.</para>
4018 </listitem>
4019 </varlistentry>
4020 
4021 <varlistentry id="tools-run-current-document">
4022 <term><menuchoice>
4023 <guimenu>Tools</guimenu>
4024 <guimenuitem>Run Current Document</guimenuitem></menuchoice></term>
4025 <listitem>
4026 <para>Run the current document in &konsole;. Only the local documents can be run.
4027 &kate; will show a warning before running document because this action can be
4028 a serious security threat.</para>
4029 </listitem>
4030 </varlistentry>
4031 
4032 <varlistentry id="tools-focus-terminal">
4033 <term><menuchoice>
4034 <guimenu>Tools</guimenu>
4035 <guimenuitem>Focus/Defocus Terminal Panel</guimenuitem>
4036 </menuchoice></term>
4037 <listitem>
4038 <para>Switch the focus from the current document to the terminal and vice versa.
4039 </para>
4040 </listitem>
4041 </varlistentry>
4042 
4043 </variablelist>
4044 </sect2>
4045 
4046 <sect2 id="konsole-config">
4047 <title>Configuration</title>
4048 
4049 <para>You can configure the Terminal Tool View plugin on the
4050 <guilabel>Terminal</guilabel> page of the
4051 <link linkend="configuring-kate">configuration dialog</link>.</para>
4052 
4053 <para>The following options are available:</para>
4054 
4055 <variablelist>
4056 <varlistentry>
4057 <term>
4058 <guilabel>Automatically synchronize the terminal with the current document when possible</guilabel></term>
4059 <listitem><para>This will cause the built-in terminal to
4060 <command>cd</command> into the directory of the active document when
4061 launched and when a new document gets the focus. If not enabled, you
4062 have to do all your navigation in the terminal on your own.
4063 </para></listitem>
4064 </varlistentry>
4065 
4066 <varlistentry>
4067 <term><guilabel>Set EDITOR environment variable to 'kate -b'</guilabel></term>
4068 <listitem><para>This sets the <envar>EDITOR</envar> environment variable so programs
4069 run in the built-in terminal that automatically open a file in an editor will open
4070 them in &kate; instead of the default editor configured in your shell.  You will
4071 not be able to continue using the terminal until you have closed the file in &kate;,
4072 so the calling program is aware you have finished editing the file.</para></listitem>
4073 </varlistentry>
4074 
4075 <varlistentry>
4076 <term><guilabel>Hide &konsole; on pressing 'Esc'</guilabel></term>
4077 <listitem><para>This allows closing the built-in terminal by pressing the &Esc; key. May cause issues with terminal applications
4078 that use &Esc; key, &eg; <application>vim</application>. Add such applications in the text input box below.
4079 The items in the list should be separated with comma.</para></listitem>
4080 </varlistentry>
4081 
4082 </variablelist>
4083 </sect2>
4084 
4085 </sect1>
4086 
4087 <sect1 id="kate-application-plugin-textfilter">
4088 
4089 <title>Text Filter Plugin</title>
4090 
4091 <sect2 id="textfilter-using">
4092 <title>Using the Text Filter Plugin</title>
4093 
4094 <para>You can use this plugin to process selected text using terminal commands.
4095 The selection will be used as input for the command, and the output will either
4096 replace the selection or be copied to the clipboard, depending on the user's preference.
4097 </para>
4098 
4099 <itemizedlist>
4100 <title>Examples:</title>
4101 <listitem><para>
4102 <command>less /etc/fstab</command> - paste the contents of this file or copy it to the clipboard
4103 </para></listitem>
4104 <listitem><para>
4105 <command>wc</command> - count lines, words and characters of the selection and
4106 paste this into the document or copy it to the clipboard
4107 </para></listitem>
4108 <listitem><para>
4109 <command>sort</command> - sort lines of the selection and paste the result into
4110 the document or copy it to the clipboard
4111 </para></listitem>
4112 </itemizedlist>
4113 
4114 </sect2>
4115 
4116 <sect2 id="textfilter-menu">
4117 <title>Menu Structure</title>
4118 
4119 <variablelist>
4120 
4121 <varlistentry id="tools-textfilter">
4122 <term><menuchoice>
4123 <shortcut>
4124 <keycombo action="simul">&Ctrl;<keycap>\</keycap></keycombo><!--FIXME shortcut does not work with a german keyboard \ = AltGr+\-->
4125 </shortcut>
4126 <guimenu>Tools</guimenu>
4127 <guisubmenu>Filter Text</guisubmenu>
4128 </menuchoice></term>
4129 <listitem>
4130 
4131 <para><action>Opens</action> the Text Filter dialog:</para>
4132 
4133 <screenshot id="screenshot-filtertext">
4134 <screeninfo>Text Filter dialog</screeninfo>
4135 <mediaobject>
4136 <imageobject><imagedata fileref="textfilter.png" format="PNG"/></imageobject>
4137 </mediaobject>
4138 </screenshot>
4139 
4140 <para>Enter the shell command into the combobox or select a previous command from the history.</para>
4141 
4142 <variablelist>
4143 
4144 <varlistentry>
4145 <term><guilabel>Copy the result instead of pasting it</guilabel></term>
4146 <listitem>
4147 <para>Copy the result to clipboard leaving a document unchanged.</para>
4148 </listitem>
4149 </varlistentry>
4150 
4151 <varlistentry>
4152 <term><guilabel>Merge STDOUT and STDERR</guilabel></term>
4153 <listitem>
4154 <para>
4155 If checked, an output from STDOUT and STDERR will be merged and no errors will be reported.
4156 Otherwise, STDERR will be displayed as a passive message.</para>
4157 </listitem>
4158 </varlistentry>
4159 
4160 </variablelist>
4161 
4162 </listitem>
4163 </varlistentry>
4164 
4165 </variablelist>
4166 
4167 </sect2>
4168 
4169 </sect1>
4170 
4171 <sect1 id="kate-application-plugin-xmlcheck">
4172 <!-- from doc/kate-addons/xmlcheck.docbook -->
4173 <sect1info>
4174 <authorgroup><author>
4175 &Daniel.Naber; &Daniel.Naber.mail;
4176 </author></authorgroup>
4177 </sect1info>
4178 
4179 <title>&XML; Validation</title>
4180 
4181 <para>This plugin checks &XML; files for validity and being well-formed.</para>
4182 <para>This plugin checks the current file. A list of warnings and errors
4183 will appear at the bottom of &kate;'s main window. You can click on an error message
4184 to jump to the corresponding place in the file. If the file has a <quote>DOCTYPE</quote>
4185 the DTD given with this doctype will be used to check the file for validity. The
4186 DTD is expected at a position relative to the current file, &eg; if the doctype
4187 refers to <quote>DTD/xhtml1-transitional.dtd</quote> and the file is <filename>/home/peter/test.xml</filename>
4188 the DTD is expected to be located at <filename>/home/peter/DTD/xhtml1-transitional.dtd</filename>.
4189 However, remote DTDs specified via http are supported.</para>
4190 
4191 <para>If the file has no doctype it will be checked for being well-formed.</para>
4192 
4193 <para>To learn more about &XML; check out the <ulink url="https://www.w3.org/XML/"> official W3C &XML; pages</ulink>.</para>
4194 
4195 <para>Internally this plugin calls the external command <command>xmllint</command>, which
4196 is part of libxml2. If this command is not correctly installed on your system, the plugin
4197 will not work.</para>
4198 
4199 <para>To load this plugin open &kate;'s configuration dialog under <menuchoice><guimenu>Settings</guimenu>
4200 <guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
4201 Then select <guilabel>&XML; Validation</guilabel> which will appear
4202 in the <guilabel>Application</guilabel> / <guilabel>Plugins</guilabel> section and close the dialog.
4203 </para>
4204 
4205 <sect2 id="xmlcheck-menu">
4206 <title>Menu Structure</title>
4207 
4208 <variablelist>
4209 <varlistentry>
4210 <term>
4211 <menuchoice>
4212 <guimenu>&XML;</guimenu>
4213 <guimenuitem>Validate &XML;</guimenuitem>
4214 </menuchoice>
4215 </term>
4216 <listitem><para>This will start the check, as described above.</para></listitem>
4217 </varlistentry>
4218 </variablelist>
4219 
4220 </sect2>
4221 
4222 <sect2 id="xmlcheck-thanks-and-acknowledgements">
4223 <title>Thanks and Acknowledgments</title>
4224 <para>
4225 &kate; Plugin <quote>&XML; Validation</quote> copyright 2002 &Daniel.Naber;
4226 &Daniel.Naber.mail;.
4227 </para>
4228 <para>Documentation copyright 2002 &Daniel.Naber;</para>
4229 
4230 </sect2>
4231 </sect1>
4232 
4233 <sect1 id="kate-application-plugin-xmltools">
4234 <!-- from doc/kate-addons/xmlcheck.docbook -->
4235 <sect1info>
4236 <authorgroup><author>
4237 &Daniel.Naber; &Daniel.Naber.mail;
4238 </author></authorgroup>
4239 </sect1info>
4240 <title>&XML; Completion</title>
4241 
4242 <para>This plugin gives hints about what is allowed at a certain position in
4243 an &XML; file, according to the file's DTD. It will list possible
4244 elements, attributes, attribute values or entities, depending on the
4245 cursor position (&eg; all entities are listed if the character on the left
4246 of the cursor is <quote>&amp;</quote>). It's also possible to close the nearest
4247 open tag on the left.</para>
4248 
4249 <para>The <acronym>DTD</acronym> must exist in &XML; format, as produced by the Perl program
4250 <command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>.
4251 Some meta DTDs are supplied. They are installed in
4252 <filename class="directory">katexmltools/</filename> in
4253 <userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>,
4254 which is also the default folder when you choose
4255 <guimenuitem>Assign Meta DTD...</guimenuitem>.
4256 To produce your own meta DTDs, get <command>dtdparse</command> from
4257 <ulink url="http://dtdparse.sourceforge.net">http://dtdparse.sourceforge.net</ulink>.</para>
4258 
4259 <sect2 id="xmltools-how-to-use">
4260 <title>How to Use</title>
4261 
4262 <para>Start &kate; and open the configuration dialog under <menuchoice><guimenu>Settings</guimenu>
4263 <guimenuitem>Configure &kate;...</guimenuitem></menuchoice>.
4264 Then select <guilabel>&XML; Completion</guilabel> which will appear
4265 in the <menuchoice><guimenu>Application</guimenu>
4266 <guimenuitem>Plugins</guimenuitem></menuchoice> page and close the dialog. After
4267 that, select <menuchoice><guimenu>&XML;</guimenu><guimenuitem>Assign Meta DTD...</guimenuitem></menuchoice>.
4268 If your document contains no <quote>DOCTYPE</quote> or the doctype is unknown, you will have to
4269 select a meta DTD from the file system. Otherwise the meta DTD that
4270 matches the current document's DOCTYPE will be loaded automatically.</para>
4271 
4272 <para>You can now use the plugin while typing your text:</para>
4273 
4274 <variablelist>
4275 
4276 <varlistentry>
4277 <term><keycap>&lt;</keycap> (less than key)</term>
4278 <listitem><para>This will trigger a list of possible elements unless the
4279 cursor is inside a tag already. Note that you currently cannot use
4280 this to insert the top level element (&eg; <quote>&lt;html&gt;</quote>).</para></listitem>
4281 </varlistentry>
4282 
4283 <varlistentry>
4284 <term><keycap>&lt;</keycap><keycap>/</keycap>(less than key + slash)</term>
4285 <listitem><para>Entering these characters will offer to close the current element
4286 (nearest open one to the left of the cursor). Press &Enter; to accept the suggestion.
4287 Unlike the <guimenuitem>Close Element</guimenuitem> menu item, this works only with
4288 a DTD assigned.</para></listitem>
4289 </varlistentry>
4290 
4291 <varlistentry>
4292 <term><keycap>"</keycap> (quote key)</term>
4293 <listitem><para>The quote key will trigger a list of possible attribute
4294 values (if there are any) if you are inside a tag.</para></listitem>
4295 </varlistentry>
4296 
4297 <varlistentry>
4298 <term><keycap>&nbsp;</keycap> (space key)</term>
4299 <listitem><para>This key will trigger a list of possible attributes for the
4300 current element if you are inside a tag.</para>
4301 </listitem>
4302 </varlistentry>
4303 
4304 <varlistentry>
4305 <term><keycap>&amp;</keycap> (ampersand key)</term>
4306 <listitem><para>This key will trigger a list of named entities.</para></listitem>
4307 </varlistentry>
4308 </variablelist>
4309 
4310 </sect2>
4311 
4312 <sect2 id="xmltools-features-and-limitations">
4313 <title>Features and Limitations</title>
4314 
4315 <para>You can test all functions and limitations by loading
4316 <filename>katexmltools/testcases.xml</filename> in
4317 <userinput><command>qtpaths</command> <option>--paths GenericDataLocation </option></userinput>
4318 into &kate; and following the instructions.</para>
4319 
4320 </sect2>
4321 
4322 
4323 <sect2 id="xmltools-menu">
4324 <title>Menu Structure</title>
4325 
4326 <variablelist id="xml-insert-element">
4327 <varlistentry>
4328 <term><menuchoice>
4329 <shortcut>
4330 <keycombo action="simul">&Ctrl;&Enter;</keycombo>
4331 </shortcut>
4332 <guimenu>&XML;</guimenu>
4333 <guimenuitem>Insert Element...</guimenuitem>
4334 </menuchoice></term>
4335 <listitem><para>This will open a dialog that lets you insert an &XML; element.
4336 The &lt;, &gt; characters and the closing tag will be inserted automatically.
4337 If you have selected text when this menu item is selected, the selected
4338 text will be surrounded by the opening and the closing tag.
4339 The dialog also offers completion of all elements that may be inserted
4340 at the current cursor position if you have assigned a meta DTD by
4341 using <guimenuitem>Assign Meta DTD...</guimenuitem>.
4342 </para></listitem>
4343 </varlistentry>
4344 
4345 <varlistentry id="xml-close-element">
4346 <term><menuchoice>
4347 <shortcut>
4348 <keycombo action="simul">&Ctrl;<keycap>&lt;</keycap></keycombo>
4349 </shortcut>
4350 <guimenu>&XML;</guimenu>
4351 <guimenuitem>Close Element</guimenuitem>
4352 </menuchoice></term>
4353 <listitem><para>This will search your text for a tag that is not yet closed
4354 and will close it by inserting the corresponding closing tag.
4355 The search starts at the cursor position and goes left. If
4356 it cannot find an open tag nothing will happen.</para></listitem>
4357 </varlistentry>
4358 
4359 <varlistentry id="xml-assign-metadtd">
4360 <term><menuchoice>
4361 <guimenu>&XML;</guimenu>
4362 <guimenuitem>Assign Meta DTD...</guimenuitem>
4363 </menuchoice></term>
4364 <listitem><para>This will tell the plugin which meta DTD to use for the
4365 current document. Note that this assignment will not be saved.
4366 You will have to repeat it when you start &kate; the next time.</para></listitem>
4367 </varlistentry>
4368 </variablelist>
4369 
4370 </sect2>
4371 
4372 <sect2 id="xmltools-thanks-and-acknowledgements">
4373 <title>Thanks and Acknowledgments</title>
4374 <para>
4375 &kate; Plugin <quote>&XML; Completion</quote> copyright 2001,2002 &Daniel.Naber;
4376 &Daniel.Naber.mail;.
4377 </para>
4378 <para>&kde; SC 4 version copyright 2010 Tomáš Trnka</para>
4379 <para>Documentation copyright 2001,2002 &Daniel.Naber;</para>
4380 </sect2>
4381 </sect1>
4382 
4383 </chapter>