Using the Source Editor

  • Revision slug: Tools/Using_the_Source_Editor
  • Revision title: Using the Source Editor
  • Revision id: 15635
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment 12 words added

Revision Content

The Source Editor is an editor component, provided by the source-editor.jsm JavaScript code module, which is shared by several developer tools, including the Scratchpad and Style Editor. It can also be used by Firefox extensions. This article documents how to use the editor itself to edit text.

Keyboard commands

These are the standard keyboard shortcuts for these commands; note that they may vary in some add-ons. However, Firefox always uses these.

Note: On Mac OS X, use the Command key instead of the control key.

Function Keyboard
Select All Ctrl-A
Copy Ctrl-C
Find Ctrl-F
Find Again Ctrl-G
Go to line Ctrl-L
Redo Ctrl-Shift-Z
Paste Ctrl-V
Cut Ctrl-X
Undo Ctrl-Z
Indent line(s) Tab
Unindent lines Shift-Tab
Move line(s) up Alt-↑ (Ctrl-Option-↑ on Mac OS X)
Move line(s) down Alt-↓ (Ctrl-Option-↓ on Mac OS X)
Toggle commenting of selection Ctrl-/ {{ fx_minversion_inline("14.0") }}
Move to bracket opening Ctrl-[ {{ fx_minversion_inline("14.0") }}
Move to bracket closing Ctlr-] {{ fx_minversion_inline("14.0") }}

See also

Revision Source

<p>The Source Editor is an editor component, provided by the <a href="/en/JavaScript_code_modules/source-editor.jsm" title="source-editor.jsm"><code>source-editor.jsm</code></a> JavaScript code module, which is shared by several developer tools, including the <a href="/en/Tools/Scratchpad" title="Scratchpad">Scratchpad</a> and <a href="/en/Tools/Style_Editor" title="Style Editor">Style Editor</a>. It can also be <a href="/en/JavaScript_code_modules/Using_the_Source_Editor_API" title="Using the Source Editor API">used by Firefox extensions</a>. This article documents how to use the editor itself to edit text.</p>
<h2 id="Keyboard_commands">Keyboard commands</h2>
<p>These are the standard keyboard shortcuts for these commands; note that they may vary in some add-ons. However, Firefox always uses these.</p>
<div class="note"><strong>Note:</strong> On Mac OS X, use the Command key instead of the control key.</div>
<br>
<table class="standard-table" style="width: auto;"> <thead> <tr> <th class="header">Function</th> <th class="header">Keyboard</th> </tr> </thead> <tbody> <tr> <td>Select All</td> <td>Ctrl-A</td> </tr> <tr> <td>Copy</td> <td>Ctrl-C</td> </tr> <tr> <td>Find</td> <td>Ctrl-F</td> </tr> <tr> <td>Find Again</td> <td>Ctrl-G</td> </tr> <tr> <td>Go to line</td> <td>Ctrl-L</td> </tr> <tr> <td>Redo</td> <td>Ctrl-Shift-Z</td> </tr> <tr> <td>Paste</td> <td>Ctrl-V</td> </tr> <tr> <td>Cut</td> <td>Ctrl-X</td> </tr> <tr> <td>Undo</td> <td>Ctrl-Z</td> </tr> <tr> <td>Indent line(s)</td> <td>Tab</td> </tr> <tr> <td>Unindent lines</td> <td>Shift-Tab</td> </tr> <tr> <td>Move line(s) up</td> <td>Alt-↑ (Ctrl-Option-↑ on Mac OS X)</td> </tr> <tr> <td>Move line(s) down</td> <td>Alt-↓ (Ctrl-Option-↓ on Mac OS X)</td> </tr> <tr> <td>Toggle commenting of selection</td> <td>Ctrl-/ {{ fx_minversion_inline("14.0") }}</td> </tr> <tr> <td>Move to bracket opening</td> <td>Ctrl-[ {{ fx_minversion_inline("14.0") }}</td> </tr> <tr> <td>Move to bracket closing</td> <td>Ctlr-] {{ fx_minversion_inline("14.0") }}</td> </tr> </tbody>
</table>
<h2 id="See_also">See also</h2>
<ul> <li><a href="/en/Tools" title="Tools">Tools</a></li> <li><a href="/en/Tools/Scratchpad" title="Scratchpad">Scratchpad</a></li> <li><a href="/en/Tools/Style_Editor" title="Style Editor">Style Editor</a></li>
</ul>
Revert to this revision