~ubuntu-branches/ubuntu/quantal/kate/quantal-proposed

« back to all changes in this revision

Viewing changes to doc/kate/plugins.docbook

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-14 13:28:06 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111214132806-aa2uf6ri5w2p8ak3
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
<variablelist>
40
40
<varlistentry>
41
41
<term><guilabel>AutoBrace</guilabel></term>
42
 
<listitem><para>The autobrace plugin supersedes the &kate; internal 
43
 
<quote>Auto Brackets</quote> feature. 
44
 
It automatically inserts a closing brace <keycap>}</keycap> at the beginning 
 
42
<listitem><para>The autobrace plugin supersedes the &kate; internal
 
43
<quote>Auto Brackets</quote> feature.
 
44
It automatically inserts a closing brace <keycap>}</keycap> at the beginning
45
45
of the next line after ending a line with an opening one <keycap>{</keycap>
46
46
and pressing the &Enter; key.</para></listitem>
47
47
</varlistentry>
52
52
-->
53
53
<varlistentry>
54
54
<term><guilabel>Data Tools</guilabel></term>
55
 
<listitem><para>Enables data tools like thesaurus and spell check (if installed). 
56
 
Data tools are only available when text is selected, or when the right mouse 
57
 
button is clicked over a word. If no data tools are offered even when text 
58
 
is selected, you need to install them. Some data tools are part of the 
 
55
<listitem><para>Enables data tools like thesaurus and spell check (if installed).
 
56
Data tools are only available when text is selected, or when the right mouse
 
57
button is clicked over a word. If no data tools are offered even when text
 
58
is selected, you need to install them. Some data tools are part of the
59
59
&koffice; package.
60
 
If this plugin is enabled and data tools are installed, additional items 
 
60
If this plugin is enabled and data tools are installed, additional items
61
61
appear at the end of the context menu.</para></listitem>
62
62
</varlistentry>
63
63
<varlistentry>
64
64
<term><link linkend="kate-editor-plugin-exporter"><guilabel>Exporter</guilabel></link></term>
65
 
<listitem><para>This command allows you to export the current document with all highlighting 
66
 
information into a HTML document using <menuchoice><guimenu>File</guimenu><guimenuitem>Export 
 
65
<listitem><para>This command allows you to export the current document with all highlighting
 
66
information into a HTML document using <menuchoice><guimenu>File</guimenu><guimenuitem>Export
67
67
as HTML</guimenuitem></menuchoice>. Additionally you can use <menuchoice><guimenu>Edit</guimenu>
68
 
<guimenuitem>Copy as HTML</guimenuitem></menuchoice> to copy the currently selected text 
 
68
<guimenuitem>Copy as HTML</guimenuitem></menuchoice> to copy the currently selected text
69
69
as HTML to the system clipboard.</para></listitem>
70
70
</varlistentry>
71
71
<varlistentry>
72
72
<term><guilabel>IconInserter</guilabel></term>
73
 
<listitem><para>The icon inserter plugin is only of use for &kde; developers: It adds an item 
74
 
<guimenuitem>Insert KIcon-Code</guimenuitem> into the context menu of the editor. 
75
 
If activated, the &kde;'s icon chooser opens (showing application icons, action icons &etc;..). 
76
 
If you click on it, the file name without file extension will be inserted as 
 
73
<listitem><para>The icon inserter plugin is only of use for &kde; developers: It adds an item
 
74
<guimenuitem>Insert KIcon-Code</guimenuitem> into the context menu of the editor.
 
75
If activated, the &kde;'s icon chooser opens (showing application icons, action icons &etc;..).
 
76
If you click on it, the file name without file extension will be inserted as
77
77
text. Useful only for setting icons via &kde;'s framework through the KIcon() class.
78
78
</para></listitem>
79
79
</varlistentry>
85
85
</varlistentry>
86
86
<varlistentry>
87
87
<term><guilabel>Insert File</guilabel></term>
88
 
<listitem><para>This plugin allows you to insert any readable file at the cursor position. 
89
 
If enabled, the <guimenu>Tools</guimenu> menu has an additional menu item 
 
88
<listitem><para>This plugin allows you to insert any readable file at the cursor position.
 
89
If enabled, the <guimenu>Tools</guimenu> menu has an additional menu item
90
90
<guimenuitem>Insert File</guimenuitem>.</para></listitem>
91
91
</varlistentry>
92
92
<!-- not build any longer in kde 4.5
93
93
<varlistentry>
94
94
<term>Python Encoding check</term>
95
 
<listitem><para>This plugin is always enabled.  
96
 
If you are trying to save a python file as non ASCII, without specifying a 
97
 
correct source encoding line like &eg; <quote># -*- coding: utf-8 -*-</quote>, 
 
95
<listitem><para>This plugin is always enabled.
 
96
If you are trying to save a python file as non ASCII, without specifying a
 
97
correct source encoding line like &eg; <quote># -*- coding: utf-8 -*-</quote>,
98
98
a warning dialog pops up and allows you to add a proper source encoding line for the
99
99
current encoding to the file.
100
100
</para></listitem>
117
117
<para>
118
118
&kate; plugins are additional functions for the &kate; editor.  They can
119
119
add extra menus and shortcuts, and extend &kate;'s features.  You can
120
 
install as many or as few as you like, from within &kate;. 
121
 
Open &kate;'s configuration dialog with 
 
120
install as many or as few as you like, from within &kate;.
 
121
Open &kate;'s configuration dialog with
122
122
<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure &kate;...</guimenuitem></menuchoice>
123
123
Select <menuchoice><guimenu>Application</guimenu><guimenuitem>Plugins</guimenuitem></menuchoice> to
124
124
choose the wanted plugins.
129
129
</para>
130
130
<itemizedlist>
131
131
<listitem>
132
 
<para><link linkend="kate-application-plugin-findinfiles">Find in files tool view</link> - 
133
 
  Toolview allowing to search in all open files or files in the filesystem</para>
134
 
</listitem>
135
 
<listitem>
136
132
<para>GDB - Provides a simple GDB frontend</para>
137
133
<!-- GDB Plugin http://kate-editor.org/2011/06/23/kate-plugin-updates-part-2/-->
138
134
</listitem>
140
136
<para>Backtrace Browser - Backtrace navigation tool view</para>
141
137
</listitem>
142
138
<listitem>
143
 
<para><link linkend="kate-application-plugin-quickswitcher">Quick Document switcher</link> - 
 
139
<para><link linkend="kate-application-plugin-quickswitcher">Quick Document switcher</link> -
144
140
  Quickly switch to another already opened document</para>
145
141
</listitem>
146
142
<listitem>
147
143
<para>SQL Plugin - Execute query on SQL databases</para>
148
144
</listitem>
149
145
<listitem>
150
 
<para>Search Plugin - Find a pattern in files</para>
 
146
<para>Search and Replace Plugin - Search or replace patterns in all open files or all files in a folder</para>
151
147
</listitem>
152
148
<listitem>
153
149
<para>Tab Bar - Adds a standard tab bar to &kate;'s main window</para>
163
159
<para>Symbol Viewer - Extract and show reference symbols from source</para>
164
160
</listitem>
165
161
<listitem>
166
 
<para><link linkend="kate-application-plugin-fsbrowser">File system browser</link> - 
 
162
<para><link linkend="kate-application-plugin-fsbrowser">File system browser</link> -
167
163
  File system browser tool view</para>
168
164
</listitem>
169
165
<listitem>
176
172
<para>CTags Plugin - Look up definitions/declarations with CTags</para>
177
173
</listitem>
178
174
<listitem>
179
 
<para><link linkend="kate-application-plugin-filetemplate">File Templates</link> - 
 
175
<para><link linkend="kate-application-plugin-filetemplate">File Templates</link> -
180
176
  Create new files from templates</para>
181
177
</listitem>
182
178
<listitem>
197
193
<para>Multiline Tab Bar - Add a tab bar with multiple rows to &kate;'s main window</para>
198
194
</listitem>
199
195
<listitem>
200
 
<para>Kate Snippets - Snippets plugin with code completion support</para>
 
196
<para><link linkend="kate-application-plugin-snippets">Kate Snippets</link> - Snippets plugin with code completion support</para>
201
197
</listitem>
202
198
<listitem>
203
199
<para>Jovie Text-to-Speech Plugin - Adds a menu entry for speaking the text</para>
206
202
<para><link linkend="kate-application-plugin-xmlcheck">&XML; Validation</link>- Validates &XML; files using xmllint</para>
207
203
</listitem>
208
204
<listitem>
209
 
<para><link linkend="kate-application-plugin-xmltools">&XML;Completetion</link> - Lists &XML; elements, 
 
205
<para><link linkend="kate-application-plugin-xmltools">&XML;Completetion</link> - Lists &XML; elements,
210
206
attributes, attribute values and entities allowed by DTD</para>
211
207
</listitem>
212
208
<listitem>
334
330
    <para>The first variable will be selected, so you just have to type to edit
335
331
      it. If the document text contains more instances of the same variable,
336
332
      they are changed as you edit. To move to the next editable variable,
337
 
      press the TAB key. When the last variable is edited, the list is
338
 
      dropped, and your TAB key works as normal.</para>
 
333
      press the &Tab; key. When the last variable is edited, the list is
 
334
      dropped, and your &Tab; key works as normal.</para>
339
335
  </sect2>
340
336
 
341
337
  <sect2 id="katefiletemplates-create">
538
534
<sect1 id="kate-application-plugin-xmlcheck">
539
535
<sect1info>
540
536
<authorgroup><author>
541
 
<firstname>Daniel</firstname>
542
 
<surname>Naber</surname>
543
 
<affiliation><address>&Daniel.Naber.mail;</address></affiliation>
 
537
&Daniel.Naber; &Daniel.Naber.mail;
544
538
</author></authorgroup>
545
539
</sect1info>
546
540
 
560
554
 
561
555
<para>To learn more about &XML; check out the <ulink url="http://www.w3.org/XML/"> official W3C &XML; pages</ulink>.</para>
562
556
 
563
 
<para>Internally this plugin calls the external command <command>xmllint</command>, which 
 
557
<para>Internally this plugin calls the external command <command>xmllint</command>, which
564
558
is part of libxml2. If this command is not correctly installed on your system, the plugin
565
559
will not work.</para>
566
560
 
604
598
<sect1 id="kate-application-plugin-xmltools">
605
599
<sect1info>
606
600
<authorgroup><author>
607
 
<firstname>Daniel</firstname>
608
 
<surname>Naber</surname>
609
 
<affiliation><address>&Daniel.Naber.mail;</address></affiliation>
 
601
&Daniel.Naber; &Daniel.Naber.mail;
610
602
</author></authorgroup>
611
603
</sect1info>
612
604
<title>&XML; Completion</title>
619
611
open tag on the left.</para>
620
612
 
621
613
<para>The <acronym>DTD</acronym> must exist in &XML; format, as produced by the Perl program
622
 
<command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>. 
 
614
<command>dtdparse</command>. We will call a DTD in this format <quote>meta DTD</quote>.
623
615
Some meta DTDs are supplied. They are installed in
624
616
<filename class="directory">$KDEDIR/share/apps/katexmltools/</filename>,
625
617
which is also the default folder when you choose
759
751
<sect1 id="kate-application-plugin-quickswitcher">
760
752
<!--<sect1info>
761
753
<authorgroup><author>
762
 
<firstname>T.C.</firstname>
763
 
<surname>Hollingsworth</surname>
764
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
 
754
&TC.Hollingsworth; &TC.Hollingsworth.mail;
765
755
</author></authorgroup>
766
756
</sect1info>-->
767
757
<title>Quick Document Switcher</title>
770
760
<title>Menu Structure</title>
771
761
 
772
762
<variablelist>
773
 
<varlistentry> 
 
763
<varlistentry>
774
764
<term><menuchoice><shortcut><keycombo action="simul">&Ctrl;<keycap>1</keycap>
775
765
</keycombo></shortcut><guimenu>Go</guimenu><guimenuitem>Quickswitch
776
766
</guimenuitem></menuchoice></term>
777
 
<listitem><para>Opens the <guilabel>Document Quick Switch</guilabel> dialog 
778
 
with a search field and a list of opened files. While entering text in the search 
779
 
field the document names and document urls are searched for matching text. 
 
767
<listitem><para>Opens the <guilabel>Document Quick Switch</guilabel> dialog
 
768
with a search field and a list of opened files. While entering text in the search
 
769
field the document names and document urls are searched for matching text.
780
770
While entering text in the search field you can use
781
 
the cursor keys <keysym>Up</keysym> and <keysym>Down</keysym> to navigate in the 
782
 
list view. If the dialog is left with <guilabel>OK</guilabel> the plugin switches 
783
 
the view to the document selected in the list view. This makes switching between 
 
771
the cursor keys <keysym>Up</keysym> and <keysym>Down</keysym> to navigate in the
 
772
list view. If the dialog is left with <guilabel>OK</guilabel> the plugin switches
 
773
the view to the document selected in the list view. This makes switching between
784
774
documents easier, if there are a lot of them open.
785
775
</para></listitem>
786
776
</varlistentry>
792
782
<sect1 id="kate-editor-plugin-exporter">
793
783
<!--<sect1info>
794
784
<authorgroup><author>
795
 
<firstname>T.C.</firstname>
796
 
<surname>Hollingsworth</surname>
797
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
 
785
&TC.Hollingsworth; &TC.Hollingsworth.mail;
798
786
</author></authorgroup>
799
787
</sect1info>-->
800
788
<title>Exporter</title>
833
821
</sect2>
834
822
</sect1>
835
823
 
836
 
<sect1 id="kate-application-plugin-findinfiles">
837
 
<!--<sect1info>
838
 
<authorgroup><author>
839
 
<firstname>T.C.</firstname>
840
 
<surname>Hollingsworth</surname>
841
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
842
 
</author></authorgroup>
843
 
</sect1info>-->
844
 
<title>Find in Files</title>
845
 
 
846
 
<sect2 id="findinfiles-menu">
847
 
<title>Menu Structure</title>
848
 
<variablelist>
849
 
 
850
 
<varlistentry>
851
 
<term>
852
 
<menuchoice>
853
 
<guimenu>Edit</guimenu>
854
 
<guimenuitem>Find in Files...</guimenuitem>
855
 
</menuchoice>
856
 
</term>
857
 
<listitem>
858
 
<para>Launch the <guilabel>Find in Files</guilabel> dialog to allow you to
859
 
search for text in the files of a folder.</para>
860
 
</listitem>
861
 
</varlistentry>
862
 
 
863
 
<varlistentry>
864
 
<term>
865
 
<menuchoice>
866
 
<guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
867
 
<guimenuitem>Show Find in Files</guimenuitem>
868
 
</menuchoice>
869
 
</term>
870
 
<listitem>
871
 
<para>Toggle the display of &kate;'s <guilabel>Find in Files</guilabel> tool.
872
 
</para>
873
 
</listitem>
874
 
</varlistentry>
875
 
 
876
 
</variablelist>
877
 
</sect2>
878
 
</sect1>
879
 
 
880
824
<sect1 id="kate-application-plugin-searchinfiles">
881
825
<sect1info>
882
826
<authorgroup><author>
883
 
<firstname>T.C.</firstname>
884
 
<surname>Hollingsworth</surname>
885
 
<affiliation><address><email>tchollingsworth@gmail.com</email></address></affiliation>
 
827
&TC.Hollingsworth; &TC.Hollingsworth.mail;
886
828
</author></authorgroup>
887
829
</sect1info>
888
 
<title>Search in Files</title>
 
830
<title>Search and Replace</title>
889
831
 
890
832
<sect2 id="searchinfiles-intro">
891
833
<title>Introduction</title>
895
837
and optionally its subdirectories.  You can even filter by filename, for instance
896
838
searching only files that end with a particular file extension.</para>
897
839
 
898
 
<para>The Search in Files plugin is not enabled by default, as it is new in &kappname;
899
 
3.7.  Enable it in the <link linkend="config-dialog-plugins">Plugins</link> panel
900
 
of &kappname;'s settings.  It will replace the old
901
 
<link linkend="kate-application-plugin-findinfiles">Find in Files plugin</link>
902
 
in the next version of &kappname;.</para>
903
 
 
904
840
</sect2>
905
841
 
906
842
<sect2 id="searchinfiles-ui">
1022
958
This permits you to only search filenames that match a particular pattern.  For
1023
959
instance, to only search files written in C++, change it to
1024
960
<userinput>*.cpp</userinput>.  To search only files beginning with
1025
 
<literal>kate</literal>, change it to <userinput>kate*</userinput>.
 
961
<literal>kate</literal>, change it to <userinput>kate*</userinput>.  You can
 
962
enter multiple filters separated with a comma (<userinput>,</userinput>).  To
 
963
use this to exclude files from the search, append a minus sign
 
964
(<userinput>-</userinput>) to the list.
1026
965
</para></listitem>
1027
966
</varlistentry>
1028
967
 
1085
1024
<sect2 id="searchinfiles-menu">
1086
1025
<title>Menu Structure</title>
1087
1026
<variablelist>
1088
 
 
1089
 
<!--<varlistentry>
1090
 
<term>
1091
 
<menuchoice>
1092
 
<guimenu>Edit</guimenu>
1093
 
<guimenuitem>Find in Files...</guimenuitem>
1094
 
</menuchoice>
1095
 
</term>
1096
 
<listitem>
1097
 
<para>Launch the <guilabel>Find in Files</guilabel> dialog to allow you to
1098
 
search for text in the files of a folder.</para>
1099
 
</listitem>
1100
 
</varlistentry>-->
1101
 
 
1102
1027
<varlistentry>
1103
1028
<term>
1104
1029
<menuchoice>
1111
1036
</para>
1112
1037
</listitem>
1113
1038
</varlistentry>
1114
 
 
1115
1039
</variablelist>
1116
1040
</sect2>
1117
1041
</sect1>
1119
1043
<sect1 id="kate-application-plugin-mail">
1120
1044
<!--<sect1info>
1121
1045
<authorgroup><author>
1122
 
<firstname>T.C.</firstname>
1123
 
<surname>Hollingsworth</surname>
1124
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
1125
 
</author></authorgroup>
 
1046
&TC.Hollingsworth; &TC.Hollingsworth.mail;
1126
1047
</sect1info>-->
1127
1048
<title>Mail Files</title>
1128
1049
 
1151
1072
<sect1 id="kate-application-plugin-fsbrowser">
1152
1073
<!--<sect1info>
1153
1074
<authorgroup><author>
1154
 
<firstname>T.C.</firstname>
1155
 
<surname>Hollingsworth</surname>
1156
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
 
1075
&TC.Hollingsworth; &TC.Hollingsworth.mail;
1157
1076
</author></authorgroup>
1158
1077
</sect1info>-->
1159
1078
<title>Filesystem Browser</title>
1230
1149
</varlistentry>
1231
1150
<varlistentry>
1232
1151
<term><guimenuitem>Detailed View</guimenuitem></term>
1233
 
<listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel>, 
 
1152
<listitem><para>Displays <guilabel>Name</guilabel>, <guilabel>Date</guilabel>,
1234
1153
<guilabel>Size</guilabel> and <guilabel>Type</guilabel> of the files.</para></listitem>
1235
1154
</varlistentry>
1236
1155
<varlistentry>
1326
1245
<sect1 id="kate-application-plugin-exttools">
1327
1246
<!--<sect1info>
1328
1247
<authorgroup><author>
1329
 
<firstname>T.C.</firstname>
1330
 
<surname>Hollingsworth</surname>
1331
 
<affiliation><address>tchollingsworth@gmail.com</address></affiliation>
 
1248
&TC.Hollingsworth; &TC.Hollingsworth.mail;
1332
1249
</author></authorgroup>
1333
1250
</sect1info>-->
1334
1251
<title>External Tools</title>
1509
1426
</sect2>
1510
1427
</sect1>
1511
1428
 
 
1429
<sect1 id="kate-application-plugin-snippets">
 
1430
<sect1info>
 
1431
<authorgroup>
 
1432
<author><firstname>Martin</firstname> <surname>Gergov</surname></author>
 
1433
<author>&TC.Hollingsworth; &TC.Hollingsworth.mail;</author>
 
1434
</authorgroup>
 
1435
</sect1info>
 
1436
<title>Kate Snippets</title>
 
1437
 
 
1438
<sect2 id="snippets-intro">
 
1439
<title>Introduction</title>       
 
1440
<para>Kate Snippets is a plugin used to save you some time by adding support for
 
1441
so-called "snippets" (re-usable source code, machine code or text). The plugin
 
1442
also supports code completion and QtScript.</para>
 
1443
</sect2>
 
1444
 
 
1445
<sect2 id="snippets-menu">
 
1446
<title>Menu Structure</title>
 
1447
 
 
1448
<variablelist>
 
1449
<varlistentry>
 
1450
<term><menuchoice><guimenu>View</guimenu><guisubmenu>Tool Views</guisubmenu>
 
1451
<guimenuitem>Show Kate Snippets</guimenuitem></menuchoice></term>
 
1452
<listitem><para>Shows snippets panel containing all snippets in your repository
 
1453
that are for the currently opened file type.</para></listitem>
 
1454
</varlistentry>
 
1455
</variablelist>
 
1456
 
 
1457
</sect2>
 
1458
 
 
1459
<sect2 id="snippets-config">
 
1460
<title>Configuration</title>
 
1461
 
 
1462
<para>The configuration for Kate Snippets can be accessed in <menuchoice>
 
1463
<guimenu>Settings</guimenu><guimenuitem>Configure Kate</guimenuitem></menuchoice>,
 
1464
in <guilabel>Kate Snippets</guilabel> under <guilabel>Application</guilabel>.</para>
 
1465
 
 
1466
<screenshot id="screenshot-snippets-config">
 
1467
<screeninfo>Kate Snippets Configuration</screeninfo>
 
1468
<mediaobject>
 
1469
<imageobject><imagedata fileref="snippets-config.png" format="PNG"/></imageobject>
 
1470
<textobject><phrase>The Kate snippets configuration panel.</phrase></textobject>
 
1471
<caption><para>The configuration panel for Kate Snippets.</para></caption>
 
1472
</mediaobject>
 
1473
</screenshot>
 
1474
 
 
1475
<para>In the configuration panel you should see a list of snippet repositories,
 
1476
along with options to create your own, get them from the Internet or load
 
1477
them from a local file.  Each repository has a checkbox that can be used to
 
1478
activate or deactivate it.  There are also buttons to edit and delete existing
 
1479
repositories.</para>
 
1480
 
 
1481
<sect3 id="snippets-repo-internet">
 
1482
<title>Loading Snippet Repository Files</title>
 
1483
<para>You can download snippet repositories from the Internet.  Just click 
 
1484
<guibutton>Get New Snippets</guibutton> and a window with a list of snippet 
 
1485
repositories will open.  After downloading the desired snippet, make sure that
 
1486
you have activated it.</para>
 
1487
 
 
1488
<para>You can also load snippet repositories from a local file using the file
 
1489
browser at the bottom of the panel.  Click <guibutton>Copy to repository</guibutton>
 
1490
when finished.</para>
 
1491
</sect3>
 
1492
 
 
1493
<sect3 id="snippets-repo-editor">
 
1494
<title>Creating and Editing Snippets</title>
 
1495
 
 
1496
<screenshot id="screenshot-snippets-form">
 
1497
<screeninfo>Snippet Editor</screeninfo>
 
1498
<mediaobject>
 
1499
<imageobject><imagedata fileref="snippets-form.png" format="PNG"/></imageobject>
 
1500
<textobject><phrase>The snippet editor.</phrase></textobject>
 
1501
<caption><para>The snippet editor interface.</para></caption>
 
1502
</mediaobject>
 
1503
</screenshot>
 
1504
 
 
1505
<para>To create a new snippet repository, click <guibutton>New Snippet File</guibutton>.
 
1506
You should now see dialog that asks for name of the snippet file, license and 
 
1507
author.  After choosing the desired options, click <guibutton>Create</guibutton>,
 
1508
and the snippet editor will open.</para>
 
1509
 
 
1510
<para>The snippet editor contains the following options:</para>
 
1511
 
 
1512
<variablelist>
 
1513
<varlistentry>
 
1514
<term><guilabel>File Type</guilabel></term>
 
1515
<listitem><para>Select the file type(s) you want the snippet repository to apply
 
1516
to.  It is set to <quote>*</quote> by default, so the repository applies to all files.  You 
 
1517
can change it to something like <userinput>C++</userinput> for instance, or select
 
1518
from a list by hitting the <guibutton>Edit</guibutton>.  You can specify more
 
1519
than one file type by separating them with <userinput>;</userinput>.</para></listitem>
 
1520
</varlistentry>
 
1521
 
 
1522
<varlistentry>
 
1523
<term><guilabel>Authors</guilabel></term>
 
1524
<listitem><para>Enter the name(s) of the author(s) of the snippet file.</para></listitem>
 
1525
</varlistentry>
 
1526
 
 
1527
<varlistentry>
 
1528
<term>Snippets List</term>
 
1529
<listitem><para>Contains all snippets defined in the snippet file.  You can
 
1530
simply click on a snippet listed there to edit it.</para></listitem>
 
1531
</varlistentry>
 
1532
    
 
1533
<varlistentry>
 
1534
<term>Add (<guibutton>+</guibutton>)</term>
 
1535
<listitem><para>Used to add a new snippet.</para></listitem>
 
1536
</varlistentry>
 
1537
 
 
1538
<varlistentry>
 
1539
<term>Delete (<guibutton>-</guibutton>)</term>
 
1540
<listitem><para>Used to delete a snippet.</para></listitem>
 
1541
</varlistentry>
 
1542
 
 
1543
<varlistentry>
 
1544
<term><guilabel>Match/Name</guilabel></term>
 
1545
<listitem><para>Appears in the list of snippets in the tool view and is also
 
1546
searched when using the code completion feature.</para></listitem>
 
1547
</varlistentry>
 
1548
 
 
1549
<varlistentry>
 
1550
<term><guilabel>Display Prefix</guilabel>, <guilabel>Display Postfix</guilabel>,
 
1551
and <guilabel>Display Arguments</guilabel></term>
 
1552
<listitem><para>Used to display helpful information while using code completion.
 
1553
The prefix and postfix are displayed before and after the name, while the arguments
 
1554
are displayed in parenthesis immediately after the name.</para></listitem>
 
1555
</varlistentry>
 
1556
 
 
1557
<varlistentry>
 
1558
<term><guilabel>Snippet Content</guilabel></term>
 
1559
<listitem><para>Reusable text or code.  This is what appears in your document
 
1560
when the snippet is used.</para></listitem>
 
1561
</varlistentry>
 
1562
 
 
1563
</variablelist>
 
1564
 
 
1565
<para>In <guilabel>Snippet Content</guilabel> you can specify variables with 
 
1566
<userinput>${<replaceable>name</replaceable>}</userinput> or
 
1567
<userinput>%{<replaceable>name</replaceable>}</userinput>.  These can be filled
 
1568
by QtScript or when the snippet is used.  There is a special variable - 
 
1569
${cursor} or %{cursor} - which automatically sets the cursor to its first 
 
1570
occurrence.</para>
 
1571
 
 
1572
</sect3>
 
1573
</sect2>
 
1574
 
 
1575
<sect2 id="snippets-using">
 
1576
<title>Using Snippets</title>
 
1577
 
 
1578
<screenshot id="screenshot-snippets-usage">
 
1579
<screeninfo>Kate Snippets in Action</screeninfo>
 
1580
<mediaobject>
 
1581
<imageobject><imagedata fileref="snippets-usage.png" format="PNG"/></imageobject>
 
1582
<textobject><phrase>Accessing Kate Snippets from a tool view and a drop down menu.</phrase></textobject>
 
1583
<caption><para>Selecting from a list of snippets.</para></caption>
 
1584
</mediaobject>
 
1585
</screenshot>
 
1586
 
 
1587
<para>You can call snippets in two ways:</para>
 
1588
 
 
1589
<itemizedlist>
 
1590
<listitem><para>By choosing the snippet from the tool view.</para></listitem>
 
1591
<listitem><para>While writing, you can press <keycombo action="simul">&Ctrl;
 
1592
<keysym>Space</keysym></keycombo>, which will display all the snippets in a
 
1593
convenient window from which you can choose from.  You may enter the beginning
 
1594
of the snippets name before or after pressing this key combination, which provides
 
1595
functionality similar to code completion.</para></listitem>
 
1596
</itemizedlist>
 
1597
 
 
1598
<para>If the snippet contains variables (besides <literal>${cursor}</literal>)
 
1599
the cursor will automatically go to the first occurrence of a variable and will
 
1600
wait for you to write something. When you are done, you can press &Tab; to move
 
1601
to the next variable, and so on.</para>
 
1602
 
 
1603
</sect2>
 
1604
 
 
1605
<sect2 id="snippets-ack">
 
1606
<title>Thanks and Acknowledgments</title>
 
1607
<para>Special thanks to Google Code-In 2011 participant Martin Gergov for
 
1608
writing much of this section.</para>
 
1609
</sect2>
 
1610
 
 
1611
</sect1>
 
1612
 
1512
1613
<!--
1513
1614
Missing (according to config docs)
1514
 
Additional pages for enabled plugins: 
1515
 
Kate Snippets
 
1615
Additional pages for enabled plugins:
1516
1616
Backtrace Browser
1517
1617
Symbol Viewer
1518
1618
-->