aboutsummaryrefslogtreecommitdiffstats
path: root/config/bindings.go
Commit message (Collapse)AuthorAgeFilesLines
* bindings: add alt modifierJohn Gebbie2022-09-131-0/+39
| | | | | | | Enables bindings like <A-left>. Signed-off-by: John Gebbie <me@johngebbie.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: display active keybinds in a dialog boxKoni Marti2022-08-221-5/+5
| | | | | | | | | Show contextual keybinds in a textbox when using the ':help keys' command. This command is bound to '?' by default. Fixes: https://todo.sr.ht/~rjarry/aerc/42 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* bindings: fix FormatKeyStrokes for <tab> and <enter>Robin Jarry2022-08-101-1/+4
| | | | | | | | | | | Sometimes, a <tab> or <enter> key in a binding will be formatted as a <c-i> or <c-m> respectively. This is because these keys are equivalent. Prefer their canonical name instead of the control modifier variant. Fixes: 5e600d7ab46b ("binds: fix ctrl-i and ctrl-m key definitions") Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Koni Marti <koni.marti@gmail.com>
* lint: homogenize operations and minor fixes (gocritic)Moritz Poldrack2022-08-041-3/+4
| | | | | | | | | | | | | | | | | | Apply GoDoc comment policy (comments for humans should have a space after the //; machine-readable comments shouldn't) Use strings.ReplaceAll instead of strings.Replace when appropriate Remove if/else chains by replacing them with switches Use short assignment/increment notation Replace single case switches with if statements Combine else and if when appropriate Signed-off-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-7/+5
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: fix ctrl-i and ctrl-m key definitionsRobin Jarry2022-07-171-2/+2
| | | | | | | | | | | | | | | | On all terminals, ctrl-i sends a tab character (0x09). For some reason, tcell.ModCtrl+tcell.KeyCtrlI is interpreted as ctrl-tab. Similarly, ctrl-m sends a new line (0x0a) and tcell.ModCtrl+tcell.KeyCtrlM is interpreted as ctrl-enter. Remove control modifier for these two key definitions only. All others do not work without them. Fixes: 7a6c808c042b ("bindings: prepare for more modifers") Fixes: https://todo.sr.ht/~rjarry/aerc/56 Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* binds: fix incorrect key names for c-] and c-[Ivan Oleynikov2022-04-251-2/+2
| | | | | | | The left and right square brackets are inverted. Fix that. Signed-off-by: Ivan Oleynikov <ivan.oleynikov95@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
* binds: allow to bind a command to < and >Koni Marti2022-04-171-0/+8
| | | | | | | | | | | | | | | Allow to bind to < and > by using \< and \> in binds.conf. Ensure that the single \ can still be properly used to bind to other commands. For example, the following binds would work now: \< = :prev-tab<Enter> \> = :next-tab<Enter> \ = :filter<space> Fixes: https://todo.sr.ht/~rjarry/aerc/37 Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Sebastian LaVine <mail@smlavine.com> Acked-by: Robin Jarry <robin@jarry.cc>
* review: display actual bindings for commandsRobin Jarry2022-02-021-0/+47
| | | | | | | | | Parse the actual user bindings to determine what shortcuts are available in the compose::review stage. Add a predefined list of commands for which we want to display the keyboard shortcuts. Fixes: https://todo.sr.ht/~rjarry/aerc/14 Signed-off-by: Robin Jarry <robin@jarry.cc>
* bindings: fix ctrl-h binding not workingRobin Jarry2022-01-201-1/+1
| | | | | | | | | For some unknown reason. tcell does not include the ctrl modifier for the ctrl-h key event. Fixes: 7a6c808c042b ("bindings: prepare for more modifers") Fixes: https://todo.sr.ht/~rjarry/aerc/8 Signed-off-by: Robin Jarry <robin@jarry.cc>
* binds: add account specific bindingsJonathan Bartlett2021-12-111-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using aerc for multiple accounts often bindings might differ slightly between accounts. For example: * Account A archives to one directory (:archive) * Account B archives to monthly directories (:archive month) Add account specific bindings to allow the user to add a "context" to a binding group using a context specifier and a regular expression. Currently the only context specifier is 'account'. The regular expression is validated against the accounts loaded from accounts.conf and the configuration fails to load if there are no matches. Contextual bindings are merged with global bindings, with contextual bindings taking precedence, when that context is active. Bindings are be configured using a generic pattern of 'view:context=regexp'. E.g.: # Globally Applicable Archiving [messages] A = :read<Enter>:archive<Enter> # Monthly Archiving for 'Mailbox' Account [messages:account=Mailbox$] A = :read<Enter>:archive month<Enter> In the above example all accounts matching the regular expression will archive in the monthly format - all others will use the global binding. Signed-off-by: Jonathan Bartlett <jonathan@jonnobrow.co.uk>
* bindings: support more modified keysRobin Jarry2021-10-281-4/+11
| | | | | | | | | | | | | | Add new supported keys: Ctrl+Enter Ctrl+Up Ctrl+Down Ctrl+Left Ctrl+Right Ctrl+PageUp Ctrl+PageDown Signed-off-by: Robin Jarry <robin@jarry.cc>
* bindings: prepare for more modifersRobin Jarry2021-10-281-155/+160
| | | | | | | | | | | | | | | | Prepare to support more modifiers in key bindings. tcell has some premade ctrl-modified keys but not all keys are supported. Other keys must be explicitly checked with a modifier mask. Update the KeyStroke type to carry a modifier mask. Update code accordingly. No functional change. Link: https://github.com/gdamore/tcell/blob/master/key.go#L265-L275 Link: https://github.com/gdamore/tcell/blob/master/key.go#L384-L419 Signed-off-by: Robin Jarry <robin@jarry.cc>
* update tcell to v2 and enable TrueColor supporty0ast2020-12-181-1/+1
| | | | | | | | | Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
* all: use fmt.Errorf for fomartting errorsWagner Riffel2019-09-041-1/+1
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
* lowercase all key bindingsReto Brunner2019-07-171-32/+32
|
* Change ex command to C-x when using terminalDrew DeVault2019-05-241-2/+2
|
* Add distinct keybindings for each compose viewDrew DeVault2019-05-141-1/+1
|
* Rig up terminal keybinding groupDrew DeVault2019-03-211-0/+1
|
* Add context-specific keybindingsDrew DeVault2019-03-211-0/+10
|
* Add additional context to key binding setDrew DeVault2019-03-211-4/+14
|
* Fix special key bindings (e.g. <C-d>)Drew DeVault2019-03-151-1/+6
|
* Rig up key bindingsDrew DeVault2019-03-151-156/+156
|
* Implement key bindings subsystemDrew DeVault2019-03-151-0/+284
Which is not yet rigged up