Skip to content

Commit

Permalink
Document binding keys to a command (alacritty#647)
Browse files Browse the repository at this point in the history
* Refactor `key_bindings` documentation

* Document binding keys to a `command`

The ability for `key_bindings` to trigger a `command` was added in alacritty#566.
This commit documents their use, and gives a simple example.

Resolves alacritty#646.
  • Loading branch information
OJFord authored and jwilm committed Jul 2, 2017
1 parent 3cdba29 commit 32dfddb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions alacritty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,14 @@ visual_bell:
# capitalization must match exactly, and piped items must not have whitespace
# around them.
#
# Either an `action` or `chars` field must be present. `chars` writes the
# specified string every time that binding is activated. These should generally
# be escape sequences, but they can be configured to send arbitrary strings of
# bytes. Possible values of `action` include `Paste` and `PasteSelection`.
# Either an `action`, `chars`, or `command` field must be present.
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
# `chars` writes the specified string every time that binding is activated.
# These should generally be escape sequences, but they can be configured to
# send arbitrary strings of bytes.
# `command` must be a map containing a `program` string, and `args` array of
# strings. For example:
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
#
# Want to add a binding (e.g. "PageUp") but are unsure what the X sequence
# (e.g. "\x1b[5~") is? Open another terminal (like xterm) without tmux,
Expand Down
12 changes: 8 additions & 4 deletions alacritty_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,14 @@ visual_bell:
# capitalization must match exactly, and piped items must not have whitespace
# around them.
#
# Either an `action` or `chars` field must be present. `chars` writes the
# specified string every time that binding is activated. These should generally
# be escape sequences, but they can be configured to send arbitrary strings of
# bytes. Possible values of `action` include `Paste` and `PasteSelection`.
# Either an `action`, `chars`, or `command` field must be present.
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
# `chars` writes the specified string every time that binding is activated.
# These should generally be escape sequences, but they can be configured to
# send arbitrary strings of bytes.
# `command` must be a map containing a `program` string, and `args` array of
# strings. For example:
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
key_bindings:
- { key: V, mods: Command, action: Paste }
- { key: C, mods: Command, action: Copy }
Expand Down

0 comments on commit 32dfddb

Please sign in to comment.