1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
|
# Appendix
## Key Bindings
<table>
<tr><th>Linux / Win32</th><th>Mac OSX</th><th>Command</th></tr>
<tr><td colspan='3'><strong>File</strong></td></tr>
<tr><td>Ctrl+N</td><td>Apple+N</td><td>New file</td></tr>
<tr><td>Ctrl+O</td><td>Apple+O</td><td>Open file</td></tr>
<tr><td>Alt+O</td><td>Ctrl+O</td><td>Open recent file</td></tr>
<tr><td>None</td><td>None</td><td>Reload file</td></tr>
<tr><td>Ctrl+S</td><td>Apple+S</td><td>Save file</td></tr>
<tr><td>Ctrl+Shift+S</td><td>Apple+Shift+S</td><td>Save file as</td></tr>
<tr><td>Ctrl+W</td><td>Apple+W</td><td>Close file</td></tr>
<tr><td>Ctrl+Shift+W</td><td>Apple+Shift+W</td><td>Close all</td></tr>
<tr><td>None</td><td>None</td><td>Load Session</td></tr>
<tr><td>None</td><td>None</td><td>Save Session</td></tr>
<tr><td>Alt+Q</td><td>Apple+Q</td><td>Quit textadept</td></tr>
<tr><td colspan='3'><strong>Edit</strong></td></tr>
<tr><td>Ctrl+Z</td><td>Apple+Z</td><td>Undo</td></tr>
<tr><td>Ctrl+Y</td><td>Apple+Shift+Z</td><td>Redo</td></tr>
<tr><td>Ctrl+X<br/>Shift+Del</td><td>Apple+X<br/>Shift+Del</td><td>Cut</td></tr>
<tr><td>Ctrl+C<br/>Ctrl+Shift+Insert</td><td>Apple+C<br/>Ctrl+Shift+Insert</td><td>Copy</td></tr>
<tr><td>Ctrl+V<br/>Shift+Insert</td><td>Apple+V<br/>Shift+Insert</td><td>Paste</td></tr>
<tr><td>Ctrl+A</td><td>Apple+A</td><td>Select All</td></tr>
<tr><td>Ctrl+E</td><td>Ctrl+M</td><td>Go to matching brace</td></tr>
<tr><td>Ctrl+Shift+E</td><td>Apple+Shift+E</td><td>Select to matching brace</td></tr>
<tr><td>Ctrl+Return</td><td>Escape</td><td>Autocomplete word in file</td></tr>
<tr><td>Ctrl+I</td><td>Ctrl+Escape</td><td>Autocomplete symbol for supported languages</td></tr>
<tr><td>Ctrl+H</td><td>Ctrl+H</td><td>Show symbol apidoc for supported languages</td></tr>
<tr><td>Ctrl+Q</td><td>Ctrl+Q</td><td>Block comment/uncomment</td></tr>
<tr><td>None</td><td>None</td><td>Delete word</td></tr>
<tr><td>Ctrl+Shift+H</td><td>Ctrl+Apple+T</td><td>Highlight word occurances</td></tr>
<tr><td>None</td><td>Ctrl+T</td><td>Transpose characters</td></tr>
<tr><td>None</td><td>None</td><td>Convert indentation</td></tr>
<tr><td>None</td><td>Ctrl+K</td><td>Cut to end of line</td></tr>
<tr><td>None</td><td>Ctrl+Y</td><td>Paste text cut</td></tr>
<tr><td>Alt+C, T</td><td>Ctrl+C, T</td><td>Enclose word or selection in XML tag</td></tr>
<tr><td>Alt+C, Shift+T</td><td>Ctrl+C, Shift+T</td><td>Enclose word or selection in single XML tag</td></tr>
<tr><td>Alt+C, "</td><td>Ctrl+C, "</td><td>Enclose word or selection in double quotes</td></tr>
<tr><td>Alt+C, '</td><td>Ctrl+C, '</td><td>Enclose word or selection in single quotes</td></tr>
<tr><td>Alt+C, (</td><td>Ctrl+C, (</td><td>Enclose word or selection in parenthesis</td></tr>
<tr><td>Alt+C, [</td><td>Ctrl+C, [</td><td>Enclose word or selection in brackets</td></tr>
<tr><td>Alt+C, {</td><td>Ctrl+C, {</td><td>Enclose word or selection in braces</td></tr>
<tr><td>Alt+C, C, <char></td><td>Ctrl+C, C, <char></td><td>Enclose word or selection in character</td></tr>
<tr><td>Alt+S, T</td><td>Ctrl+S, T</td><td>Select between XML tags</td></tr>
<tr><td>Alt+S, "</td><td>Ctrl+S, "</td><td>Select between double quotes</td></tr>
<tr><td>Alt+S, '</td><td>Ctrl+S, '</td><td>Select between single quotes</td></tr>
<tr><td>Alt+S, (</td><td>Ctrl+S, (</td><td>Select between parenthesis</td></tr>
<tr><td>Alt+S, [</td><td>Ctrl+S, [</td><td>Select between brackets</td></tr>
<tr><td>Alt+S, {</td><td>Ctrl+S, {</td><td>Select between braces</td></tr>
<tr><td>Alt+S, W</td><td>Ctrl+S, W</td><td>Select word</td></tr>
<tr><td>Alt+S, L</td><td>Ctrl+S, L</td><td>Select line</td></tr>
<tr><td>Alt+S, P</td><td>Ctrl+S, P</td><td>Select paragraph</td></tr>
<tr><td>Alt+S, S</td><td>Ctrl+S, S</td><td>Select scope (style)</td></tr>
<tr><td>Alt+S, G</td><td>Ctrl+S, G</td><td>Grow selection by a character on each end</td></tr>
<tr><td>Alt+S, C, <char></td><td>Ctrl+S, C, <char></td><td>Select between characters</td></tr>
<tr><td>Insert</td><td>Insert</td><td>Toggle overtype</td></tr>
<tr><td>Ctrl+Alt+Shift+I</td><td>Ctrl+Apple+Shift+I</td><td>Show style</td></tr>
<tr><td colspan='3'><strong>Search</strong></td></tr>
<tr><td>Ctrl+F</td><td>Apple+F</td><td>Find</td></tr>
<tr><td>F3</td><td>Apple+G</td><td>Find next</td></tr>
<tr><td>None</td><td>Apple+Shift+G</td><td>Find prev</td></tr>
<tr><td>None</td><td>Apple+R</td><td>Replace</td></tr>
<tr><td>Ctrl+Shift+F</td><td>Apple+I</td><td>Find incremental</td></tr>
<tr><td>None</td><td>Apple+Shift+F</td><td>Find in files</td></tr>
<tr><td>None</td><td>Ctrl+Apple+G</td><td>Goto next file in list</td></tr>
<tr><td>None</td><td>Ctrl+Apple+Shift+G</td><td>Goto prev file in list</td></tr>
<tr><td>Ctrl+G</td><td>Ctrl+G</td><td>Goto line</td></tr>
<tr><td colspan='3'><strong>Tools</strong></td></tr>
<tr><td>F2</td><td>F2</td><td>Focus Lua command entry</td></tr>
<tr><td>Ctrl+R</td><td>Ctrl+R</td><td>Run file</td></tr>
<tr><td>Ctrl+Shift+R</td><td>Ctrl+Shift+R</td><td>Compile file</td></tr>
<tr><td>Alt+R</td><td>Ctrl+Apple+R</td><td>Filter through shell command</td></tr>
<tr><td>Tab</td><td>Tab</td><td>Expand snippet or next placeholder or indent text</td></tr>
<tr><td>Alt+I</td><td>Ctrl+I</td><td>Select snippet to insert</td></tr>
<tr><td>Shift+Tab</td><td>Shift+Tab</td><td>Previous snippet placeholder or dedent text</td></tr>
<tr><td>Ctrl+Alt+I</td><td>Ctrl+Apple+I</td><td>Cancel current snippet</td></tr>
<tr><td colspan='3'><strong>Buffers</strong></td></tr>
<tr><td>Ctrl+B</td><td>Apple+B</td><td>Switch buffers</td></tr>
<tr><td>Ctrl+Tab</td><td>Ctrl+Tab</td><td>Next buffer</td></tr>
<tr><td>Ctrl+Shift+Tab</td><td>Ctrl+Shift+Tab</td><td>Prev buffer</td></tr>
<tr><td>Ctrl+Shift+B, E</td><td>Apple+Shift+B, E</td><td>Toggle show end of line</td></tr>
<tr><td>Ctrl+Shift+B, W</td><td>Apple+Shift+B, W</td><td>Toggle show whitespace</td></tr>
<tr><td>Ctrl+Shift+B, I</td><td>Apple+Shift+B, I</td><td>Toggle show indentation guides</td></tr>
<tr><td>Ctrl+Shift+B, Tab</td><td>Apple+Shift+B, Tab</td><td>Toggle use tabs or spaces</td></tr>
<tr><td>Ctrl+Shift+B, Space</td><td>Apple+Shift+B, Space</td><td>Toggle show whitespace</td></tr>
<tr><td>Ctrl+Shift+B, V</td><td>Apple+Shift+B, V</td><td>Toggle use virtual space</td></tr>
<tr><td>Ctrl+L</td><td>Ctrl+L</td><td>Select lexer</td></tr>
<tr><td>F5</td><td>F5</td><td>Refresh syntax highlighting</td></tr>
<tr><td colspan='3'><strong>Split Views</strong></td></tr>
<tr><td>Ctrl+Alt+V, N</td><td>Ctrl+V, N</td><td>Next view</td></tr>
<tr><td>Ctrl+Alt+V, P</td><td>Ctrl+V, P</td><td>Prev view</td></tr>
<tr><td>Ctrl+Alt+V, S</td><td>Ctrl+V, S</td><td>Split view horizontal</td></tr>
<tr><td>Ctrl+Alt+V, Shift+S</td><td>Ctrl+V, Shift+S</td><td>Split view vertica</td></tr>
<tr><td>Ctrl+Alt+V, W</td><td>Ctrl+V, W</td><td>Unsplit view</td></tr>
<tr><td>Ctrl+Alt+V, Shift+W</td><td>Ctrl+V, Shift+W</td><td>Unsplit all views</td></tr>
<tr><td>None</td><td>None</td><td>Grow split view</td></tr>
<tr><td>None</td><td>None</td><td>Shrink split view</td></tr>
<tr><td>Ctrl+Plus</td><td>Ctrl+Plus</td><td>Zoom in</td></tr>
<tr><td>Ctrl+Minus</td><td>Ctrl+Minus</td><td>Zoom out</td></tr>
<tr><td>Ctrl+0</td><td>Ctrl+0</td><td>Zoom normal</td></tr>
<tr><td colspan='3'><strong>Movement</strong></td></tr>
<tr><td>Right</td><td>Right<br/>Ctrl+F</td><td>Next character</td></tr>
<tr><td>Shift+Right</td><td>Shift+Right<br/>Ctrl+Shift+F</td><td>Select next character</td></tr>
<tr><td>Ctrl+Right</td><td>Ctrl+Right<br/>Ctrl+Apple+F</td><td>Next word</td></tr>
<tr><td>Ctrl+Shift+Right</td><td>Ctrl+Shift+Right<br/>Ctrl+Apple+Shift+F</td><td>Select next word</td></tr>
<tr><td>Alt+Shift+Right</td><td>Apple+Shift+Right</td><td>Rectangular select next character</td></tr>
<tr><td>Left</td><td>Left<br/>Ctrl+B</td><td>Prev character</td></tr>
<tr><td>Shift+Left</td><td>Shift+Left<br/>Ctrl+Shift+B</td><td>Select prev character</td></tr>
<tr><td>Ctrl+Left</td><td>Ctrl+Left<br/>Ctrl+Apple+B</td><td>Prev word</td></tr>
<tr><td>Ctrl+Shift+Left</td><td>Ctrl+Shift+Left<br/>Ctrl+Apple+Shift+B</td><td>Select prev word</td></tr>
<tr><td>Alt+Shift+Left</td><td>Apple+Shift+Left</td><td>Rectangular select prev character</td></tr>
<tr><td>Down</td><td>Down<br/>Ctrl+N</td><td>Next line</td></tr>
<tr><td>Shift+Down</td><td>Shift+Down<br/>Ctrl+Shift+N</td><td>Select next line</td></tr>
<tr><td>Ctrl+Down</td><td>Ctrl+Down</td><td>Scroll line down</td></tr>
<tr><td>Ctrl+Shift+Down</td><td>Ctrl+Shift+Down</td><td>Rectangular select next line</td></tr>
<tr><td>Up</td><td>Up<br/>Ctrl+P</td><td>Next character</td></tr>
<tr><td>Shift+Up</td><td>Shift+Up<br/>Ctrl+Shift+P</td><td>Select prev line</td></tr>
<tr><td>Ctrl+Up</td><td>Ctrl+Up</td><td>Scroll line up</td></tr>
<tr><td>Ctrl+Shift+Up</td><td>Ctrl+Shift+Up</td><td>Rectangular select prev line</td></tr>
<tr><td>Home</td><td>Home<br/>Ctrl+A</td><td>Goto beginning of line</td></tr>
<tr><td>Shift+Home</td><td>Shift+Home<br/>Ctrl+Shift+A</td><td>Select to beginning of line</td></tr>
<tr><td>Ctrl+Home</td><td>Ctrl+Home</td><td>Goto document start</td></tr>
<tr><td>Ctrl+Shift+Home</td><td>Ctrl+Shift+Home</td><td>Select to file start</td></tr>
<tr><td>Alt+Shift+Home</td><td>Apple+Shift+Home</td><td>Rectangular select to beginning of line</td></tr>
<tr><td>End</td><td>End<br/>Ctrl+E</td><td>Goto end of line</td></tr>
<tr><td>Shift+End</td><td>Shift+End<br/>Ctrl+Shift+E</td><td>Select to end of line</td></tr>
<tr><td>Ctrl+End</td><td>Ctrl+End</td><td>Goto file end</td></tr>
<tr><td>Ctrl+Shift+End</td><td>Ctrl+Shift+End</td><td>Select to file end</td></tr>
<tr><td>Alt+Shift+End</td><td>Apple+Shift+End</td><td>Rectangular select to end of line</td></tr>
<tr><td>Backspace<br/>Shift+Backspace</td><td>Backspace<br/>Shift+Backspace<br/>Ctrl+H</td><td>Delete previous character</td></tr>
<tr><td>Ctrl+Backspace</td><td>Ctrl+Backspace<br/>Ctrl+Apple+H</td><td>Delete previous word</td></tr>
<tr><td>Ctrl+Shift+Backspace</td><td>Ctrl+Shift+Backspace</td><td>Delete to beginning of line</td></tr>
<tr><td>Del</td><td>Del<br/>Ctrl+D</td><td>Delete next character</td></tr>
<tr><td>Ctrl+Del</td><td>Ctrl+Del<br/>Ctrl+Apple+D</td><td>Delete next word</td></tr>
<tr><td>Ctrl+Shift+Del</td><td>Ctrl+Shift+Del</td><td>Delete to end of line</td></tr>
<tr><td>Page Up</td><td>Page Up</td><td>Page up</td></tr>
<tr><td>Shift+Page Up</td><td>Shift+Page Up</td><td>Select page up</td></tr>
<tr><td>Alt+Shift+Page Up</td><td>Apple+Shift+Page Up</td><td>Rectangular select page up</td></tr>
<tr><td>Page Down</td><td>Page Down</td><td>Page down</td></tr>
<tr><td>Shift+Page Down</td><td>Shift+Page Down</td><td>Select page down</td></tr>
<tr><td>Alt+Shift+Page Down</td><td>Apple+Shift+Page Down</td><td>Rectangular select page down</td></tr>
</table>
## Lua Patterns
The following is taken from the
[Lua 5.1 Reference Manual](http://www.lua.org/manual/5.1/manual.html#5.4.1).
_Character Class:_
A character class is used to represent a set of characters. The following
combinations are allowed in describing a character class:
* **_`x`_:** (where _x_ is not one of the magic characters `^$()%.[]*+-?`)
represents the character _x_ itself.
* **`.`:** (a dot) represents all characters.
* **`%a`:** represents all letters.
* **`%c`:** represents all control characters.
* **`%d`:** represents all digits.
* **`%l`:** represents all lowercase letters.
* **`%p`:** represents all punctuation characters.
* **`%s`:** represents all space characters.
* **`%u`:** represents all uppercase letters.
* **`%w`:** represents all alphanumeric characters.
* **`%x`:** represents all hexadecimal digits.
* **`%z`:** represents the character with representation 0.
* **`%`_`x`_:** (where _x_ is any non-alphanumeric character) represents the
character _x_. This is the standard way to escape the magic characters. Any
punctuation character (even the non magic) can be preceded by a '`%`' when
used to represent itself in a pattern.
* **`[set]`:** represents the class which is the union of all characters in set.
A range of characters can be specified by separating the end characters of the
range with a '`-`'. All classes `%`_x_ described above can also be used as
components in set. All other characters in set represent themselves. For
example, `[%w_]` (or `[_%w]`) represents all alphanumeric characters plus the
underscore, `[0-7]` represents the octal digits, and `[0-7%l%-]` represents
the octal digits plus the lowercase letters plus the '`-`' character.
<br /><br />
The interaction between ranges and classes is not defined. Therefore, patterns
like `[%a-z]` or `[a-%%]` have no meaning.
* **`[^set]`:** represents the complement of _set_, where _set_ is interpreted
as above.
For all classes represented by single letters (`%a`, `%c`, etc.), the
corresponding uppercase letter represents the complement of the class. For
instance, `%S` represents all non-space characters.
The definitions of letter, space, and other character groups depend on the
current locale. In particular, the class `[a-z]` may not be equivalent to `%l`.
_Pattern Item:_
A _pattern item_ can be
* a single character class, which matches any single character in the class;
* a single character class followed by '`*`', which matches 0 or more
repetitions of characters in the class. These repetition items will always
match the longest possible sequence;
* a single character class followed by '`+`', which matches 1 or more
repetitions of characters in the class. These repetition items will always
match the longest possible sequence;
* a single character class followed by '`-`', which also matches 0 or more
repetitions of characters in the class. Unlike '`*`', these repetition items
will always match the _shortest_ possible sequence;
* a single character class followed by '`?`', which matches 0 or 1 occurrence of
a character in the class;
* `%n`, for _n_ between 1 and 9; such item matches a substring equal to the
_n_-th captured string (see below);
* `%bxy`, where _x_ and _y_ are two distinct characters; such item matches
strings that start with _x_, end with _y_, and where the _x_ and _y_ are
balanced. This means that, if one reads the string from left to right,
counting +_1_ for an _x_ and -_1_ for a _y_, the ending _y_ is the first _y_
where the count reaches 0. For instance, the item `%b()` matches expressions
with balanced parentheses.
_Pattern:_
A _pattern_ is a sequence of pattern items. A '`^`' at the beginning of a
pattern anchors the match at the beginning of the subject string. A '`$`' at the
end of a pattern anchors the match at the end of the subject string. At other
positions, '`^`' and '`$`' have no special meaning and represent themselves.
_Captures:_
A pattern can contain sub-patterns enclosed in parentheses; they describe
_captures_. When a match succeeds, the substrings of the subject string that
match captures are stored (_captured_) for future use. Captures are numbered
according to their left parentheses. For instance, in the pattern
`"(a*(.)%w(%s*))"`, the part of the string matching `"a*(.)%w(%s*)"` is stored
as the first capture (and therefore has number 1); the character matching "`.`"
is captured with number 2, and the part matching "`%s*`" has number 3.
As a special case, the empty capture `()` captures the current string position
(a number). For instance, if we apply the pattern `"()aa()"` on the string
`"flaaap"`, there will be two captures: 3 and 5.
A pattern cannot contain embedded zeros. Use `%z` instead.
|