PageRenderTime 51ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-2-pre14/doc/users-guide/customizing.xml

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