PageRenderTime 51ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/doc/users-guide/customizing.xml

#
XML | 365 lines | 362 code | 1 blank | 2 comment | 0 complexity | 835715863ad4733483cf399fd3070e5b 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. <!-- jEdit buffer-local properties: -->
  2. <!-- :tabSize=1:indentSize=1:noTabs=true: -->
  3. <chapter id="customizing"><title>Customizing jEdit</title>
  4. <sect1 id="buffer-opts"><title>The Buffer Options Dialog Box</title>
  5. <para>
  6. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Buffer Options</guimenuitem>
  7. displays a dialog box for changing editor settings on a per-buffer basis.
  8. Any changes made in this dialog box are lost after the buffer is
  9. closed.
  10. </para>
  11. <para>
  12. The following settings may be changed here:
  13. </para>
  14. <itemizedlist>
  15. <listitem><para>The line separator (see <xref linkend="line-separators" />)
  16. </para></listitem>
  17. <listitem><para>The character encoding (see <xref linkend="encodings" />)
  18. </para></listitem>
  19. <listitem><para>If the file should be GZipped on disk
  20. (see <xref linkend="opening" />)
  21. </para></listitem>
  22. <listitem><para>The edit mode (see <xref linkend="modes" />)</para></listitem>
  23. <listitem><para>The fold mode (see <xref linkend="folding" />)</para></listitem>
  24. <listitem><para>The wrap mode and margin (see <xref linkend="word-wrap" />)
  25. </para></listitem>
  26. <listitem><para>The tab width (see <xref linkend="indent" />)</para></listitem>
  27. <listitem><para>The indent width</para></listitem>
  28. <listitem><para>If soft tabs should be used
  29. (see <xref linkend="indent" />)
  30. </para></listitem>
  31. </itemizedlist>
  32. </sect1>
  33. <sect1 id="buffer-local"><title>Buffer-Local Properties</title>
  34. <para>
  35. Buffer-local properties provide an alternate way to change editor settings
  36. on a per-buffer basis. While changes made in the Buffer Options dialog box
  37. are lost after the buffer is closed, buffer-local properties take effect
  38. each time the file is opened, because they are embedded in the file
  39. itself.
  40. </para>
  41. <para>
  42. When jEdit loads a file, it checks the first and last 10 lines for
  43. colon-enclosed name/value pairs. The following example changes
  44. the indent width to 4 characters, enables soft tabs, and sets
  45. the buffer's edit mode to Perl:
  46. </para>
  47. <screen>:indentSize=4:noTabs=true:mode=perl:</screen>
  48. <para>
  49. Note that adding buffer-local properties to a buffer only
  50. takes effect after the next time the buffer is loaded.
  51. </para>
  52. <para>
  53. The following table describes each buffer-local property in detail.
  54. </para>
  55. <informaltable>
  56. <tgroup cols="2">
  57. <colspec colnum="1" colwidth="1.5in" />
  58. <thead>
  59. <row>
  60. <entry>Property name</entry>
  61. <entry>Description</entry>
  62. </row>
  63. </thead>
  64. <tbody>
  65. <row>
  66. <entry>collapseFolds</entry>
  67. <entry>Folds with a level of this or higher will be collapsed when the
  68. buffer is opened. If set to zero, all folds will be expanded initially.
  69. See <xref linkend="folding" />.</entry>
  70. </row>
  71. <row>
  72. <entry>folding</entry>
  73. <entry>The fold mode; one of <quote>none</quote>, <quote>indent</quote>,
  74. or <quote>explicit</quote>. See <xref linkend="folding" />.</entry>
  75. </row>
  76. <row>
  77. <entry>indentOnEnter</entry>
  78. <entry>If set to <quote>true</quote>, pressing <keycap>Enter</keycap> will
  79. insert a line break and automatically indent the new line. See
  80. <xref linkend="indent" />.</entry>
  81. </row>
  82. <row>
  83. <entry>indentOnTab</entry>
  84. <entry>If set to <quote>true</quote>, indentation will be performed when
  85. the <keycap>Tab</keycap> key is pressed. See <xref linkend="indent" />.
  86. </entry>
  87. </row>
  88. <row>
  89. <entry>indentSize</entry>
  90. <entry>The width, in characters, of one indent.
  91. Must be an integer greater than 0.
  92. See <xref linkend="indent" />.</entry>
  93. </row>
  94. <row>
  95. <entry>maxLineLen</entry>
  96. <entry>The maximum line length and wrap column position.
  97. Inserting text beyond this column will automatically insert a line
  98. break at the appropriate position.
  99. See <xref linkend="entering-text" />.</entry>
  100. </row>
  101. <row>
  102. <entry>mode</entry>
  103. <entry>The default edit mode for the buffer.
  104. See <xref linkend="modes" />.</entry>
  105. </row>
  106. <row>
  107. <entry>noTabs</entry>
  108. <entry>If set to <quote>true</quote>, soft tabs (multiple space characters)
  109. will be used instead of <quote>real</quote> tabs. See
  110. <xref linkend="indent" />.</entry>
  111. </row>
  112. <row>
  113. <entry>noWordSep</entry>
  114. <entry>A list of non-alphanumeric characters that are
  115. <emphasis>not</emphasis> to
  116. be treated as word separators. Global default is <quote>_</quote>.</entry>
  117. </row>
  118. <row>
  119. <entry>tabSize</entry>
  120. <entry>The tab width. Must be an integer greater than 0.
  121. See <xref linkend="indent" />.</entry>
  122. </row>
  123. <row>
  124. <entry>wordBreakChars</entry>
  125. <entry>Characters, in addition to spaces and tabs, at which lines may be
  126. split when word wrapping.
  127. See <xref linkend="entering-text" />.</entry>
  128. </row>
  129. <row>
  130. <entry>wrap</entry>
  131. <entry>The word wrap mode; one of <quote>none</quote>, <quote>soft</quote>,
  132. or <quote>hard</quote>. See <xref linkend="word-wrap" />.</entry>
  133. </row>
  134. </tbody>
  135. </tgroup>
  136. </informaltable>
  137. </sect1>
  138. <sect1 id="global-opts"><title>The Global Options Dialog Box</title>
  139. <para>
  140. <guimenu>Utilities</guimenu>&gt;<guimenuitem>Global Options</guimenuitem>
  141. displays the global options dialog box. The dialog box is divided into
  142. several panes, each pane containing a set of related options. Use the list
  143. on the left of the dialog box to switch between panes. Only panes
  144. created by jEdit are described here; some plugins add their own option
  145. panes, and information about them can be found in the documentation
  146. for the plugins in question.
  147. </para>
  148. <bridgehead renderas="sect3">The General Pane</bridgehead>
  149. <para>
  150. The <guibutton>General</guibutton> option pane lets you change various
  151. miscellaneous settings, such as the number of recent files to remember,
  152. if the buffer list should be sorted, and so on.
  153. </para>
  154. <bridgehead renderas="sect3">The Appearance Pane</bridgehead>
  155. <para>
  156. The <guibutton>Appearance</guibutton> option pane lets you change the
  157. Swing look and feel, as well as the fonts used to display user interface
  158. controls such as buttons, labels and menus.
  159. </para>
  160. <bridgehead renderas="sect3">The Text Area Pane</bridgehead>
  161. <para>
  162. The <guibutton>Text Area</guibutton> option pane lets you customize the
  163. appearance of the text area.
  164. </para>
  165. <bridgehead renderas="sect3">The Gutter Pane</bridgehead>
  166. <para>
  167. The <guibutton>Gutter</guibutton> option pane lets you customize the
  168. appearance of the gutter.
  169. </para>
  170. <bridgehead renderas="sect3">The Syntax Highlighting Pane</bridgehead>
  171. <para>
  172. The <guibutton>Styles</guibutton> option pane lets you change
  173. the text styles and colors used for syntax highlighting.
  174. </para>
  175. <bridgehead renderas="sect3">The Loading and Saving Pane</bridgehead>
  176. <para>
  177. The <guibutton>Loading and Saving</guibutton> option pane lets you change
  178. settings such as the autosave frequency, backup settings, file encoding,
  179. and so on.
  180. </para>
  181. <bridgehead renderas="sect3">The Editing Pane</bridgehead>
  182. <para>
  183. The <guibutton>Editing</guibutton> option pane lets you change settings such
  184. as the tab size, syntax highlighting and soft tabs on a global basis.
  185. </para>
  186. <bridgehead renderas="sect3">The Mode-Specific Pane</bridgehead>
  187. <para>
  188. The <guibutton>Mode-Specific</guibutton> option pane lets you change settings
  189. such as the tab size, syntax highlighting and soft tabs on a
  190. mode-specific basis.
  191. </para>
  192. <para>
  193. The <guibutton>File name glob</guibutton> and <guibutton>First line
  194. glob</guibutton> text fields let you specify a glob pattern that names and
  195. first lines of buffers will be matched against to determine the edit mode.
  196. </para>
  197. <para>
  198. This option pane does not change XML mode definition files on disk; it
  199. merely writes values to the user properties file which override those
  200. in mode files. To find out how to edit mode files directly, see
  201. <xref linkend="writing-modes-part" />.
  202. </para>
  203. <bridgehead renderas="sect3">The Abbreviations Pane</bridgehead>
  204. <para>
  205. The <guibutton>Abbreviations</guibutton> option pane lets you enable or
  206. disable automatic abbreviation expansion, and edit currently defined
  207. abbreviations.
  208. </para>
  209. <para>
  210. The combo box labeled <quote>Abbrev set</quote> selects the
  211. abbreviation set to edit. The first entry, <quote>global</quote>, contains
  212. abbreviations available in all edit modes. The subsequent
  213. entries contain mode-specific abbreviations.
  214. </para>
  215. <para>
  216. To change an abbreviation or its expansion, either double-click the appropriate
  217. table entry, or click a table entry and then click the
  218. <guibutton>Edit</guibutton> button. This will display a dialog box for
  219. modifying the abbreviation.
  220. </para>
  221. <para>
  222. The <guibutton>Add</guibutton> button displays a dialog box where you can
  223. define a new abbreviation. The <guibutton>Remove</guibutton> button removes
  224. the currently selected abbreviation from the list.
  225. </para>
  226. <para>
  227. See <xref linkend="positional-params" /> for information about positional
  228. parameters in abbreviations.
  229. </para>
  230. <bridgehead renderas="sect3">The Shortcuts Pane</bridgehead>
  231. <para>
  232. The <guibutton>Shortcuts</guibutton> option pane
  233. let you change keyboard shortcuts. Each command can have up to two shortcuts
  234. associated with it.
  235. </para>
  236. <para>
  237. The combo box at the top of the option pane selects the shortcut set
  238. to edit (command, plugin or macro shortcuts).
  239. </para>
  240. <para>
  241. To change a shortcut, click the appropriate table entry and press the
  242. keys you want associated with that command in the resulting dialog box.
  243. The dialog box will warn you if the shortcut is already assigned.
  244. </para>
  245. <bridgehead renderas="sect3">The Docking Pane</bridgehead>
  246. <para>
  247. The <guibutton>Docking</guibutton> option pane lets you specify which
  248. dockable windows should be floating, and which should be docked in the view.
  249. </para>
  250. <bridgehead renderas="sect3">The Context Menu Pane</bridgehead>
  251. <para>
  252. The <guibutton>Context Menu</guibutton> option pane lets you edit the text
  253. area's right-click context menu.
  254. </para>
  255. <bridgehead renderas="sect3">The Tool Bar Pane</bridgehead>
  256. <para>
  257. The <guibutton>Tool Bar</guibutton> option pane lets you edit the tool bar,
  258. or disable it completely.
  259. </para>
  260. <bridgehead renderas="sect3">The Printing Pane</bridgehead>
  261. <para>
  262. The <guibutton>Printing</guibutton> option pane lets you customize the
  263. appearance of printed output.
  264. </para>
  265. <bridgehead renderas="sect3">The Proxy Servers Pane</bridgehead>
  266. <para>
  267. XXX
  268. </para>
  269. <bridgehead renderas="sect3">The File System Browser Panes</bridgehead>
  270. <para>
  271. The <guibutton>File System Browser</guibutton> branch
  272. contains two option panes, <guibutton>General</guibutton> and
  273. <guibutton>Colors</guibutton>. Both of these option panes should be
  274. self-explanatory. See <xref linkend="vfs-browser" />
  275. for more information.
  276. </para>
  277. </sect1>
  278. <sect1 id="settings-directory"><title>The jEdit Settings Directory</title>
  279. <para>
  280. jEdit stores all settings, macros, and so on as files
  281. inside its <firstterm>settings directory</firstterm>. In most cases, editing
  282. these files is not necessary, since graphical tools and commands can do the
  283. job. However, being familiar with the structure of the settings directory
  284. still comes in handy
  285. in certain situations, for example when you want to copy jEdit settings
  286. between computers.
  287. </para>
  288. <para>
  289. The location of the settings directory is system-specific; it is printed to
  290. the activity log (<guimenu>Utilities</guimenu>&gt;<guimenuitem>Activity
  291. Log</guimenuitem>). For example:
  292. </para>
  293. <screen>[message] jEdit: Settings directory is /home/slava/.jedit</screen>
  294. <para>
  295. Specifying the <command>-settings</command> switch on the command line
  296. instructs jEdit to store settings in a different directory.
  297. For example, the following command will instruct jEdit to
  298. store all settings
  299. in the <filename>jedit</filename> subdirectory of the <filename>C:</filename>
  300. drive:
  301. </para>
  302. <screen><prompt>C:\jedit&gt;</prompt> <userinput>jedit -settings=C:\jedit</userinput></screen>
  303. <para>
  304. The <command>-nosettings</command> switch will force jEdit to not look for
  305. or create a settings directory. Default settings will be used instead.
  306. </para>
  307. <para>
  308. If you are using <application>jEditLauncher</application>
  309. to start jEdit on Windows, these parameters cannot be specified on the
  310. MS-DOS prompt command line when starting jEdit; they must be set as described
  311. in <xref linkend="launcher-starting" />.
  312. </para>
  313. <para>
  314. jEdit creates the following files and directories
  315. inside the settings directory; plugins may add more:
  316. </para>
  317. <itemizedlist>
  318. <listitem><para><filename>abbrevs</filename> - a plain text file which
  319. stores all defined abbreviations. See <xref linkend="abbrevs" />.
  320. </para></listitem>
  321. <listitem><para><filename>activity.log</filename> - a plain text file which
  322. contains the full activity log. See <xref linkend="activity-log" />.
  323. </para></listitem>
  324. <listitem><para><filename>history</filename> - a plain text file which
  325. stores history lists, used by history text fields and the
  326. <guimenu>Edit</guimenu>&gt;<guimenuitem>Paste Previous</guimenuitem> command.
  327. See <xref linkend="text-transfer" /> and <xref linkend="history" />.
  328. </para></listitem>
  329. <listitem><para><filename>jars</filename> - this directory contains
  330. plugins. See <xref linkend="using-plugins" />.</para></listitem>
  331. <listitem><para><filename>macros</filename> - this directory contains
  332. macros. See <xref linkend="using-macros" />.</para></listitem>
  333. <listitem><para><filename>modes</filename> - this directory contains custom
  334. edit modes. See <xref linkend="writing-modes-part" />.
  335. </para></listitem>
  336. <listitem><para><filename>PluginManager.download</filename> - this directory
  337. is usually empty. It only contains files while the plugin manager is
  338. downloading a plugin. For information about the plugin manager,
  339. see <xref linkend="using-plugins" />.</para></listitem>
  340. <listitem><para><filename>printspec</filename> - a binary file which
  341. stores printing settings when running under Java 2 version 1.4.
  342. </para></listitem>
  343. <listitem><para><filename>properties</filename> - a plain text file which
  344. stores the majority of jEdit's settings.</para></listitem>
  345. <listitem><para><filename>recent.xml</filename> - an XML file which stores
  346. the list of recently opened files. jEdit remembers the caret position,
  347. selection state and character encoding of each recent file, and
  348. automatically restores those values when one of the files in the list is
  349. opened.</para></listitem>
  350. <listitem><para><filename>server</filename> - a plain text file that only
  351. exists while jEdit is running. The edit server's port number and
  352. authorization key is stored here. See <xref linkend="starting" />.
  353. </para></listitem>
  354. <listitem><para><filename>session</filename> - a list of files, used when
  355. restoring previously open files on startup.</para></listitem>
  356. <listitem><para><filename>settings-backups</filename> - this directory
  357. contains numbered backups of all automatically-written settings files
  358. (<filename>abbrevs</filename>, <filename>activity.log</filename>,
  359. <filename>history</filename>, <filename>properties</filename>,
  360. <filename>recent.xml</filename>, and <filename>session</filename>).
  361. </para></listitem>
  362. </itemizedlist>
  363. </sect1>
  364. </chapter>