gaf: Fix memory leak
[geda-gaf.git] / docs / wiki / geda-gschem_ug-config.html
blobb6b4867c8633020485658780c45c759cb34715c3
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html>
4 <head>
5 <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
6 <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
7 <link rel="stylesheet" media="print" type="text/css" href="./print.css" />
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 </head>
11 <body>
12 <a href=.>start</a>&nbsp;=>&nbsp;<a href=geda-gschem_ug.html>gschem_ug</a></br>
13 <div class="table sectionedit1"><table class="inline">
14 <tr class="row0">
15 <td class="col0 leftalign"> &lt;&lt; <a href="geda-gschem_ug-exporting.html" class="wikilink1" title="geda-gschem_ug-exporting.html">Exporting images</a> </td><td class="col1 centeralign"> <strong><a href="geda-gschem_ug.html" class="wikilink1" title="geda-gschem_ug.html">gEDA gschem User Guide</a></strong> </td><td class="col2 rightalign"> <a href="geda-gschem_ug-command_line.html" class="wikilink1" title="geda-gschem_ug-command_line.html">Command-line arguments</a> &gt;&gt; </td>
16 </tr>
17 </table></div>
18 <!-- EDIT1 TABLE [1-135] -->
19 <h2 id="configuringgschem">Configuring gschem</h2>
20 <div class="level2">
22 <p>
23 gschem loads a series of <em>configuration files</em> at start-up, if they exist:
24 </p>
25 <ol>
26 <li class="level1"><div class="li"> The suite&#039;s system configuration file, called <code>$PREFIX/share/gEDA/system-gafrc</code></div>
27 </li>
28 <li class="level1"><div class="li"> The suite&#039;s user configuration file, called <code>$HOME/.gEDA/gafrc</code></div>
29 </li>
30 <li class="level1"><div class="li"> A <code>gafrc</code> in the current working directory.</div>
31 </li>
32 <li class="level1"><div class="li"> gschem&#039;s system configuration file, called <code>$PREFIX/share/gEDA/system-gschemrc</code></div>
33 </li>
34 <li class="level1"><div class="li"> gschem&#039;s user configuration file, called <code>$HOME/.gEDA/gschemrc</code></div>
35 </li>
36 <li class="level1"><div class="li"> A <code>gschemrc</code> in the current working directory.</div>
37 </li>
38 </ol>
40 <p>
41 <code>$PREFIX</code> denotes the base installation directory for gschem (<code>/usr</code> on most systems), and <code>$HOME</code> denotes your home directory.
42 </p>
44 <p>
45 These files are scripts written in Scheme, and they are executed using a Scheme interpreter. This means that you can use the configuration files as a way of customising and extending gschem (see also <a href="geda-gschem_ug-extensions.html" class="wikilink1" title="geda-gschem_ug-extensions.html">Extending gschem</a>).
46 </p>
47 <div class="noteclassic">There are a very large number of options that affect the way gschem works, and only the most commonly-used are listed here. For a full list, see the <code>system-gschemrc</code> installed with gEDA.
48 </div>
49 </div>
51 <h3 id="settingcolors">Setting colors</h3>
52 <div class="level3">
54 <p>
55 gschem uses three different color maps. These are:
56 </p>
57 <ol>
58 <li class="level1"><div class="li"> <em>Display color map</em> — this is the normal color map used for displaying schematics in gschem.</div>
59 </li>
60 <li class="level1"><div class="li"> <em>Display outline color map</em> — this color map is used for objects that are being modified (e.g. during movement or during placement of objects pasted from the clipboard).</div>
61 </li>
62 <li class="level1"><div class="li"> <em>Print color map</em> — used during export to PostScript.</div>
63 </li>
64 </ol>
66 <p>
67 gschem is distributed with some full <a href="geda-gschem_ug-viewing_schematics.html#color_maps" class="wikilink1" title="geda-gschem_ug-viewing_schematics.html">color maps</a>, which are supplied as Scheme scripts. They can be loaded with <code>load</code>; for example, to load the default dark background color map, add the following to a configuration file:
68 </p>
69 <pre class="code">(load (build-path geda-rc-path &quot;gschem-colormap-darkbg&quot;))</pre>
71 <p>
72 You can also set individual colors using the <code>display-color-map</code>, <code>display-outline-color-map</code> and <code>print-color-map</code> functions. For example, to set the display color for nets to a light blue, you could add the following to a configuration file:
73 </p>
74 <pre class="code">(display-color-map &#039;((net &quot;#00ffff&quot;)))</pre>
76 <p>
77 Color settings should be placed in a gschem configuration file.
78 </p>
80 </div>
82 <h3 id="keybindings">Key bindings</h3>
83 <div class="level3">
85 <p>
86 A gschem <a href="geda-gschem_ug-editing_actions.html" class="wikilink1" title="geda-gschem_ug-editing_actions.html">editing action</a> can be bound to a keystroke or a sequence of keystrokes (a <em>key sequence</em>). The <code>global-set-key</code> function is used to modify keybindings.
87 </p>
89 <p>
90 Each keystroke is defined using a string consisting of a non-modifier key name, prefixed by zero or more modifiers surrounded by angle brackets (&quot;<code>&lt;</code>&quot; and &quot;<code>&gt;</code>&quot;). The supported modifiers are <code>&lt;Control&gt;</code>, <code>&lt;Shift&gt;</code>, <code>&lt;Alt&gt;</code>, <code>&lt;Super&gt;</code>, <code>&lt;Hyper&gt;</code> and <code>&lt;Meta&gt;</code> (these are not available on all keyboards).
91 </p>
92 <div class="noteimportant">Although key bindings will be displayed in gschem using internationalised key names, you must use the English names in the configuration files.
93 </div>
94 <p>
95 A key sequence is a string containing two or more keystrokes separated by spaces.
96 </p>
98 <p>
99 Some examples:
100 </p>
101 <ul>
102 <li class="level1"><div class="li"> To bind the &quot;New Window&quot; command to a typed <kbd>F</kbd> followed by an <kbd>N</kbd>: <pre class="code">(global-set-key &quot;F N&quot; &#039;file-new-window)</pre>
103 </div>
104 </li>
105 <li class="level1"><div class="li"> To run the &quot;Deselect All&quot; command when the <kbd>Ctrl</kbd> and <kbd>Shift</kbd> keys are held down and an <kbd>A</kbd> is typed: <pre class="code">(global-set-key &quot;&lt;Control&gt;&lt;Shift&gt;A&quot; &#039;edit-deselect)</pre>
106 </div>
107 </li>
108 <li class="level1"><div class="li"> To display the &quot;Snap Size&quot; dialog box when <kbd>O</kbd> is typed, followed by <kbd>S</kbd> typed with the <kbd>Shift</kbd> key held down: <pre class="code">(global-set-key &quot;O &lt;Shift&gt;S&quot; &#039;options-snapsize)</pre>
109 </div>
110 </li>
111 </ul>
114 Key settings should be placed in a gschem configuration file.
115 </p>
117 </div>
119 <h3 id="symbolandsourcelibraries">Symbol and source libraries</h3>
120 <div class="level3">
123 The <code>component-library</code> function is used to add symbol libraries to the <a href="geda-gschem_ug-components.html" class="wikilink1" title="geda-gschem_ug-components.html">&quot;Select Component...&quot; window</a>. A symbol library is a directory that contains symbol (&quot;<code>.sym</code>&quot;) files. To add a directory as a symbol library, add the following to your configuration file:
124 </p>
125 <pre class="code">(component-library &quot;/path/to/mysymbols&quot;)</pre>
128 You can optionally set a different name for the library as an additional argument to <code>component-library</code>:
129 </p>
130 <pre class="code">(component-library &quot;/path/to/mysymbols&quot; &quot;My Symbols&quot;)</pre>
133 To add all subdirectories of a particular directory as symbol libraries, use <code>component-library-search</code>:
134 </p>
135 <pre class="code">(component-library-search &quot;/path/to/mysymbollibs/&quot;)</pre>
138 This will (recursively) look for directories that contain symbols below the specified path, and add them to the &quot;Select Component...&quot; window.
139 </p>
142 To add a directory to be searched for <a href="geda-gschem_ug-hierarchy.html" class="wikilink1" title="geda-gschem_ug-hierarchy.html">subcircuit schematics</a>, use the <code>source-library</code> function. This is similar to the <code>component-library</code> function, except that it does <em>not</em> accept an optional name argument.
143 </p>
146 Library settings should be placed in a gEDA/gaf suite configuration file, so that the symbol libraries are available to other gEDA tools (especially <a href="geda-gnetlist_ug.html" class="wikilink1" title="geda-gnetlist_ug.html">gnetlist</a>).
147 </p>
149 </div>
150 </body>
151 </html>