Search/Replace Demo

1
<dl>
2
  <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
3
  <dd>Whether, when indenting, the first N*<code>tabSize</code>
4
  spaces should be replaced by N tabs. Default is false.</dd>
5
 
6
  <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
7
  <dd>Configures whether the editor should re-indent the current
8
  line when a character is typed that might change its proper
9
  indentation (only works if the mode supports indentation).
10
  Default is true.</dd>
11
 
12
  <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
13
  <dd>A regular expression used to determine which characters
14
  should be replaced by a
15
  special <a href="#option_specialCharPlaceholder">placeholder</a>.
16
  Mostly useful for non-printing special characters. The default
17
  is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
18
  <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) → Element</code></dt>
19
  <dd>A function that, given a special character identified by
20
  the <a href="#option_specialChars"><code>specialChars</code></a>
21
  option, produces a DOM node that is used to represent the
22
  character. By default, a red dot (<span style="color: red"></span>)
23
  is shown, with a title tooltip to indicate the character code.</dd>
24
 
25
  <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
26
  <dd>Determines whether horizontal cursor movement through
27
  right-to-left (Arabic, Hebrew) text is visual (pressing the left
28
  arrow moves the cursor left) or logical (pressing the left arrow
29
  moves to the next lower index in the string, which is visually
30
  right in right-to-left text). The default is <code>false</code>
31
  on Windows, and <code>true</code> on other platforms.</dd>
32
</dl>
33
 
 

Demonstration of primitive search/replace functionality. The keybindings (which can be overridden by custom keymaps) are:

Ctrl-F / Cmd-F
Start searching
Ctrl-G / Cmd-G
Find next
Shift-Ctrl-G / Shift-Cmd-G
Find previous
Shift-Ctrl-F / Cmd-Option-F
Replace
Shift-Ctrl-R / Shift-Cmd-Option-F
Replace all

Searching is enabled by including addon/search/search.js and addon/search/searchcursor.js. For good-looking input dialogs, you also want to include addon/dialog/dialog.js and addon/dialog/dialog.css.