# Working with Plugins

Kate is using two different forms of plugins, namely plugins for the &kate; application and plugins for the &kate; editor component. The latter are available to any application using the editor component, such as KDevelop, Quanta, Kile, Kwrite and many others, while application plugins are specific to the &kate; application.

You can enable both types of plugins in the configuration dialog, which also provides access to additional configuration options for plugins that requires that.

There are many plugins for various purposes available and you can search the web for more. A few plugins are shipped with the editor component, for inserting automatic braces, insert files, data tools and exporting text as &HTML;.

## Editor Component Plugins

The Plugins tab on the Extensions page lists all available plugins and you can check those you want to use. Click on the Information button to open the About dialog of this plugin.

Once a configurable plugin is checked, the Configure button is enabled and you can click it in order to configure the highlighted plugin.

AutoBrace

- The autobrace plugin supersedes the &kate; internal Auto Brackets feature. It automatically inserts a closing brace } at the beginning of the next line after ending a line with an opening one { and pressing the &Enter; key.

Data Tools

- Enables data tools like thesaurus and spell check (if installed). Data tools are only available when text is selected, or when the right mouse button is clicked over a word. If no data tools are offered even when text is selected, you need to install them. Some data tools are part of the &koffice; package. If this plugin is enabled and data tools are installed, additional items appear at the end of the context menu.

Exporter

- This command allows you to export the current document with all highlighting information into a HTML document using File Export as HTML. Additionally you can use Edit Copy as HTML to copy the currently selected text as HTML to the system clipboard.

IconInserter

- The icon inserter plugin is only of use for &kde; developers: It adds an item Insert KIcon-Code into the context menu of the editor. If activated, the &kde;'s icon chooser opens (showing application icons, action icons &etc;..). If you click on it, the file name without file extension will be inserted as text. Useful only for setting icons via &kde;'s framework through the KIcon() class.

Insane (not ZEN) HTML coding (light edition)

- A plugin, which does zen-coding like selector completion. For more information see Zen Coding.

Insert File

- This plugin allows you to insert any readable file at the cursor position. If enabled, the Tools menu has an additional menu item Insert File.

## &kate; Application Plugins

&kate; plugins are additional functions for the &kate; editor. They can add extra menus and shortcuts, and extend &kate;'s features. You can install as many or as few as you like, from within &kate;. Open &kate;'s configuration dialog with Settings Configure &kate;... Select Application Plugins to choose the wanted plugins.

The available application plugins are:

- &gdb; - Provides a simple &gdb; frontend

- Backtrace Browser - Backtrace navigation tool view

- Quick Document switcher - Quickly switch to another already opened document

- SQL Plugin - Execute query on SQL databases

- Search and Replace Plugin - Search or replace patterns in all open files or all files in a folder

- Tab Bar - Adds a standard tab bar to &kate;'s main window

- Text Filter - Easy text filtering

- Symbol Viewer - Extract and show reference symbols from source

- File system browser - File system browser tool view

- Terminal tool view - Toolview embedding a terminal widget

- CTags Plugin - Look up definitions/declarations with CTags

- File Templates - Create new files from templates

- Open Header - Opens the corresponding .h/[.cpp|.c] file

- Build Plugin - Compile or Make and parse error messages

- Mail files - Send files via email

- Multiline Tab Bar - Add a tab bar with multiple rows to &kate;'s main window

- Kate Snippets - Snippets plugin with code completion support

- Jovie Text-to-Speech Plugin - Adds a menu entry for speaking the text

- &XML; Validation- Validates &XML; files using xmllint

- &XML;Completetion - Lists &XML; elements, attributes, attribute values and entities allowed by DTD

- Tabify - Adds a tab bar to Kate's main window

## File Templates

The File Templates plugin allows you to create files based on other files.

When you first install Kate, you need to enable the plugin:

1. Click Settings Configure Kate

2. In the tree on the left of the screen, click Plugins.

3. In the Plugin Manager panel on the right, select File Templates, and then click OK.

You can now use any file as a template (this creates a copy of the file with an empty &URL;.) Special template files can contain macros to fill in information such as your name, email address, the current date, and position the cursor at a convenient position in the new file.

You can easily create a new template from an open document.

Templates that you save to the template folder are listed under the menu item File New from Template.

The template folder is part of the &kde; file system, and consists of at least

- `$`KDEDIR`/share/applications/kate/plugins/katefiletemplates/templates`

- `$`KDEHOME`/share/applications/kate/plugins/katefiletemplates/templates.`

If your `KDEDIRS` environment variable contains additional directories, those are searched for a similar subdirectory as well. If equally named templates are found, the one in the local (KDEHOME) folder is chosen.

### Menu Structure

File New From Template Any File...

- Presents you with Open File dialog that allows you to use any file as a template. If the chosen file has the extension `katetemplate` it will be parsed for template information and macros.

File New From Template

- The remainder of submenus contains links to templates. Click a menuitem to create a file as described by the menu item text.

Settings Manage Templates...

- This will launch a dialog with a list of all templates found within the template directories, along with options to add, edit or remove templates.

### Using a &kate; Template

When creating a file from a template that contain template macros, some macros appears as editable variables in the text. Such variables appears as underlined words in the text.

The first variable will be selected, so you just have to type to edit it. If the document text contains more instances of the same variable, they are changed as you edit. To move to the next editable variable, press the key. When the last variable is edited, the list is dropped, and your key works as normal.

### Creating your own templates

To create a new template, use the Settings Manage Templates Item to launch the template management dialog. In that, click New... to launch the File Template Wizard. You will be asked for an optional file to turn into a template and prompted for template information settings, and a template file will be created for you.

Alternatively, you can create a template manually by adding template information to the top of any file, add text and macros, and save it with the `katetemplate` extension.

The template menu gets automatically updated if you chose to store your template in the template directory.

### Editing templates

To edit a template, use the Settings Manage Templates.... Select the template you want to work on and click Edit..., and the template file will be opened. Close the dialog, edit the template file as desired, save it and close it. Changes to templates takes immediate effect, you can activate the template to test your changes after saving it.

### The &kate; Template Format

If you use files with the extension `katetemplate`, they will be parsed for template information, macros and a cursor position.

#### Template information

While reading in the file, the parser keeps lines beginning with the phrase `katetemplate:` and searches them for template information in the form VARIABLENAME=VALUE. The first line not starting with `katetemplate:` will be taken as the start of the template contents. VALUE may contain any character but equal sign (=). Legal variable names are:

`Template`

- This is the template name, displayed in the File New from Template menu.

`Group`

- The group places the template in a submenu of the File New from Template menu.

`Name`

- This is the name that will be set for the document, and displayed in the file list and title bar. If the name contains `%N` that will be replaced with a number, increasing if more documents has the same name.

`Highlight`

- The plug-in will try to set the Highlight for the new document to the value of this variable. The value should be the name, as found in the Tools Highlighting .

`Description`

- A short informative description of the template. This is currently used to set a Whatsthis string for the menu item, but may be used for more purposes in the future.

Author

- A string identifying the author, for example in the form `Name <email address>`. This is currently used to set a Whatsthis string for the menu item, but may be used for more purposes in the future.

#### Template Macros

While parsing the template contents, macros in the form `%{NAME}` or `${NAME}` are expanded. If you use the `$` prefix, the expanded macro will be treated as a editable variable when a document is created from the template, whereas if you use `%` it is not, unless expanding failed.

The following macros are expanded:

`time`

- Expands to the current time in your locale format.

`date`

- Expands to the current date in short format.

`datetime`

- Expands to the current date and time, formatted as a string according to your locale.

`year`

- The current year as a four digit number.

`month`

- The full name of the current month, according to your locale.

`day`

- Expands to the current day of the month.

`hostname`

- Expands to the 'hostname' of your computer.

`index`

- Expands to 'i'.

`fullname`

- Expands to your full name, as defined by the owner addressee in your standard &kde; addressbook.

`firstname`

- Expands to your first name, as defined in the owner addressee in your standard &kde; addressbook.

`lastname`

- Expands to your last name, as defined in the owner addressee in your standard &kde; addressbook.

email

- Expands to your email address, as defined by the owner address in your standard &kde; addressbook.

Any macro not in the above list is treated as a editable variable no matter the prefix. If the same variable occurs multiple times in the template, they can be edited at once after creating a document from the template.

#### Setting the cursor position

The special macro `${cursor}` will be replaced with a vertical bar and added to the end of the list of editable variables, independent on its location in the text.

### Thanks and Acknowledgments

&kate; Plugin File Templates copyright 2004 &Anders.Lund; &Anders.Lund.mail;.

Documentation copyright 2004 &Anders.Lund;

## &XML; Validation

This plugin checks &XML; files for well-formedness and validity.

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

If the file has no doctype it will be checked for well-formedness.

To learn more about &XML; check out the official W3C &XML; pages.

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

A temporary file needs to be written to the same folder as the file that should be checked, so you need to have write access to that folder.

To load this plugin open &kate;s configuration dialog under Settings Configure &kate;.... Then select XML Validation which will appear in the Application / Plugins section and close the dialog.

### Menu Structure

XML Validate XML

- This will start the check, as described above.

### Thanks and Acknowledgments

&kate; Plugin XML Validation copyright 2002 &Daniel.Naber; &Daniel.Naber.mail;.

Documentation copyright 2002 &Daniel.Naber;

## &XML; Completion

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

The DTD must exist in &XML; format, as produced by the Perl program `dtdparse`. We will call a DTD in this format meta DTD. Some meta DTDs are supplied. They are installed in `$KDEDIR/share/apps/katexmltools/`, which is also the default folder when you choose Assign Meta DTD.... To produce your own meta DTDs, get `dtdparse` from http://dtdparse.sourceforge.net.

### How to Use

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

You can now use the plugin while typing your text:

< (less than key)

- This will trigger a list of possible elements unless the cursor is inside a tag already. Note that you currently cannot use this to insert the top level element (⪚ <html>).

</(less than key + slash)

- Entering these characters will offer closing the current element (nearest open one to the left of the cursor). Press &Enter; to accept the suggestion. Unlike the Close Element menu item, this works only with a DTD assigned.

" (quote key)

- The quote key will trigger a list of possible attribute values (if there are some) if you are inside a tag.

(space key)

- This key will trigger a list of possible attributes for the current element if you are inside a tag.

& (ampersand key)

- This key will trigger a list of named entities.

### Features and Limitations

You can test all functions and limitations by loading `$KDEDIR/share/apps/katexmltools/testcases.xml` into &kate; and following the instructions.

### Menu Structure

&Ctrl;Return XML Insert Element...

- This will open a dialog that lets you insert an &XML; element. The <, > characters and the closing tag will be inserted automatically. If you have selected text when this menu item is selected, the selected text will be surrounded by the opening and the closing tag. The dialog also offers completion of all elements that may be inserted at the current cursor position if you have assigned a meta DTD by using Assign Meta DTD....

&Ctrl;< XML Close Element

- This will search your text for a tag that is not yet closed and will close it by inserting the corresponding closing tag. The search starts at the cursor position and goes left. If it cannot find an open tag nothing will happen.

XML Assign Meta DTD...

- This will tell the plugin which meta DTD to use for the current document. Note that this assignment will not be saved. You will have to repeat it when you start &kate; the next time.

### Thanks and Acknowledgments

&kate; Plugin &XML; Completion copyright 2001,2002 &Daniel.Naber; &Daniel.Naber.mail;.

KDE SC 4 version copyright 2010 Tomáš Trnka

Documentation copyright 2001,2002 &Daniel.Naber;

## Quick Document Switcher

### Menu Structure

&Ctrl;1 Go Quickswitch

- Opens the Document Quick Switch dialog with a search field and a list of opened files. While entering text in the search field the document names and document urls are searched for matching text. While entering text in the search field you can use the cursor keys Up and Down to navigate in the list view. If the dialog is left with OK the plugin switches the view to the document selected in the list view. This makes switching between documents easier, if there are a lot of them open.

## Exporter

### Menu Structure

File Export as HTML...

- Export your file in &HTML; format so your document can be viewed as a web page.

Edit Copy as HTML...

- Copies selected text with the syntax highlight as HTML text.

## Search and Replace

### Introduction

&kappname;'s Search in Files plugin allows you to search for text or regular expressions in many different files at once. You can search all open files, or all the files in one directory, and optionally its subdirectories. You can even filter by filename, for instance searching only files that end with a particular file extension.

### Interface

#### Search Query

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

New Tab

- You can have as many searches as you want open at the same time. Simply click the New Tab button at the top-left corner of the Search tool view and a new results tab will open permitting you to perform another search.

Query

- The long text box at the top is where you type in what you want to find. You may enter standard text, or a regular expression if enabled.

Search

- When you've finished configuring everything, just press the Search button to perform your search. You may also press &Enter; in the Query text box to do the same.

Location

- This has two options. Select in Open Files to search all files currently open in &kappname;. Select in Folder to search inside a folder and optionally its subfolders.

Options

- There are two available options. If enabled, Match case will restrict search results to only those that have the exact same combination of upper and lower-case letters as your search query. Regular expressions permits you to use regular expressions instead of simple text as your search query.

Toggle Results

- The down arrow in the top right-corner of the Search in Files tool view will toggle the bottom half of the tool view between displaying additional options for the Search in Folder mode and the results of your search.

#### Search in Folder Options

These options are displayed below the aforementioned query options. If search results are being displayed instead, press the Toggle Results button to display them. These options apply only when Search in Folder mode is enabled. If Search in Open Files is selected, they will be disabled.

Folder

- You may enter the path of the folder you wish to search. For instance, you might enter `~/development/kde/kate/` if you wished to search the &kate; source code.

Open file dialog

- Press this button to locate for the folder in your desktop's folder browser.

Up

- Press this button to change Folder to the parent of the currently selected folder.

Restore Current Folder

- This button will set the Folder entry to the folder in which the currently open document is located.

Filter

- This permits you to only search filenames that match a particular pattern. For instance, to only search files written in C++, change it to `*.cpp`. To search only files beginning with `kate`, change it to `kate*`. You can enter multiple filters separated with a comma (`,`). To use this to exclude files from the search, append a minus sign (`-`) to the list.

Recursive

- If this option is enabled, &kappname; will also search in all subfolders of the selected folder.

Include hidden

- If this option is enabled, &kappname; will also search in files or folders that are typically hidden by your &OS;.

Follow symbolic links

- The Search in Files plugin typically doesn't follow symbolic links. When this option is enabled, the plugin will follow them instead and search inside the files or folders they reference.

  It's possible for symbolic links to reference a folder that is the parent of the folder currently being searched, or other folders that contain symbolic links to their parent. If there is such a link in the folder being searched and this option is enabled, &kappname; will repeatedly follow the link and search the folder, and the search will never complete.

#### Search Results

The results of your search are displayed below the query options. If options for Search in Folder mode are displayed, simply press the Toggle Results button to display them. They will also automatically be displayed as soon as a search is performed.

The search results displays three columns providing information about each result of your search query. The File column shows the name of the file. The Line column displays the line number the contents of your query were found in. The Text column displays the full text of that line.

To open the file your result was found in, simply double-click it. &kappname; will open the file if needed, and place the cursor at the beginning of the text entered as your query as found in the file.

### Menu Structure

View Tool Views Show Search in Files

- Toggle the display of &kappname;'s Search in Files tool.

## Mail Files

### Menu Structure

File Mail...

- Open your mail client and attach the file in the mail.

## Filesystem Browser

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

### Menu Structure

View Tool Views Show Filesystem Browser

- Toggle the display of &kate;'s Filesystem Browser

### Interface

From top down, the Filesystem Browser consist of the following elements:

A Toolbar

- This contains standard navigations tool buttons:

  Back

- Causes the folder view to `cd` to the previously displayed folder in the history. This button is disabled, if there is no previous item.

Forward

- Causes the folder view to `cd` to the next folder in the history. This button is disabled, if there is no next folder.

Bookmarks

- Opens a submenu to edit or add bookmarks and to add a new bookmark folder.

Current Document Folder

- This button will cause the folder view to `cd` to the folder of the currently active document if possible. This button is disabled, if the active document is a new, unsaved file, or the folder in which it resides can not be decided.

Options

- Short View

- Displays only the filenames.

Detailed View

- Displays Name, Date, Size and Type of the files.

Tree View

- Like Short View, but folders can be expanded to view their contents.

Detailed Tree View

- This also allows folders to be expanded, but displays the additional columns available in Detailed View.

Show Hidden Files

- Displays files normally hidden by your operating system.

Automatically synchronize with current document

- When this option is enabled the filesystem browser will automatically `cd` to the folder of the document currently open in the editing area every time it changes.

A Location Entry

- This displays a breadcrumb navigation to the currently open folder, like &dolphin;. You can click on a any folder to browse to it, or click on one of the arrows to the left of a folder to select any folders beneath it. You may also select from your list of Places by clicking the leftmost icon in the breadcrumb navigation, which displays an icon that represents your current Place.

  You can also click to the right of the breadcrumbs to change them to a text box where you can type the path of a folder to browse. The &URL; entry maintains a list of previously typed paths. To choose one, use the arrow button to the right of the entry.

  The &URL; entry has folder auto-completion. The completion method can be set using the &RMB; menu of the text entry.

A Folder View

- This is a standard &kde; folder view.

A Filter Entry

- The Filter entry allows you to enter a filter for the files displayed in the folder view. The filter uses standard globs; patterns must be separated by white space. Example: `*.cpp *.h *.moc`

  To display all files, enter a single asterisk `*`.

  The filter entry saves the last 10 filters entered between sessions. To use one, press the arrow button on the right of the entry and select the desired filter string. You can disable the filter by pressing the Clear text button to the left of the autocompletion arrow button.

### Configuration

This plugin can be configured on the Filesystem Browser page of &kate;'s configuration.

Toolbar

- Configure the buttons on the file system browser toolbar by moving the ones you want enabled to the Selected Actions list, and order them using the arrow buttons at the side of the list.

## Kate Snippets

### Introduction

Kate Snippets is a plugin used to save you some time by adding support for so-called "snippets" (re-usable source code, machine code or text). The plugin also supports code completion and QtScript.

### Menu Structure

View Tool Views Show Kate Snippets

- Shows snippets panel containing all snippets in your repository that are for the currently opened file type.

### Configuration

The configuration for Kate Snippets can be accessed in Settings Configure Kate, in Kate Snippets under Application.

Kate Snippets Configuration The Kate snippets configuration panel.

The configuration panel for Kate Snippets.

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

#### Loading Snippet Repository Files

You can download snippet repositories from the Internet. Just click Get New Snippets and a window with a list of snippet repositories will open. After downloading the desired snippet, make sure that you have activated it.

You can also load snippet repositories from a local file using the file browser at the bottom of the panel. Click Copy to repository when finished.

#### Creating and Editing Snippets

Snippet Editor The snippet editor.

The snippet editor interface.

To create a new snippet repository, click New Snippet File. You should now see dialog that asks for name of the snippet file, license and author. After choosing the desired options, click Create, and the snippet editor will open.

The snippet editor contains the following options:

File Type

- Select the file type(s) you want the snippet repository to apply to. It is set to * by default, so the repository applies to all files. You can change it to something like `C++` for instance, or select from a list by hitting the Edit. You can specify more than one file type by separating them with `;`.

Authors

- Enter the name(s) of the author(s) of the snippet file.

Snippets List

- Contains all snippets defined in the snippet file. You can simply click on a snippet listed there to edit it.

Add (+)

- Used to add a new snippet.

Delete (-)

- Used to delete a snippet.

Match/Name

- Appears in the list of snippets in the tool view and is also searched when using the code completion feature.

Display Prefix, Display Postfix, and Display Arguments

- Used to display helpful information while using code completion. The prefix and postfix are displayed before and after the name, while the arguments are displayed in parenthesis immediately after the name.

Snippet Content

- Reusable text or code. This is what appears in your document when the snippet is used.

In Snippet Content you can specify variables with `${`name`}` or `%{`name`}`. These can be filled by QtScript or when the snippet is used. There is a special variable - ${cursor} or %{cursor} - which automatically sets the cursor to its first occurrence.

### Using Snippets

Kate Snippets in Action Accessing Kate Snippets from a tool view and a drop down menu.

Selecting from a list of snippets.

You can call snippets in two ways:

- By choosing the snippet from the tool view.

- While writing, you can press &Ctrl; Space, which will display all the snippets in a convenient window from which you can choose from. You may enter the beginning of the snippets name before or after pressing this key combination, which provides functionality similar to code completion.

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

### Thanks and Acknowledgments

Kate Snippets was written by Joseph Wenninger.

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

## Build Plugin

### Introduction

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

### Using the Build Plugin

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

The Build Output tool view has three tabs:

- Errors & Warnings

- Output

- Target Settings

#### Target Settings tab

The target settings tab can be used to configure various build targets.

Each target contains four configuration options:

Working Directory

- You can set the path to the project here. Leave this empty to use the directory the current document is located in.

Build

- This option lets you define the build command. It is set to `make` by default.

Clean

- The option lets you define the clean command. It is set to `make clean` by default.

Quick Compile

- This option lets you define the quick compile command. It is set to `gcc -Wall -g %f` by default.

One can create a new target by using the New button. The Copy button can be used to make a copy of an existing target. To delete a target, use the Delete button.

#### Output tab

The Output tab shows the console output generated by the last command.

#### Errors & Warnings

The Errors & Warnings tab lists the errors and warnings generated by the last command.

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

To navigate to the previous error, press &Ctrl;&Alt;Left. To navigate to the next error, press &Ctrl;&Alt;Right.

### Menu Structure

Build Build

- Runs the Build command for the currently selected target.

Build Clean

- Runs the Clean command for the currently selected target.

Build Quick Compile

- Runs the Quick Compile command for the currently selected target.

&Ctrl;&Alt;Left Build Previous Error

- Moves the cursor to the location of the previous error in the document.

&Ctrl;&Alt;Right Build Next Error

- Moves the cursor to the location of the next error in the document.

Build Targets

- Select from a list of targets configured by the user.

Build Next Target

- Switch to the next target configured by the user.

### Thanks and Acknowledgments

The &kate; Build Plugin was written by Kåre Särs.

Special thanks to Google Code-In 2011 participant Salma Sultana for writing much of this section.

## SQL Plugin

### Introduction

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

The Kate SQL Plugin allows you to:

- Create a database

- Connect to existing databases

- Insert and delete data in the database

- Execute queries

- Display results in a table

### Connecting to a Database

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

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

Finally, give a name to your connection, and press Finish.

### Running Queries

#### INSERT/DELETE/UPDATE

You can insert, delete, and update data using the SQL plugin just like you would from the command line or from within a program. Simply enter a query and press the Run query.

##### Some Example Queries

`INSERT`

-     INSERT INTO table_name ("feature1", "feature2", "feature3", "feature4", "feature5")
      VALUES ("value1", "value2", "value3", "value4", "value5" )

`DELETE`

-     DELETE FROM table_name WHERE name = "text"

`UPDATE`

-     UPDATE table_name SET "feature1" = "text", "feature2" = "text", "feature3" = "text", "feature4" = "text", "feature5" = "text"

#### SELECT

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

##### Example `SELECT` Query

    SELECT * FROM table_name

In the SQL Data Output tool view, there are some buttons:

Resize columns to contents

- Changes the size of columns to fit their contents.

Resize rows to contents

- Changes the size of rows to fit their contents.

Copy

- Selects all table contents and copies them to the clipboard buffer.

Export

- Exports all table contents to a file, the clipboard, or the current document in the Comma Separated Values format.

Clear

- Removes everything from table view

You can now change the colors displayed in the table in the SQL section of Settings Configure Kate .

### Browsing

You can browse your database using the SQL Schema Browser tool view on the left. The information displayed varies depending on which database driver you are using.

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

### Menu Structure

SQL Add connection...

- Adds a new connection using any database driver.

SQL Remove connection

- Removes the selected connection.

SQL Edit connection...

- Edits the current connection's settings.

Connections

- All database connections you have created are listed between the Edit connection and Run query menu items. Select one to run queries or make modification to it.

&Ctrl;E SQL Run query

- Runs your query.

### Thanks and Acknowledgments

The SQL Plugin was written by Marco Mentasti.

Special thanks to Google Code-In 2011 participant Ömer Faruk ORUÇ for writing much of this section.

## &gdb; Plugin

### Introduction

&kappname;'s &gdb; plugin provides a simple frontend to the popular &GNU; Project Debugger.

Previous experience with &gdb; is strongly recommended. For more information on using &gdb;, visit the &gdb; website

You can enable the &gdb; plugin in the Plugins section of &kappname;'s configuration.

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

If you compile using &gcc;/`g++` you might want to use the ``-ggdb`` command line argument.

After these preparations are made, open the source file in &kappname;, enter the path to the executable in Settings tab of the Debug View tool view, and select Debug Start Debugging from the menu to get started.

### Menu and Toolbar Structure

All of these options are available in &kappname;'s menus, and many are available on the Debug toolbar as well.

View Tool View Show Debug View

- Shows a tool view containing &gdb; output, the &gdb; command line used, and other settings.

View Tool View Show Locals

- Shows a list of all currently loaded variables and their values.

View Tool View Show Call Stack

- Shows a &gdb; backtrace.

Debug Targets

- A submenu containing a list of targets (executables).

Debug Arg Lists

- A submenu containing all argument lists.

Debug Start Debugging

- Starts &gdb; with a target.

Debug Kill / Stop Debugging

- Stops &gdb;.

Debug Restart Debugging

- Restarts &gdb;.

Debug Toggle Breakpoint / Break

- Set a breakpoint at the current cursor position.

Debug Step In

- Execute the present statement (function call will be debugged).

Debug Step Over

- Execute the present statement (function call will not be debugged).

Debug Step Out

- Resumes execution until the program that is executing terminates.

Debug Move PC

- Move program counter (next execution).

Debug Run To Cursor

- Runs the program until it reaches current cursor position.

Debug Continue

- Ignores any breakpoints and executes program until it terminates (successfully or not).

Debug Print Value

- Prints the value of the variable that the cursor is currently pointing to.

Settings Toolbars Shown&gdb; Plugin

- Display the debugging toolbar.

### Debug View

The Debug View tool view consists of several tabs:

&gdb; Output

- Contains output from &gdb; and a &gdb; command line.

  The Output Tab The Output tab.

  The Output tab displaying the output from a debugging session.

Settings

- Target

- Path to the target (executable) for debugging.

Working Directory

- The current working directory provided to the target.

Arg List

- Arguments passed to the program.

Keep focus

- Keeps focus on the &gdb; command line.

Redirect IO

- Opens a new IO tab in the Debug View where you can view output and provide input to the running program.

The Settings Tab The Settings tab.

The Settings tab displaying the configuration of a debugging session.

IO

- Contains an area that displays output from the running program and a command line where you may provide input to it.

  The IO Tab The IO tab.

  The IO tab displaying output from a simple test program.

### Call Stack and Locals

The Call Stack tool view contains list of formated backtrace returned from &gdb;.

The &gdb; Call Stack Tool View The Call Stack tool view.

The &gdb; Plugin's Call Stack tool view.

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

The &gdb; Locals Tool View The Locals tool view.

The &gdb; Plugin's Locals tool view.

### Thanks and Acknowledgments

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