aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/keys.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/keys.lua')
-rw-r--r--modules/textadept/keys.lua499
1 files changed, 239 insertions, 260 deletions
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 5cae6988..b50503cb 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -5,214 +5,214 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Defines key bindings for Textadept.
--- This set of key bindings is pretty standard among other text editors, at
--- least for basic editing commands and movements.
+-- This set of key bindings is pretty standard among other text editors, at least for basic
+-- editing commands and movements.
--
-- ### Key Bindings
--
--- Win32, Linux, BSD|macOS|Terminal|Command
--- -----------------|-----|--------|--------
--- **File** | | |
--- Ctrl+N |⌘N |M-^N |New file
--- Ctrl+O |⌘O |^O |Open file
--- Ctrl+Alt+O |^⌘O |M-^O |Open recent file...
--- Ctrl+Shift+O |⌘⇧O |M-O |Reload file
--- Ctrl+S |⌘S |^S |Save file
--- Ctrl+Shift+S |⌘⇧S |M-^S |Save file as..
--- None |None |None |Save all files
--- Ctrl+W |⌘W |^W |Close file
--- Ctrl+Shift+W |⌘⇧W |M-^W |Close all files
--- None |None |None |Load session...
--- None |None |None |Save session...
--- Ctrl+Q |⌘Q |^Q |Quit
--- **Edit** | | |
--- Ctrl+Z<br/>Alt+Bksp |⌘Z |^Z^(†)<br/>M-Z|Undo
--- Ctrl+Y<br/>Ctrl+Shift+Z|⌘⇧Z |^Y<br/>M-S-Z |Redo
--- Ctrl+X<br/>Shift+Del |⌘X<br/>⇧⌦|^X |Cut
--- Ctrl+C<br/>Ctrl+Ins |⌘C |^C |Copy
--- Ctrl+V<br/>Shift+Ins |⌘V |^V |Paste
--- Ctrl+Shift+V |⌘⇧V |M-V |Paste Reindent
--- Ctrl+D |⌘D |None |Duplicate line
--- Del |⌦<br/>^D |Del<br/>^D |Delete
--- Alt+Del |^⌦ |M-Del<br/>M-D |Delete word
--- Ctrl+A |⌘A |M-A |Select all
--- Ctrl+M |^M |M-M |Match brace
--- Ctrl+Enter |^Esc |M-Enter^(‡) |Complete word
--- Ctrl+/ |^/ |M-/ |Toggle block comment
--- Ctrl+T |^T |^T |Transpose characters
--- Ctrl+Shift+J |^J |M-J |Join lines
--- Ctrl+&#124; |⌘&#124; |^\ |Filter text through
--- Ctrl+Shift+M |^⇧M |M-S-M |Select between delimiters
--- Ctrl+< |⌘< |M-< |Select between XML tags
--- Ctrl+> |⌘> |None |Select in XML tag
--- Ctrl+Shift+D |⌘⇧D |M-S-W |Select word
--- Ctrl+Shift+N |⌘⇧N |M-S-N |Select line
--- Ctrl+Shift+P |⌘⇧P |M-S-P |Select paragraph
--- Ctrl+Alt+U |^U |M-^U |Upper case selection
--- Ctrl+Alt+Shift+U |^⇧U |M-^L |Lower case selection
--- Alt+< |^< |M-> |Enclose as XML tags
--- Alt+> |^> |None |Enclose as single XML tag
--- Alt+" |^" |None |Enclose in double quotes
--- Alt+' |^' |None |Enclose in single quotes
--- Alt+( |^( |M-) |Enclose in parentheses
--- Alt+[ |^[ |M-] |Enclose in brackets
--- Alt+{ |^{ |M-} |Enclose in braces
--- Ctrl+Shift+Up |^⇧⇡ |S-^Up |Move selected lines up
--- Ctrl+Shift+Down |^⇧⇣ |S-^Down |Move selected lines down
--- Alt+, |^, |M-, |Navigate backward
--- Alt+. |^. |M-. |Navigate forward
--- None |None |None |Record location
--- None |None |None |Clear navigation history
--- Ctrl+P |⌘, |M-~ |Preferences
--- **Search** | | |
--- Ctrl+F |⌘F |M-F<br/>M-S-F|Find
--- Ctrl+G<br/>F3 |⌘G |M-G |Find next
--- Ctrl+Shift+G<br/>Shift+F3|⌘⇧G |M-S-G |Find previous
--- Ctrl+Alt+R |^R |M-R |Replace
--- Ctrl+Alt+Shift+R |^⇧R |M-S-R |Replace all
--- Ctrl+Alt+F |^⌘F |M-^F |Find incremental
--- Ctrl+Shift+F |⌘⇧F |None |Find in files
--- Ctrl+Alt+G |^⌘G |None |Goto next file found
--- Ctrl+Alt+Shift+G |^⌘⇧G|None |Goto previous file found
--- Ctrl+J |⌘J |^J |Jump to line
--- **Tools** | | |
--- Ctrl+E |⌘E |M-C |Command entry
--- Ctrl+Shift+E |⌘⇧E |M-S-C |Select command
--- Ctrl+R |⌘R |^R |Run
--- Ctrl+Shift+R |⌘⇧R |M-^R |Compile
--- Ctrl+Shift+A |⌘⇧A |None |Set Arguments...
--- Ctrl+Shift+B |⌘⇧B |M-^B |Build
--- Ctrl+Shift+T |⌘⇧T |M-^T |Run tests
--- Ctrl+Shift+X |⌘⇧X |M-^X |Stop
--- Ctrl+Alt+E |^⌘E |M-X |Next Error
--- Ctrl+Alt+Shift+E|^⌘⇧E |M-S-X |Previous Error
--- Ctrl+F2 |⌘F2 |F1 |Toggle bookmark
--- Ctrl+Shift+F2 |⌘⇧F2 |F6 |Clear bookmarks
--- F2 |F2 |F2 |Next bookmark
--- Shift+F2 |⇧F2 |F3 |Previous bookmark
--- Alt+F2 |⌥F2 |F4 |Goto bookmark...
--- F9 |F9 |F9 |Start/stop recording macro
--- Shift+F9 |⇧F9 |F10 |Play recorded macro
--- Ctrl+U |⌘U |^U |Quickly open `_USERHOME`
--- None |None |None |Quickly open `_HOME`
--- Ctrl+Alt+Shift+O|^⌘⇧O |M-S-O |Quickly open current directory
--- Ctrl+Alt+Shift+P|^⌘⇧P |M-^P |Quickly open current project
--- Ctrl+Shift+K |⌥⇧⇥ |M-S-K |Insert snippet...
--- Tab |⇥ |Tab |Expand snippet or next placeholder
--- Shift+Tab |⇧⇥ |S-Tab |Previous snippet placeholder
--- Esc |Esc |Esc |Cancel snippet
--- Ctrl+K |⌥⇥ |M-K |Complete trigger word
--- Ctrl+Space |⌥Esc |^Space |Complete symbol
--- Ctrl+H |^H |M-H<br/>M-S-H|Show documentation
--- Ctrl+I |⌘I |M-S-I |Show style
--- **Buffer** | | |
--- Ctrl+Tab |^⇥ |M-N |Next buffer
--- Ctrl+Shift+Tab |^⇧⇥ |M-P |Previous buffer
--- Ctrl+B |⌘B |M-B<br/>M-S-B|Switch to buffer...
--- None |None |None |Tab width: 2
--- None |None |None |Tab width: 3
--- None |None |None |Tab width: 4
--- None |None |None |Tab width: 8
--- Ctrl+Alt+Shift+T|^⇧T |M-T<br/>M-S-T|Toggle use tabs
--- Ctrl+Alt+I |^I |M-I |Convert indentation
--- None |None |None |CR+LF EOL mode
--- None |None |None |LF EOL mode
--- None |None |None |UTF-8 encoding
--- None |None |None |ASCII encoding
--- None |None |None |CP-1252 encoding
--- None |None |None |UTF-16 encoding
--- Ctrl+Alt+\\ |^\\ |None |Toggle wrap mode
--- Ctrl+Alt+Shift+S|^⇧S |None |Toggle view whitespace
--- Ctrl+Shift+L |⌘⇧L |M-S-L |Select lexer...
--- **View** | | |
--- Ctrl+Alt+N |^⌥⇥ |M-^V N |Next view
--- Ctrl+Alt+P |^⌥⇧⇥ |M-^V P |Previous view
--- Ctrl+Alt+S<br/>Ctrl+Alt+H|^S |M-^V S<br/>M-^V H|Split view horizontal
--- Ctrl+Alt+V |^V |M-^V V |Split view vertical
--- Ctrl+Alt+W |^W |M-^V W |Unsplit view
--- Ctrl+Alt+Shift+W |^⇧W |M-^V S-W |Unsplit all views
--- Ctrl+Alt++<br/>Ctrl+Alt+=|^+<br/>^=|M-^V +<br/>M-^V =|Grow view
--- Ctrl+Alt+- |^- |M-^V - |Shrink view
--- Ctrl+* |⌘* |M-* |Toggle current fold
--- Ctrl+Alt+Shift+I |^⇧I |N/A |Toggle indent guides
--- Ctrl+Alt+Shift+V |^⇧V |None |Toggle virtual space
--- Ctrl+= |⌘= |N/A |Zoom in
--- Ctrl+- |⌘- |N/A |Zoom out
--- Ctrl+0 |⌘0 |N/A |Reset zoom
--- **Help**| | |
--- F1 |F1 |None|Open manual
--- Shift+F1|⇧F1 |None|Open LuaDoc
--- None |None|None|About
--- **Movement** | | |
--- Down |⇣<br/>^N |^N<br/>Down |Line down
--- Shift+Down |⇧⇣<br/>^⇧N |S-Down |Line down extend selection
--- Ctrl+Down |^⇣ |^Down |Scroll line down
--- Alt+Shift+Down |⌥⇧⇣ |M-S-Down |Line down extend rect. selection
--- Up |⇡<br/>^P |^P<br/>Up |Line up
--- Shift+Up |⇧⇡<br/>^⇧P |S-Up |Line up extend selection
--- Ctrl+Up |^⇡ |^Up |Scroll line up
--- Alt+Shift+Up |⌥⇧⇡ |M-S-Up |Line up extend rect. selection
--- Left |⇠<br/>^B |^B<br/>Left |Char left
--- Shift+Left |⇧⇠<br/>^⇧B |S-Left |Char left extend selection
--- Ctrl+Left |⌥⇠<br/>^⌘B |^Left |Word left
--- Ctrl+Shift+Left |^⇧⇠<br/>^⌘⇧B|S-^Left |Word left extend selection
--- Alt+Shift+Left |⌥⇧⇠ |M-S-Left |Char left extend rect. selection
--- Right |⇢<br/>^F |^F<br/>Right|Char right
--- Shift+Right |⇧⇢<br/>^⇧F |S-Right |Char right extend selection
--- Ctrl+Right |⌥⇢<br/>^⌘F |^Right |Word right
--- Ctrl+Shift+Right|^⇧⇢<br/>^⌘⇧F|S-^Right |Word right extend selection
--- Alt+Shift+Right |⌥⇧⇢ |M-S-Right |Char right extend rect. selection
--- Home |⌘⇠<br/>^A |^A<br/>Home |Line start
--- Shift+Home |⌘⇧⇠<br/>^⇧A |M-S-A |Line start extend selection
--- Ctrl+Home |⌘⇡<br/>⌘↖ |M-^A |Document start
--- Ctrl+Shift+Home |⌘⇧⇡<br/>⌘⇧↖ |None |Document start extend selection
--- Alt+Shift+Home |⌥⇧↖ |None |Line start extend rect. selection
--- End |⌘⇢<br/>^E |^E<br/>End |Line end
--- Shift+End |⌘⇧⇢<br/>^⇧E |M-S-E |Line end extend selection
--- Ctrl+End |⌘⇣<br/>⌘↘ |M-^E |Document end
--- Ctrl+Shift+End |⌘⇧⇣<br/>⌘⇧↘ |None |Document end extend selection
--- Alt+Shift+End |⌥⇧↘ |None |Line end extend rect. selection
--- PgUp |⇞ |PgUp |Page up
--- Shift+PgUp |⇧⇞ |M-S-U |Page up extend selection
--- Alt+Shift+PgUp |⌥⇧⇞ |None |Page up extend rect. selection
--- PgDn |⇟ |PgDn |Page down
--- Shift+PgDn |⇧⇟ |M-S-D |Page down extend selection
--- Alt+Shift+PgDn |⌥⇧⇟ |None |Page down extend rect. selection
--- Ctrl+Del |⌘⌦ |^Del |Delete word right
--- Ctrl+Shift+Del |⌘⇧⌦ |S-^Del |Delete line right
--- Ins |Ins |Ins |Toggle overtype
--- Bksp |⌫<br/>⇧⌫ |^H<br/>Bksp |Delete back
--- Ctrl+Bksp |⌘⌫ |None |Delete word left
--- Ctrl+Shift+Bksp |⌘⇧⌫ |None |Delete line left
--- Tab |⇥ |Tab<br/>^I |Insert tab or indent
--- Shift+Tab |⇧⇥ |S-Tab |Dedent
--- None |^K |^K |Cut to line end
--- None |^L |None |Center line vertically
--- N/A |N/A |^^ |Mark text at the caret position
--- N/A |N/A |^] |Swap caret and mark anchor
--- **UTF-8 Input** | | |
--- Ctrl+Shift+U *xxxx* Enter|⌘⇧U *xxxx* ↩|M-U *xxxx* Enter|Insert U-*xxxx* char.
--- **Find Fields**| | |
--- Left |⇠<br/>^B |^B<br/>Left |Cursor left
--- Right |⇢<br/>^F |^F<br/>Right|Cursor right
--- Del |⌦ |Del |Delete forward
--- Bksp |⌫ |^H<br/>Bksp |Delete back
--- Ctrl+V |⌘V |^V |Paste
--- N/A |N/A |^X |Cut all
--- N/A |N/A |^Y |Copy all
--- N/A |N/A |^U |Erase all
--- Home |↖<br/>⌘⇠<br/>^A|^A |Home
--- End |↘<br/>⌘⇢<br/>^E|^E |End
--- N/A |N/A |^T |Transpose characters
--- N/A |N/A |Tab |Toggle find/replace buttons
--- Tab |⇥ |Down |Focus replace field
--- Shift+Tab |⇧⇥ |Up |Focus find field
--- Up |⇡ |^P |Cycle back through history
--- Down |⇣ |^N |Cycle forward through history
--- N/A |N/A |F1 |Toggle "Match Case"
--- N/A |N/A |F2 |Toggle "Whole Word"
--- N/A |N/A |F3 |Toggle "Regex"
--- N/A |N/A |F4 |Toggle "Find in Files"
+-- Win32, Linux, BSD | macOS | Terminal | Command
+-- -|-|-|-
+-- **File**|||
+-- Ctrl+N | ⌘N | M-^N | New file
+-- Ctrl+O | ⌘O | ^O | Open file
+-- Ctrl+Alt+O | ^⌘O | M-^O | Open recent file...
+-- Ctrl+Shift+O | ⌘⇧O | M-O | Reload file
+-- Ctrl+S | ⌘S | ^S | Save file
+-- Ctrl+Shift+S | ⌘⇧S | M-^S | Save file as..
+-- None | None | None | Save all files
+-- Ctrl+W | ⌘W | ^W | Close file
+-- Ctrl+Shift+W | ⌘⇧W | M-^W | Close all files
+-- None | None | None | Load session...
+-- None | None | None | Save session...
+-- Ctrl+Q | ⌘Q | ^Q | Quit
+-- **Edit**| | |
+-- Ctrl+Z<br/>Alt+Bksp | ⌘Z | ^Z^(†)<br/>M-Z | Undo
+-- Ctrl+Y<br/>Ctrl+Shift+Z | ⌘⇧Z | ^Y<br/>M-S-Z | Redo
+-- Ctrl+X<br/>Shift+Del | ⌘X<br/>⇧⌦ | ^X | Cut
+-- Ctrl+C<br/>Ctrl+Ins | ⌘C | ^C | Copy
+-- Ctrl+V<br/>Shift+Ins | ⌘V | ^V | Paste
+-- Ctrl+Shift+V | ⌘⇧V | M-V | Paste Reindent
+-- Ctrl+D | ⌘D | None | Duplicate line
+-- Del | ⌦<br/>^D | Del<br/>^D | Delete
+-- Alt+Del | ^⌦ | M-Del<br/>M-D | Delete word
+-- Ctrl+A | ⌘A | M-A | Select all
+-- Ctrl+M | ^M | M-M | Match brace
+-- Ctrl+Enter | ^Esc | M-Enter^(‡) | Complete word
+-- Ctrl+/ | ^/ | M-/ | Toggle block comment
+-- Ctrl+T | ^T | ^T | Transpose characters
+-- Ctrl+Shift+J | ^J | M-J | Join lines
+-- Ctrl+&#124; | ⌘&#124; | ^\ | Filter text through
+-- Ctrl+Shift+M | ^⇧M | M-S-M | Select between delimiters
+-- Ctrl+< | ⌘< | M-< | Select between XML tags
+-- Ctrl+> | ⌘> | None | Select in XML tag
+-- Ctrl+Shift+D | ⌘⇧D | M-S-W | Select word
+-- Ctrl+Shift+N | ⌘⇧N | M-S-N | Select line
+-- Ctrl+Shift+P | ⌘⇧P | M-S-P | Select paragraph
+-- Ctrl+Alt+U | ^U | M-^U | Upper case selection
+-- Ctrl+Alt+Shift+U | ^⇧U | M-^L | Lower case selection
+-- Alt+< | ^< | M-> | Enclose as XML tags
+-- Alt+> | ^> | None | Enclose as single XML tag
+-- Alt+" | ^" | None | Enclose in double quotes
+-- Alt+' | ^' | None | Enclose in single quotes
+-- Alt+( | ^( | M-) | Enclose in parentheses
+-- Alt+[ | ^[ | M-] | Enclose in brackets
+-- Alt+{ | ^{ | M-} | Enclose in braces
+-- Ctrl+Shift+Up | ^⇧⇡ | S-^Up | Move selected lines up
+-- Ctrl+Shift+Down | ^⇧⇣ | S-^Down | Move selected lines down
+-- Alt+, | ^, | M-, | Navigate backward
+-- Alt+. | ^. | M-. | Navigate forward
+-- None | None | None | Record location
+-- None | None | None | Clear navigation history
+-- Ctrl+P | ⌘, | M-~ | Preferences
+-- **Search**| | |
+-- Ctrl+F | ⌘F | M-F<br/>M-S-F | Find
+-- Ctrl+G<br/>F3 | ⌘G | M-G | Find next
+-- Ctrl+Shift+G<br/>Shift+F3 | ⌘⇧G | M-S-G | Find previous
+-- Ctrl+Alt+R | ^R | M-R | Replace
+-- Ctrl+Alt+Shift+R | ^⇧R | M-S-R | Replace all
+-- Ctrl+Alt+F | ^⌘F | M-^F | Find incremental
+-- Ctrl+Shift+F | ⌘⇧F | None | Find in files
+-- Ctrl+Alt+G | ^⌘G | None | Goto next file found
+-- Ctrl+Alt+Shift+G | ^⌘⇧G | None | Goto previous file found
+-- Ctrl+J | ⌘J | ^J | Jump to line
+-- **Tools**| | |
+-- Ctrl+E | ⌘E | M-C | Command entry
+-- Ctrl+Shift+E | ⌘⇧E | M-S-C | Select command
+-- Ctrl+R | ⌘R | ^R | Run
+-- Ctrl+Shift+R | ⌘⇧R | M-^R | Compile
+-- Ctrl+Shift+A | ⌘⇧A | None | Set Arguments...
+-- Ctrl+Shift+B | ⌘⇧B | M-^B | Build
+-- Ctrl+Shift+T | ⌘⇧T | M-^T | Run tests
+-- Ctrl+Shift+X | ⌘⇧X | M-^X | Stop
+-- Ctrl+Alt+E | ^⌘E | M-X | Next Error
+-- Ctrl+Alt+Shift+E | ^⌘⇧E | M-S-X | Previous Error
+-- Ctrl+F2 | ⌘F2 | F1 | Toggle bookmark
+-- Ctrl+Shift+F2 | ⌘⇧F2 | F6 | Clear bookmarks
+-- F2 | F2 | F2 | Next bookmark
+-- Shift+F2 | ⇧F2 | F3 | Previous bookmark
+-- Alt+F2 | ⌥F2 | F4 | Goto bookmark...
+-- F9 | F9 | F9 | Start/stop recording macro
+-- Shift+F9 | ⇧F9 | F10 | Play recorded macro
+-- Ctrl+U | ⌘U | ^U | Quickly open `_USERHOME`
+-- None | None | None | Quickly open `_HOME`
+-- Ctrl+Alt+Shift+O | ^⌘⇧O | M-S-O | Quickly open current directory
+-- Ctrl+Alt+Shift+P | ^⌘⇧P | M-^P | Quickly open current project
+-- Ctrl+Shift+K | ⌥⇧⇥ | M-S-K | Insert snippet...
+-- Tab | ⇥ | Tab | Expand snippet or next placeholder
+-- Shift+Tab | ⇧⇥ | S-Tab | Previous snippet placeholder
+-- Esc | Esc | Esc | Cancel snippet
+-- Ctrl+K | ⌥⇥ | M-K | Complete trigger word
+-- Ctrl+Space | ⌥Esc | ^Space | Complete symbol
+-- Ctrl+H | ^H | M-H<br/>M-S-H | Show documentation
+-- Ctrl+I | ⌘I | M-S-I | Show style
+-- **Buffer**| | |
+-- Ctrl+Tab | ^⇥ | M-N | Next buffer
+-- Ctrl+Shift+Tab | ^⇧⇥ | M-P | Previous buffer
+-- Ctrl+B | ⌘B | M-B<br/>M-S-B | Switch to buffer...
+-- None | None | None | Tab width: 2
+-- None | None | None | Tab width: 3
+-- None | None | None | Tab width: 4
+-- None | None | None | Tab width: 8
+-- Ctrl+Alt+Shift+T | ^⇧T | M-T<br/>M-S-T | Toggle use tabs
+-- Ctrl+Alt+I | ^I | M-I | Convert indentation
+-- None | None | None | CR+LF EOL mode
+-- None | None | None | LF EOL mode
+-- None | None | None | UTF-8 encoding
+-- None | None | None | ASCII encoding
+-- None | None | None | CP-1252 encoding
+-- None | None | None | UTF-16 encoding
+-- Ctrl+Alt+\\ | ^\\ | None | Toggle wrap mode
+-- Ctrl+Alt+Shift+S | ^⇧S | None | Toggle view whitespace
+-- Ctrl+Shift+L | ⌘⇧L | M-S-L | Select lexer...
+-- **View**| | |
+-- Ctrl+Alt+N | ^⌥⇥ | M-^V N | Next view
+-- Ctrl+Alt+P | ^⌥⇧⇥ | M-^V P | Previous view
+-- Ctrl+Alt+S<br/>Ctrl+Alt+H | ^S | M-^V S<br/>M-^V H | Split view horizontal
+-- Ctrl+Alt+V | ^V | M-^V V | Split view vertical
+-- Ctrl+Alt+W | ^W | M-^V W | Unsplit view
+-- Ctrl+Alt+Shift+W | ^⇧W | M-^V S-W | Unsplit all views
+-- Ctrl+Alt++<br/>Ctrl+Alt+= | ^+<br/>^= | M-^V +<br/>M-^V = | Grow view
+-- Ctrl+Alt+- | ^- | M-^V - | Shrink view
+-- Ctrl+* | ⌘* | M-* | Toggle current fold
+-- Ctrl+Alt+Shift+I | ^⇧I | N/A | Toggle indent guides
+-- Ctrl+Alt+Shift+V | ^⇧V | None | Toggle virtual space
+-- Ctrl+= | ⌘= | N/A | Zoom in
+-- Ctrl+- | ⌘- | N/A | Zoom out
+-- Ctrl+0 | ⌘0 | N/A | Reset zoom
+-- **Help**|| |
+-- F1 | F1 | None | Open manual
+-- Shift+F1 | ⇧F1 | None | Open LuaDoc
+-- None | None | None | About
+-- **Movement**| | |
+-- Down | ⇣<br/>^N | ^N<br/>Down | Line down
+-- Shift+Down | ⇧⇣<br/>^⇧N | S-Down | Line down extend selection
+-- Ctrl+Down | ^⇣ | ^Down | Scroll line down
+-- Alt+Shift+Down | ⌥⇧⇣ | M-S-Down | Line down extend rect. selection
+-- Up | ⇡<br/>^P | ^P<br/>Up | Line up
+-- Shift+Up | ⇧⇡<br/>^⇧P | S-Up | Line up extend selection
+-- Ctrl+Up | ^⇡ | ^Up | Scroll line up
+-- Alt+Shift+Up | ⌥⇧⇡ | M-S-Up | Line up extend rect. selection
+-- Left | ⇠<br/>^B | ^B<br/>Left | Char left
+-- Shift+Left | ⇧⇠<br/>^⇧B | S-Left | Char left extend selection
+-- Ctrl+Left | ⌥⇠<br/>^⌘B | ^Left | Word left
+-- Ctrl+Shift+Left | ^⇧⇠<br/>^⌘⇧B | S-^Left | Word left extend selection
+-- Alt+Shift+Left | ⌥⇧⇠ | M-S-Left | Char left extend rect. selection
+-- Right | ⇢<br/>^F | ^F<br/>Right | Char right
+-- Shift+Right | ⇧⇢<br/>^⇧F | S-Right | Char right extend selection
+-- Ctrl+Right | ⌥⇢<br/>^⌘F | ^Right | Word right
+-- Ctrl+Shift+Right | ^⇧⇢<br/>^⌘⇧F | S-^Right | Word right extend selection
+-- Alt+Shift+Right | ⌥⇧⇢ | M-S-Right | Char right extend rect. selection
+-- Home | ⌘⇠<br/>^A | ^A<br/>Home | Line start
+-- Shift+Home | ⌘⇧⇠<br/>^⇧A | M-S-A | Line start extend selection
+-- Ctrl+Home | ⌘⇡<br/>⌘↖ | M-^A | Document start
+-- Ctrl+Shift+Home | ⌘⇧⇡<br/>⌘⇧↖ | None | Document start extend selection
+-- Alt+Shift+Home | ⌥⇧↖ | None | Line start extend rect. selection
+-- End | ⌘⇢<br/>^E | ^E<br/>End | Line end
+-- Shift+End | ⌘⇧⇢<br/>^⇧E | M-S-E | Line end extend selection
+-- Ctrl+End | ⌘⇣<br/>⌘↘ | M-^E | Document end
+-- Ctrl+Shift+End | ⌘⇧⇣<br/>⌘⇧↘ | None | Document end extend selection
+-- Alt+Shift+End | ⌥⇧↘ | None | Line end extend rect. selection
+-- PgUp | ⇞ | PgUp | Page up
+-- Shift+PgUp | ⇧⇞ | M-S-U | Page up extend selection
+-- Alt+Shift+PgUp | ⌥⇧⇞ | None | Page up extend rect. selection
+-- PgDn | ⇟ | PgDn | Page down
+-- Shift+PgDn | ⇧⇟ | M-S-D | Page down extend selection
+-- Alt+Shift+PgDn | ⌥⇧⇟ | None | Page down extend rect. selection
+-- Ctrl+Del | ⌘⌦ | ^Del | Delete word right
+-- Ctrl+Shift+Del | ⌘⇧⌦ | S-^Del | Delete line right
+-- Ins | Ins | Ins | Toggle overtype
+-- Bksp | ⌫<br/>⇧⌫ | ^H<br/>Bksp | Delete back
+-- Ctrl+Bksp | ⌘⌫ | None | Delete word left
+-- Ctrl+Shift+Bksp | ⌘⇧⌫ | None | Delete line left
+-- Tab | ⇥ | Tab<br/>^I | Insert tab or indent
+-- Shift+Tab | ⇧⇥ | S-Tab | Dedent
+-- None | ^K | ^K | Cut to line end
+-- None | ^L | None | Center line vertically
+-- N/A | N/A | ^^ | Mark text at the caret position
+-- N/A | N/A | ^] | Swap caret and mark anchor
+-- **UTF-8 Input**|||
+-- Ctrl+Shift+U *xxxx* Enter | ⌘⇧U *xxxx* ↩ | M-U *xxxx* Enter | Insert U-*xxxx* char.
+-- **Find Fields**|||
+-- Left | ⇠<br/>^B | ^B<br/>Left | Cursor left
+-- Right | ⇢<br/>^F | ^F<br/>Right | Cursor right
+-- Del | ⌦ | Del | Delete forward
+-- Bksp | ⌫ | ^H<br/>Bksp | Delete back
+-- Ctrl+V | ⌘V | ^V | Paste
+-- N/A | N/A | ^X | Cut all
+-- N/A | N/A | ^Y | Copy all
+-- N/A | N/A | ^U | Erase all
+-- Home | ↖<br/>⌘⇠<br/>^A | ^A | Home
+-- End | ↘<br/>⌘⇢<br/>^E | ^E | End
+-- N/A | N/A | ^T | Transpose characters
+-- N/A | N/A | Tab | Toggle find/replace buttons
+-- Tab | ⇥ | Down | Focus replace field
+-- Shift+Tab | ⇧⇥ | Up | Focus find field
+-- Up | ⇡ | ^P | Cycle back through history
+-- Down | ⇣ | ^N | Cycle forward through history
+-- N/A | N/A | F1 | Toggle "Match Case"
+-- N/A | N/A | F2 | Toggle "Whole Word"
+-- N/A | N/A | F3 | Toggle "Regex"
+-- N/A | N/A | F4 | Toggle "Find in Files"
--
-- †: Some terminals interpret ^Z as suspend; see FAQ for workaround.
--
@@ -251,13 +251,12 @@ module('textadept.keys')]]
-- Key bindings available depend on your implementation of curses.
--
-- For ncurses (Linux, macOS, BSD):
--- * The only Control keys recognized are 'ctrl+a'-'ctrl+z', 'ctrl+ ',
--- 'ctrl+\\', 'ctrl+]', 'ctrl+^', and 'ctrl+_'.
+-- * The only Control keys recognized are 'ctrl+a'-'ctrl+z', 'ctrl+ ', 'ctrl+\\', 'ctrl+]',
+-- 'ctrl+^', and 'ctrl+_'.
-- * Control+Shift and Control+Meta+Shift keys are not recognized.
-- * Modifiers for function keys F1-F12 are not recognized.
-- For pdcurses (Win32):
--- * Many Control+Symbol keys are not recognized, but most
--- Control+Shift+Symbol keys are.
+-- * Many Control+Symbol keys are not recognized, but most Control+Shift+Symbol keys are.
-- * Ctrl+Meta+Symbol keys are not recognized.
--
-- Unassigned keys (~ denotes keys reserved by the operating system):
@@ -272,8 +271,7 @@ module('textadept.keys')]]
-- Control, Meta, and 'a' = 'ctrl+meta+a'
local _L = _L
--- Returns the menu command associated with the '/'-separated string of menu
--- labels.
+-- Returns the menu command associated with the '/'-separated string of menu labels.
-- Labels are automatically localized.
-- @param labels Path to the menu command.
-- @usage m('Edit/Select/Select in XML Tag')
@@ -283,6 +281,7 @@ local function m(labels)
return menu[2]
end
+-- LuaFormatter off
-- Bindings for Linux/Win32, macOS, Terminal.
local bindings = {
-- File.
@@ -311,15 +310,13 @@ local bindings = {
[m('Edit/Delete Word')] = {'alt+del', 'ctrl+del', {'meta+del', 'meta+d'}},
[buffer.select_all] = {'ctrl+a', 'cmd+a', 'meta+a'},
[m('Edit/Match Brace')] = {'ctrl+m', 'ctrl+m', 'meta+m'},
- [m('Edit/Complete Word')] =
- {'ctrl+\n', 'ctrl+esc', {'ctrl+meta+j', 'ctrl+\n'}},
+ [m('Edit/Complete Word')] = {'ctrl+\n', 'ctrl+esc', {'ctrl+meta+j', 'ctrl+\n'}},
[textadept.editing.toggle_comment] = {'ctrl+/', 'ctrl+/', 'meta+/'},
[textadept.editing.transpose_chars] = {'ctrl+t', 'ctrl+t', 'ctrl+t'},
[textadept.editing.join_lines] = {'ctrl+J', 'ctrl+j', 'meta+j'},
[m('Edit/Filter Through')] = {'ctrl+|', 'cmd+|', 'ctrl+\\'},
-- Select.
- [m('Edit/Select/Select between Matching Delimiters')] =
- {'ctrl+M', 'ctrl+M', 'meta+M'},
+ [m('Edit/Select/Select between Matching Delimiters')] = {'ctrl+M', 'ctrl+M', 'meta+M'},
[m('Edit/Select/Select between XML Tags')] = {'ctrl+<', 'cmd+<', 'meta+<'},
[m('Edit/Select/Select in XML Tag')] = {'ctrl+>', 'cmd+>', nil},
[textadept.editing.select_word] = {'ctrl+D', 'cmd+D', 'meta+W'},
@@ -335,10 +332,8 @@ local bindings = {
[m('Edit/Selection/Enclose in Parentheses')] = {'alt+(', 'ctrl+(', 'meta+)'},
[m('Edit/Selection/Enclose in Brackets')] = {'alt+[', 'ctrl+[', 'meta+]'},
[m('Edit/Selection/Enclose in Braces')] = {'alt+{', 'ctrl+{', 'meta+}'},
- [buffer.move_selected_lines_up] =
- {'ctrl+shift+up', 'ctrl+shift+up', 'ctrl+shift+up'},
- [buffer.move_selected_lines_down] =
- {'ctrl+shift+down', 'ctrl+shift+down', 'ctrl+shift+down'},
+ [buffer.move_selected_lines_up] = {'ctrl+shift+up', 'ctrl+shift+up', 'ctrl+shift+up'},
+ [buffer.move_selected_lines_down] = {'ctrl+shift+down', 'ctrl+shift+down', 'ctrl+shift+down'},
-- History.
[textadept.history.back] = {'alt+,', 'ctrl+,', 'meta+,'},
[textadept.history.forward] = {'alt+.', 'ctrl+.', 'meta+.'},
@@ -385,11 +380,9 @@ local bindings = {
[textadept.macros.record] = {'f9', 'f9', 'f9'},
[textadept.macros.play] = {'shift+f9', 'shift+f9', 'f10'},
-- Quick Open.
- [m('Tools/Quick Open/Quickly Open User Home')] =
- {'ctrl+u', 'cmd+u', 'ctrl+u'},
+ [m('Tools/Quick Open/Quickly Open User Home')] = {'ctrl+u', 'cmd+u', 'ctrl+u'},
-- TODO: m('Tools/Quickly Open Textadept Home')
- [m('Tools/Quick Open/Quickly Open Current Directory')] =
- {'ctrl+alt+O', 'ctrl+cmd+O', 'meta+O'},
+ [m('Tools/Quick Open/Quickly Open Current Directory')] = {'ctrl+alt+O', 'ctrl+cmd+O', 'meta+O'},
[io.quick_open] = {'ctrl+alt+P', 'ctrl+cmd+P', 'ctrl+meta+p'},
-- Snippets.
[textadept.snippets.select] = {'ctrl+K', 'shift+alt+\t', 'meta+K'},
@@ -399,8 +392,7 @@ local bindings = {
[m('Tools/Snippets/Complete Trigger Word')] = {'ctrl+k', 'alt+\t', 'meta+k'},
-- Other.
[m('Tools/Complete Symbol')] = {'ctrl+ ', 'alt+esc', 'ctrl+ '},
- [textadept.editing.show_documentation] =
- {'ctrl+h', 'ctrl+h', {'meta+h', 'meta+H'}},
+ [textadept.editing.show_documentation] = {'ctrl+h', 'ctrl+h', {'meta+h', 'meta+H'}},
[m('Tools/Show Style')] = {'ctrl+i', 'cmd+i', 'meta+I'},
-- Buffer.
@@ -412,8 +404,7 @@ local bindings = {
-- TODO: m('Buffer/Indentation/Tab width: 3')
-- TODO: m('Buffer/Indentation/Tab width: 4')
-- TODO: m('Buffer/Indentation/Tab width: 8')
- [m('Buffer/Indentation/Toggle Use Tabs')] =
- {'ctrl+alt+T', 'ctrl+T', {'meta+t', 'meta+T'}},
+ [m('Buffer/Indentation/Toggle Use Tabs')] = {'ctrl+alt+T', 'ctrl+T', {'meta+t', 'meta+T'}},
[textadept.editing.convert_indentation] = {'ctrl+alt+i', 'ctrl+i', 'meta+i'},
-- EOL Mode.
-- TODO: m('Buffer/EOL Mode/CRLF')
@@ -430,13 +421,11 @@ local bindings = {
-- View.
[m('View/Next View')] = {'ctrl+alt+n', 'ctrl+alt+\t', nil},
[m('View/Previous View')] = {'ctrl+alt+p', 'ctrl+alt+shift+\t', nil},
- [m('View/Split View Horizontal')] =
- {{'ctrl+alt+s', 'ctrl+alt+h'}, 'ctrl+s', nil},
+ [m('View/Split View Horizontal')] = {{'ctrl+alt+s', 'ctrl+alt+h'}, 'ctrl+s', nil},
[m('View/Split View Vertical')] = {'ctrl+alt+v', 'ctrl+v', nil},
[m('View/Unsplit View')] = {'ctrl+alt+w', 'ctrl+w', nil},
[m('View/Unsplit All Views')] = {'ctrl+alt+W', 'ctrl+W', nil},
- [m('View/Grow View')] =
- {{'ctrl+alt++', 'ctrl+alt+='}, {'ctrl++', 'ctrl+='}, nil},
+ [m('View/Grow View')] = {{'ctrl+alt++', 'ctrl+alt+='}, {'ctrl++', 'ctrl+='}, nil},
[m('View/Shrink View')] = {'ctrl+alt+-', 'ctrl+-', nil},
[m('View/Toggle Current Fold')] = {'ctrl+*', 'cmd+*', 'meta+*'},
[m('View/Toggle Show Indent Guides')] = {'ctrl+alt+I', 'ctrl+I', nil},
@@ -450,34 +439,27 @@ local bindings = {
[m('Help/Show LuaDoc')] = {'shift+f1', 'shift+f1', nil},
-- Movement commands.
- -- Unbound keys are handled by Scintilla, but when playing back a macro, this
- -- is not possible. Define some useful default key bindings so Scintilla does
- -- not have to handle them. Note that Scintilla still will handle some keys.
+ -- Unbound keys are handled by Scintilla, but when playing back a macro, this is not possible.
+ -- Define some useful default key bindings so Scintilla does not have to handle them. Note
+ -- that Scintilla still will handle some keys.
[buffer.line_down] = {'down', {'down', 'ctrl+n'}, {'down', 'ctrl+n'}},
- [buffer.line_down_extend] =
- {'shift+down', {'shift+down', 'ctrl+N'}, 'shift+down'},
+ [buffer.line_down_extend] = {'shift+down', {'shift+down', 'ctrl+N'}, 'shift+down'},
[buffer.line_up] = {'up', {'up', 'ctrl+p'}, {'up', 'ctrl+p'}},
[buffer.line_up_extend] = {'shift+up', {'shift+up', 'ctrl+P'}, 'shift+up'},
[buffer.char_left] = {'left', {'left', 'ctrl+b'}, {'left', 'ctrl+b'}},
- [buffer.char_left_extend] =
- {'shift+left', {'shift+left', 'ctrl+B'}, 'shift+left'},
+ [buffer.char_left_extend] = {'shift+left', {'shift+left', 'ctrl+B'}, 'shift+left'},
[buffer.word_left] = {'ctrl+left', {'alt+left', 'ctrl+cmd+b'}, 'ctrl+left'},
[buffer.word_left_extend] =
{'ctrl+shift+left', {'ctrl+shift+left', 'ctrl+cmd+B'}, 'ctrl+shift+left'},
[buffer.char_right] = {'right', {'right', 'ctrl+f'}, {'right', 'ctrl+f'}},
- [buffer.char_right_extend] =
- {'shift+right', {'shift+right', 'ctrl+F'}, 'shift+right'},
- [buffer.word_right] =
- {'ctrl+right', {'alt+right', 'ctrl+cmd+f'}, 'ctrl+right'},
- [buffer.word_right_end_extend] = {
- 'ctrl+shift+right', {'ctrl+shift+right', 'ctrl+cmd+F'}, 'ctrl+shift+right'
- },
+ [buffer.char_right_extend] = {'shift+right', {'shift+right', 'ctrl+F'}, 'shift+right'},
+ [buffer.word_right] = {'ctrl+right', {'alt+right', 'ctrl+cmd+f'}, 'ctrl+right'},
+ [buffer.word_right_end_extend] =
+ {'ctrl+shift+right', {'ctrl+shift+right', 'ctrl+cmd+F'}, 'ctrl+shift+right'},
[buffer.vc_home] = {'home', {'cmd+left', 'ctrl+a'}, {'home', 'ctrl+a'}},
- [buffer.vc_home_extend] =
- {'shift+home', {'cmd+shift+left', 'ctrl+A'}, 'meta+A'},
+ [buffer.vc_home_extend] = {'shift+home', {'cmd+shift+left', 'ctrl+A'}, 'meta+A'},
[buffer.line_end] = {'end', {'cmd+right', 'ctrl+e'}, {'end', 'ctrl+e'}},
- [buffer.line_end_extend] =
- {'shift+end', {'cmd+shift+right', 'ctrl+E'}, 'meta+E'},
+ [buffer.line_end_extend] = {'shift+end', {'cmd+shift+right', 'ctrl+E'}, 'meta+E'},
[view.vertical_center_caret] = {nil, 'ctrl+l', nil},
[buffer.page_up_extend] = {nil, nil, 'meta+U'},
[buffer.page_down_extend] = {nil, nil, 'meta+D'},
@@ -486,11 +468,10 @@ local bindings = {
[function()
buffer:line_end_extend()
- if not buffer.selection_empty then buffer:cut() else buffer:clear() end
+ buffer[not buffer.selection_empty and 'cut' or 'clear'](buffer)
end] = {nil, 'ctrl+k', 'ctrl+k'},
[buffer.del_word_right] = {'ctrl+del', 'cmd+del', 'ctrl+del'},
- [buffer.del_line_right] =
- {'ctrl+shift+del', 'cmd+shift+del', 'ctrl+shift+del'},
+ [buffer.del_line_right] = {'ctrl+shift+del', 'cmd+shift+del', 'ctrl+shift+del'},
[buffer.delete_back] = {'\b', '\b', {'\b', 'ctrl+h'}},
[buffer.del_word_left] = {'ctrl+\b', 'cmd+\b', nil},
[buffer.del_line_left] = {'ctrl+shift+\b', 'cmd+shift+\b', nil},
@@ -500,10 +481,10 @@ local bindings = {
-- Other.
-- UTF-8 input.
[function()
- ui.command_entry.run(
- function(code) buffer:add_text(utf8.char(tonumber(code, 16))) end)
+ ui.command_entry.run(function(code) buffer:add_text(utf8.char(tonumber(code, 16))) end)
end] = {nil, 'cmd+U', 'meta+u'}
}
+-- LuaFormatter on
local keys, plat = keys, CURSES and 3 or OSX and 2 or 1
for f, plat_keys in pairs(bindings) do
@@ -517,16 +498,14 @@ end
if CURSES then
keys['ctrl+meta+v'] = {
- n = m('View/Next View'), p = m('View/Previous View'),
- s = m('View/Split View Horizontal'), h = m('View/Split View Horizontal'),
- v = m('View/Split View Vertical'), w = m('View/Unsplit View'),
- W = m('View/Unsplit All Views'), ['+'] = m('View/Grow View'),
+ n = m('View/Next View'), p = m('View/Previous View'), s = m('View/Split View Horizontal'),
+ h = m('View/Split View Horizontal'), v = m('View/Split View Vertical'),
+ w = m('View/Unsplit View'), W = m('View/Unsplit All Views'), ['+'] = m('View/Grow View'),
['='] = m('View/Grow View'), ['-'] = m('View/Shrink View')
}
end
--- GTK-OSX reports Fn-key as a single keycode which confuses Scintilla. Do
--- not propagate it.
+-- GTK-OSX reports Fn-key as a single keycode which confuses Scintilla. Do not propagate it.
if OSX then keys.fn = function() return true end end
return M