1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Add Function + Modifier keybindings (#853)

Also rearranged the default config slightly to move the long key binding
list to the bottom of the file.

Resolves #690
Resolves #727
This commit is contained in:
Joe Wilm 2017-10-20 07:59:28 -07:00 committed by GitHub
parent 5ac42bb13b
commit 9f79d72109
2 changed files with 186 additions and 89 deletions

View file

@ -173,6 +173,46 @@ visual_bell:
# Background opacity # Background opacity
background_opacity: 1.0 background_opacity: 1.0
# Mouse bindings
#
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must
# be specified.
#
# Values for `mouse`:
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# Values for `action`:
# - Paste
# - PasteSelection
# - Copy (TODO)
mouse_bindings:
- { mouse: Middle, action: PasteSelection }
mouse:
double_click: { threshold: 300 }
triple_click: { threshold: 300 }
selection:
semantic_escape_chars: ",│`|:\"' ()[]{}<>"
hide_cursor_when_typing: false
# Live config reload (changes require restart)
live_config_reload: true
# Shell
#
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.
# Entries in shell.args are passed unmodified as arguments to the shell.
# shell:
# program: /bin/bash
# args:
# - --login
# Key bindings # Key bindings
# #
# Each binding is defined as an object with some properties. Most of the # Each binding is defined as an object with some properties. Most of the
@ -228,6 +268,11 @@ key_bindings:
- { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" }
- { key: PageDown, mods: Control, chars: "\x1b[6;5~" } - { key: PageDown, mods: Control, chars: "\x1b[6;5~" }
- { key: PageDown, chars: "\x1b[6~" } - { key: PageDown, chars: "\x1b[6~" }
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
- { key: Back, chars: "\x7f" }
- { key: Back, mods: Alt, chars: "\x1b\x7f" }
- { key: Insert, chars: "\x1b[2~" }
- { key: Delete, chars: "\x1b[3~" }
- { key: Left, mods: Shift, chars: "\x1b[1;2D" } - { key: Left, mods: Shift, chars: "\x1b[1;2D" }
- { key: Left, mods: Control, chars: "\x1b[1;5D" } - { key: Left, mods: Control, chars: "\x1b[1;5D" }
- { key: Left, mods: Alt, chars: "\x1b[1;3D" } - { key: Left, mods: Alt, chars: "\x1b[1;3D" }
@ -248,7 +293,6 @@ key_bindings:
- { key: Down, mods: Alt, chars: "\x1b[1;3B" } - { key: Down, mods: Alt, chars: "\x1b[1;3B" }
- { key: Down, chars: "\x1b[B", mode: ~AppCursor } - { key: Down, chars: "\x1b[B", mode: ~AppCursor }
- { key: Down, chars: "\x1bOB", mode: AppCursor } - { key: Down, chars: "\x1bOB", mode: AppCursor }
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
- { key: F1, chars: "\x1bOP" } - { key: F1, chars: "\x1bOP" }
- { key: F2, chars: "\x1bOQ" } - { key: F2, chars: "\x1bOQ" }
- { key: F3, chars: "\x1bOR" } - { key: F3, chars: "\x1bOR" }
@ -261,46 +305,51 @@ key_bindings:
- { key: F10, chars: "\x1b[21~" } - { key: F10, chars: "\x1b[21~" }
- { key: F11, chars: "\x1b[23~" } - { key: F11, chars: "\x1b[23~" }
- { key: F12, chars: "\x1b[24~" } - { key: F12, chars: "\x1b[24~" }
- { key: Back, chars: "\x7f" } - { key: F1, mods: Shift, chars: "\x1b[1;2P" }
- { key: Back, mods: Alt, chars: "\x1b\x7f" } - { key: F2, mods: Shift, chars: "\x1b[1;2Q" }
- { key: Insert, chars: "\x1b[2~" } - { key: F3, mods: Shift, chars: "\x1b[1;2R" }
- { key: Delete, chars: "\x1b[3~" } - { key: F4, mods: Shift, chars: "\x1b[1;2S" }
- { key: F5, mods: Shift, chars: "\x1b[15;2~" }
# Mouse bindings - { key: F6, mods: Shift, chars: "\x1b[17;2~" }
# - { key: F7, mods: Shift, chars: "\x1b[18;2~" }
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must - { key: F8, mods: Shift, chars: "\x1b[19;2~" }
# be specified. - { key: F9, mods: Shift, chars: "\x1b[20;2~" }
# - { key: F10, mods: Shift, chars: "\x1b[21;2~" }
# Values for `mouse`: - { key: F11, mods: Shift, chars: "\x1b[23;2~" }
# - Middle - { key: F12, mods: Shift, chars: "\x1b[24;2~" }
# - Left - { key: F1, mods: Control, chars: "\x1b[1;5P" }
# - Right - { key: F2, mods: Control, chars: "\x1b[1;5Q" }
# - Numeric identifier such as `5` - { key: F3, mods: Control, chars: "\x1b[1;5R" }
# - { key: F4, mods: Control, chars: "\x1b[1;5S" }
# Values for `action`: - { key: F5, mods: Control, chars: "\x1b[15;5~" }
# - Paste - { key: F6, mods: Control, chars: "\x1b[17;5~" }
# - PasteSelection - { key: F7, mods: Control, chars: "\x1b[18;5~" }
# - Copy (TODO) - { key: F8, mods: Control, chars: "\x1b[19;5~" }
mouse_bindings: - { key: F9, mods: Control, chars: "\x1b[20;5~" }
- { mouse: Middle, action: PasteSelection } - { key: F10, mods: Control, chars: "\x1b[21;5~" }
- { key: F11, mods: Control, chars: "\x1b[23;5~" }
mouse: - { key: F12, mods: Control, chars: "\x1b[24;5~" }
double_click: { threshold: 300 } - { key: F1, mods: Alt, chars: "\x1b[1;6P" }
triple_click: { threshold: 300 } - { key: F2, mods: Alt, chars: "\x1b[1;6Q" }
- { key: F3, mods: Alt, chars: "\x1b[1;6R" }
selection: - { key: F4, mods: Alt, chars: "\x1b[1;6S" }
semantic_escape_chars: ",│`|:\"' ()[]{}<>" - { key: F5, mods: Alt, chars: "\x1b[15;6~" }
- { key: F6, mods: Alt, chars: "\x1b[17;6~" }
hide_cursor_when_typing: false - { key: F7, mods: Alt, chars: "\x1b[18;6~" }
- { key: F8, mods: Alt, chars: "\x1b[19;6~" }
# Live config reload (changes require restart) - { key: F9, mods: Alt, chars: "\x1b[20;6~" }
live_config_reload: true - { key: F10, mods: Alt, chars: "\x1b[21;6~" }
- { key: F11, mods: Alt, chars: "\x1b[23;6~" }
# Shell - { key: F12, mods: Alt, chars: "\x1b[24;6~" }
# - { key: F1, mods: Super, chars: "\x1b[1;3P" }
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish. - { key: F2, mods: Super, chars: "\x1b[1;3Q" }
# Entries in shell.args are passed unmodified as arguments to the shell. - { key: F3, mods: Super, chars: "\x1b[1;3R" }
#shell: - { key: F4, mods: Super, chars: "\x1b[1;3S" }
# program: /bin/bash - { key: F5, mods: Super, chars: "\x1b[15;3~" }
# args: - { key: F6, mods: Super, chars: "\x1b[17;3~" }
# - --login - { key: F7, mods: Super, chars: "\x1b[18;3~" }
- { key: F8, mods: Super, chars: "\x1b[19;3~" }
- { key: F9, mods: Super, chars: "\x1b[20;3~" }
- { key: F10, mods: Super, chars: "\x1b[21;3~" }
- { key: F11, mods: Super, chars: "\x1b[23;3~" }
- { key: F12, mods: Super, chars: "\x1b[24;3~" }

View file

@ -155,6 +155,46 @@ visual_bell:
# Background opacity # Background opacity
background_opacity: 1.0 background_opacity: 1.0
# Mouse bindings
#
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must
# be specified.
#
# Values for `mouse`:
# - Middle
# - Left
# - Right
# - Numeric identifier such as `5`
#
# Values for `action`:
# - Paste
# - PasteSelection
# - Copy (TODO)
mouse_bindings:
- { mouse: Middle, action: PasteSelection }
mouse:
double_click: { threshold: 300 }
triple_click: { threshold: 300 }
selection:
semantic_escape_chars: ",│`|:\"' ()[]{}<>"
hide_cursor_when_typing: false
# Live config reload (changes require restart)
live_config_reload: true
# Shell
#
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.
# Entries in shell.args are passed unmodified as arguments to the shell.
#
# shell:
# program: /bin/bash
# args:
# - --login
# Key bindings # Key bindings
# #
# Each binding is defined as an object with some properties. Most of the # Each binding is defined as an object with some properties. Most of the
@ -205,6 +245,11 @@ key_bindings:
- { key: PageDown, mods: Shift, chars: "\x1b[6;2~" } - { key: PageDown, mods: Shift, chars: "\x1b[6;2~" }
- { key: PageDown, mods: Control, chars: "\x1b[6;5~" } - { key: PageDown, mods: Control, chars: "\x1b[6;5~" }
- { key: PageDown, chars: "\x1b[6~" } - { key: PageDown, chars: "\x1b[6~" }
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
- { key: Back, chars: "\x7f" }
- { key: Back, mods: Alt, chars: "\x1b\x7f" }
- { key: Insert, chars: "\x1b[2~" }
- { key: Delete, chars: "\x1b[3~" }
- { key: Left, mods: Shift, chars: "\x1b[1;2D" } - { key: Left, mods: Shift, chars: "\x1b[1;2D" }
- { key: Left, mods: Control, chars: "\x1b[1;5D" } - { key: Left, mods: Control, chars: "\x1b[1;5D" }
- { key: Left, mods: Alt, chars: "\x1b[1;3D" } - { key: Left, mods: Alt, chars: "\x1b[1;3D" }
@ -225,7 +270,6 @@ key_bindings:
- { key: Down, mods: Alt, chars: "\x1b[1;3B" } - { key: Down, mods: Alt, chars: "\x1b[1;3B" }
- { key: Down, chars: "\x1b[B", mode: ~AppCursor } - { key: Down, chars: "\x1b[B", mode: ~AppCursor }
- { key: Down, chars: "\x1bOB", mode: AppCursor } - { key: Down, chars: "\x1bOB", mode: AppCursor }
- { key: Tab, mods: Shift, chars: "\x1b[Z" }
- { key: F1, chars: "\x1bOP" } - { key: F1, chars: "\x1bOP" }
- { key: F2, chars: "\x1bOQ" } - { key: F2, chars: "\x1bOQ" }
- { key: F3, chars: "\x1bOR" } - { key: F3, chars: "\x1bOR" }
@ -238,47 +282,51 @@ key_bindings:
- { key: F10, chars: "\x1b[21~" } - { key: F10, chars: "\x1b[21~" }
- { key: F11, chars: "\x1b[23~" } - { key: F11, chars: "\x1b[23~" }
- { key: F12, chars: "\x1b[24~" } - { key: F12, chars: "\x1b[24~" }
- { key: Back, chars: "\x7f" } - { key: F1, mods: Shift, chars: "\x1b[1;2P" }
- { key: Back, mods: Alt, chars: "\x1b\x7f" } - { key: F2, mods: Shift, chars: "\x1b[1;2Q" }
- { key: Insert, chars: "\x1b[2~" } - { key: F3, mods: Shift, chars: "\x1b[1;2R" }
- { key: Delete, chars: "\x1b[3~" } - { key: F4, mods: Shift, chars: "\x1b[1;2S" }
- { key: F5, mods: Shift, chars: "\x1b[15;2~" }
# Mouse bindings - { key: F6, mods: Shift, chars: "\x1b[17;2~" }
# - { key: F7, mods: Shift, chars: "\x1b[18;2~" }
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must - { key: F8, mods: Shift, chars: "\x1b[19;2~" }
# be specified. - { key: F9, mods: Shift, chars: "\x1b[20;2~" }
# - { key: F10, mods: Shift, chars: "\x1b[21;2~" }
# Values for `mouse`: - { key: F11, mods: Shift, chars: "\x1b[23;2~" }
# - Middle - { key: F12, mods: Shift, chars: "\x1b[24;2~" }
# - Left - { key: F1, mods: Control, chars: "\x1b[1;5P" }
# - Right - { key: F2, mods: Control, chars: "\x1b[1;5Q" }
# - Numeric identifier such as `5` - { key: F3, mods: Control, chars: "\x1b[1;5R" }
# - { key: F4, mods: Control, chars: "\x1b[1;5S" }
# Values for `action`: - { key: F5, mods: Control, chars: "\x1b[15;5~" }
# - Paste - { key: F6, mods: Control, chars: "\x1b[17;5~" }
# - PasteSelection - { key: F7, mods: Control, chars: "\x1b[18;5~" }
# - Copy (TODO) - { key: F8, mods: Control, chars: "\x1b[19;5~" }
mouse_bindings: - { key: F9, mods: Control, chars: "\x1b[20;5~" }
- { mouse: Middle, action: PasteSelection } - { key: F10, mods: Control, chars: "\x1b[21;5~" }
- { key: F11, mods: Control, chars: "\x1b[23;5~" }
mouse: - { key: F12, mods: Control, chars: "\x1b[24;5~" }
double_click: { threshold: 300 } - { key: F1, mods: Alt, chars: "\x1b[1;6P" }
triple_click: { threshold: 300 } - { key: F2, mods: Alt, chars: "\x1b[1;6Q" }
- { key: F3, mods: Alt, chars: "\x1b[1;6R" }
selection: - { key: F4, mods: Alt, chars: "\x1b[1;6S" }
semantic_escape_chars: ",│`|:\"' ()[]{}<>" - { key: F5, mods: Alt, chars: "\x1b[15;6~" }
- { key: F6, mods: Alt, chars: "\x1b[17;6~" }
hide_cursor_when_typing: false - { key: F7, mods: Alt, chars: "\x1b[18;6~" }
- { key: F8, mods: Alt, chars: "\x1b[19;6~" }
# Live config reload (changes require restart) - { key: F9, mods: Alt, chars: "\x1b[20;6~" }
live_config_reload: true - { key: F10, mods: Alt, chars: "\x1b[21;6~" }
- { key: F11, mods: Alt, chars: "\x1b[23;6~" }
# Shell - { key: F12, mods: Alt, chars: "\x1b[24;6~" }
# - { key: F1, mods: Command, chars: "\x1b[1;3P" }
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish. - { key: F2, mods: Command, chars: "\x1b[1;3Q" }
# Entries in shell.args are passed unmodified as arguments to the shell. - { key: F3, mods: Command, chars: "\x1b[1;3R" }
# - { key: F4, mods: Command, chars: "\x1b[1;3S" }
#shell: - { key: F5, mods: Command, chars: "\x1b[15;3~" }
# program: /bin/bash - { key: F6, mods: Command, chars: "\x1b[17;3~" }
# args: - { key: F7, mods: Command, chars: "\x1b[18;3~" }
# - --login - { key: F8, mods: Command, chars: "\x1b[19;3~" }
- { key: F9, mods: Command, chars: "\x1b[20;3~" }
- { key: F10, mods: Command, chars: "\x1b[21;3~" }
- { key: F11, mods: Command, chars: "\x1b[23;3~" }
- { key: F12, mods: Command, chars: "\x1b[24;3~" }