# Appendix ## Key Bindings
Linux / Win32Mac OSXCommand
File
Ctrl+NApple+NNew file
Ctrl+OApple+OOpen file
Alt+OCtrl+OOpen recent file
NoneNoneReload file
Ctrl+SApple+SSave file
Ctrl+Shift+SApple+Shift+SSave file as
Ctrl+WApple+WClose file
Ctrl+Shift+WApple+Shift+WClose all
NoneNoneLoad Session
NoneNoneSave Session
Alt+QApple+QQuit textadept
Edit
Ctrl+ZApple+ZUndo
Ctrl+YApple+Shift+ZRedo
Ctrl+X
Shift+Del
Apple+X
Shift+Del
Cut
Ctrl+C
Ctrl+Shift+Insert
Apple+C
Ctrl+Shift+Insert
Copy
Ctrl+V
Shift+Insert
Apple+V
Shift+Insert
Paste
Ctrl+AApple+ASelect All
Ctrl+ECtrl+MGo to matching brace
Ctrl+Shift+EApple+Shift+ESelect to matching brace
Ctrl+ReturnEscapeAutocomplete word in file
Ctrl+ICtrl+EscapeAutocomplete symbol for supported languages
Ctrl+HCtrl+HShow symbol apidoc for supported languages
Ctrl+QCtrl+QBlock comment/uncomment
NoneNoneDelete word
Ctrl+Shift+HCtrl+Apple+THighlight word occurances
NoneCtrl+TTranspose characters
NoneNoneConvert indentation
NoneCtrl+KCut to end of line
NoneCtrl+YPaste text cut
Alt+C, TCtrl+C, TEnclose word or selection in XML tag
Alt+C, Shift+TCtrl+C, Shift+TEnclose word or selection in single XML tag
Alt+C, "Ctrl+C, "Enclose word or selection in double quotes
Alt+C, 'Ctrl+C, 'Enclose word or selection in single quotes
Alt+C, (Ctrl+C, (Enclose word or selection in parenthesis
Alt+C, [Ctrl+C, [Enclose word or selection in brackets
Alt+C, {Ctrl+C, {Enclose word or selection in braces
Alt+C, C, <char>Ctrl+C, C, <char>Enclose word or selection in character
Alt+S, TCtrl+S, TSelect between XML tags
Alt+S, "Ctrl+S, "Select between double quotes
Alt+S, 'Ctrl+S, 'Select between single quotes
Alt+S, (Ctrl+S, (Select between parenthesis
Alt+S, [Ctrl+S, [Select between brackets
Alt+S, {Ctrl+S, {Select between braces
Alt+S, WCtrl+S, WSelect word
Alt+S, LCtrl+S, LSelect line
Alt+S, PCtrl+S, PSelect paragraph
Alt+S, SCtrl+S, SSelect scope (style)
Alt+S, GCtrl+S, GGrow selection by a character on each end
Alt+S, C, <char>Ctrl+S, C, <char>Select between characters
InsertInsertToggle overtype
Ctrl+Alt+Shift+ICtrl+Apple+Shift+IShow style
Search
Ctrl+FApple+FFind
F3Apple+GFind next
NoneApple+Shift+GFind prev
NoneApple+RReplace
Ctrl+Shift+FApple+IFind incremental
NoneApple+Shift+FFind in files
NoneCtrl+Apple+GGoto next file in list
NoneCtrl+Apple+Shift+GGoto prev file in list
Ctrl+GCtrl+GGoto line
Tools
F2F2Focus Lua command entry
Ctrl+RCtrl+RRun file
Ctrl+Shift+RCtrl+Shift+RCompile file
Alt+RCtrl+Apple+RFilter through shell command
TabTabExpand snippet or next placeholder or indent text
Alt+ICtrl+ISelect snippet to insert
Shift+TabShift+TabPrevious snippet placeholder or dedent text
Ctrl+Alt+ICtrl+Apple+ICancel current snippet
Buffers
Ctrl+BApple+BSwitch buffers
Ctrl+TabCtrl+TabNext buffer
Ctrl+Shift+TabCtrl+Shift+TabPrev buffer
Ctrl+Shift+B, EApple+Shift+B, EToggle show end of line
Ctrl+Shift+B, WApple+Shift+B, WToggle show whitespace
Ctrl+Shift+B, IApple+Shift+B, IToggle show indentation guides
Ctrl+Shift+B, TabApple+Shift+B, TabToggle use tabs or spaces
Ctrl+Shift+B, SpaceApple+Shift+B, SpaceToggle show whitespace
Ctrl+Shift+B, VApple+Shift+B, VToggle use virtual space
Ctrl+LCtrl+LSelect lexer
F5F5Refresh syntax highlighting
Split Views
Ctrl+Alt+V, NCtrl+V, NNext view
Ctrl+Alt+V, PCtrl+V, PPrev view
Ctrl+Alt+V, SCtrl+V, SSplit view horizontal
Ctrl+Alt+V, Shift+SCtrl+V, Shift+SSplit view vertica
Ctrl+Alt+V, WCtrl+V, WUnsplit view
Ctrl+Alt+V, Shift+WCtrl+V, Shift+WUnsplit all views
NoneNoneGrow split view
NoneNoneShrink split view
Ctrl+PlusCtrl+PlusZoom in
Ctrl+MinusCtrl+MinusZoom out
Ctrl+0Ctrl+0Zoom normal
Movement
RightRight
Ctrl+F
Next character
Shift+RightShift+Right
Ctrl+Shift+F
Select next character
Ctrl+RightCtrl+Right
Ctrl+Apple+F
Next word
Ctrl+Shift+RightCtrl+Shift+Right
Ctrl+Apple+Shift+F
Select next word
Alt+Shift+RightApple+Shift+RightRectangular select next character
LeftLeft
Ctrl+B
Prev character
Shift+LeftShift+Left
Ctrl+Shift+B
Select prev character
Ctrl+LeftCtrl+Left
Ctrl+Apple+B
Prev word
Ctrl+Shift+LeftCtrl+Shift+Left
Ctrl+Apple+Shift+B
Select prev word
Alt+Shift+LeftApple+Shift+LeftRectangular select prev character
DownDown
Ctrl+N
Next line
Shift+DownShift+Down
Ctrl+Shift+N
Select next line
Ctrl+DownCtrl+DownScroll line down
Ctrl+Shift+DownCtrl+Shift+DownRectangular select next line
UpUp
Ctrl+P
Next character
Shift+UpShift+Up
Ctrl+Shift+P
Select prev line
Ctrl+UpCtrl+UpScroll line up
Ctrl+Shift+UpCtrl+Shift+UpRectangular select prev line
HomeHome
Ctrl+A
Goto beginning of line
Shift+HomeShift+Home
Ctrl+Shift+A
Select to beginning of line
Ctrl+HomeCtrl+HomeGoto document start
Ctrl+Shift+HomeCtrl+Shift+HomeSelect to file start
Alt+Shift+HomeApple+Shift+HomeRectangular select to beginning of line
EndEnd
Ctrl+E
Goto end of line
Shift+EndShift+End
Ctrl+Shift+E
Select to end of line
Ctrl+EndCtrl+EndGoto file end
Ctrl+Shift+EndCtrl+Shift+EndSelect to file end
Alt+Shift+EndApple+Shift+EndRectangular select to end of line
Backspace
Shift+Backspace
Backspace
Shift+Backspace
Ctrl+H
Delete previous character
Ctrl+BackspaceCtrl+Backspace
Ctrl+Apple+H
Delete previous word
Ctrl+Shift+BackspaceCtrl+Shift+BackspaceDelete to beginning of line
DelDel
Ctrl+D
Delete next character
Ctrl+DelCtrl+Del
Ctrl+Apple+D
Delete next word
Ctrl+Shift+DelCtrl+Shift+DelDelete to end of line
Page UpPage UpPage up
Shift+Page UpShift+Page UpSelect page up
Alt+Shift+Page UpApple+Shift+Page UpRectangular select page up
Page DownPage DownPage down
Shift+Page DownShift+Page DownSelect page down
Alt+Shift+Page DownApple+Shift+Page DownRectangular select page down
## 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.

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.