PageRenderTime 50ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/42docs/users-guide/abbrevs.html

#
HTML | 52 lines | 52 code | 0 blank | 0 comment | 0 complexity | c0c7d2dcbe133ae8e5853461fefb2b8d MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Abbreviations</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="jEdit 4.2 User's Guide"><link rel="up" href="source-edit.html" title="Chapter 6. Editing Source Code"><link rel="previous" href="bracket-matching.html" title="Bracket Matching"><link rel="next" href="folding.html" title="Folding"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Abbreviations</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bracket-matching.html">Prev</a> </td><th width="60%" align="center">Chapter 6. Editing Source Code</th><td width="20%" align="right"> <a accesskey="n" href="folding.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="abbrevs"></a>Abbreviations</h2></div></div><div></div></div><p>
  2. Using abbreviations reduces the time spent typing long but commonly used
  3. strings. For example, in Java mode, the abbreviation &#8220;<span class="quote">sout</span>&#8221; is
  4. defined to expand to &#8220;<span class="quote">System.out.println()</span>&#8221;, so to insert
  5. &#8220;<span class="quote">System.out.println()</span>&#8221; in a Java buffer, you only need to type
  6. &#8220;<span class="quote">sout</span>&#8221; followed by <tt class="keycap">C+;</tt>.
  7. An abbreviation can either be global, in which case it can be used in all
  8. edit modes, or specific to a single mode.
  9. </p><p>
  10. Abbreviations can be edited in the <span><b class="guibutton">Abbreviations</b></span> pane of the
  11. <span><b class="guimenu">Utilities</b></span>&gt;<span><b class="guimenuitem">Global Options</b></span>
  12. dialog box; see <a href="global-opts.html#abbrevs-pane" title="The Abbreviations Pane">the section called &#8220;The Abbreviations Pane&#8221;</a>. The Java, VHDL. XML and XSL edit
  13. modes include some pre-defined abbreviations you might find useful. Other
  14. modes do not have any abbreviations defined by default.
  15. </p><p>
  16. <span><b class="guimenu">Edit</b></span>&gt;<span><b class="guimenuitem">Expand Abbreviation</b></span>
  17. (keyboard shortcut: <tt class="keycap">C+;</tt>)
  18. attempts to expand the abbreviation named by the word before the caret.
  19. If no expansion could be found, it will offer to define one.
  20. </p><p>
  21. Automatic abbreviation expansion can be enabled in the
  22. <span><b class="guibutton">Abbreviations</b></span> pane of the
  23. <span><b class="guimenu">Utilities</b></span>&gt;<span><b class="guimenuitem">Global Options</b></span>
  24. dialog box. If enabled, pressing the
  25. space bar after entering an
  26. abbreviation will automatically expand it.
  27. </p><p>
  28. If automatic expansion
  29. is enabled, a space can be inserted without expanding the word before
  30. the caret by pressing
  31. <tt class="keycap">Control</tt>-<tt class="keycap">E</tt>
  32. <tt class="keycap">V</tt> <tt class="keycap">Space</tt>.
  33. </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="positional-params"></a>Positional Parameters</h3></div></div><div></div></div><p>
  34. Positional parameters are an advanced feature that make abbreviations much
  35. more useful. The best way to describe them is with an example.
  36. </p><p>
  37. Java mode defines an abbreviation &#8220;<span class="quote">F</span>&#8221; that is set to expand to
  38. the following:
  39. </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">for(int $1 = 0; $1 &lt; $2; $1++)</pre></td></tr></table><p>
  40. Expanding <tt class="literal">F#j#array.length#</tt> will insert the following
  41. text into the buffer:
  42. </p><table border="0" bgcolor="#E0E0E0"><tr><td><pre class="programlisting">for(int j = 0; j &lt; array.length; j++)</pre></td></tr></table><p>
  43. Expansions can contain up to nine positional parameters. Note that a
  44. trailing hash character (&#8220;<span class="quote">#</span>&#8221;) must be entered when expanding an
  45. abbreviation with parameters.
  46. </p><p>
  47. If you do not specify the correct number of positional parameters when
  48. expanding an abbreviation, any missing parameters will be
  49. blank in the expansion, and extra parameters will be ignored.
  50. A status bar message will be shown stating
  51. the required number of parameters.
  52. </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bracket-matching.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="source-edit.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="folding.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Bracket Matching </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Folding</td></tr></table></div></body></html>