summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/binds.conf6
-rw-r--r--config/config.go50
2 files changed, 33 insertions, 23 deletions
diff --git a/config/binds.conf b/config/binds.conf
index 538f9a3..d53a99f 100644
--- a/config/binds.conf
+++ b/config/binds.conf
@@ -56,6 +56,7 @@ N = :prev-result<Enter>
<Esc> = :clear<Enter>
[view]
+/ = :toggle-key-passthrough<Enter>/
q = :close<Enter>
| = :pipe<space>
D = :delete<Enter>
@@ -74,6 +75,11 @@ H = :toggle-headers<Enter>
J = :next<Enter>
K = :prev<Enter>
+[view::passthrough]
+$noinherit = true
+$ex = <C-x>
+<Esc> = :toggle-key-passthrough<Enter>
+
[compose]
# Keybindings used when the embedded terminal is not selected in the compose
# view
diff --git a/config/config.go b/config/config.go
index 8a01f50..24ec1b0 100644
--- a/config/config.go
+++ b/config/config.go
@@ -105,14 +105,15 @@ type AccountConfig struct {
}
type BindingConfig struct {
- Global *KeyBindings
- AccountWizard *KeyBindings
- Compose *KeyBindings
- ComposeEditor *KeyBindings
- ComposeReview *KeyBindings
- MessageList *KeyBindings
- MessageView *KeyBindings
- Terminal *KeyBindings
+ Global *KeyBindings
+ AccountWizard *KeyBindings
+ Compose *KeyBindings
+ ComposeEditor *KeyBindings
+ ComposeReview *KeyBindings
+ MessageList *KeyBindings
+ MessageView *KeyBindings
+ MessageViewPassthrough *KeyBindings
+ Terminal *KeyBindings
}
type BindingConfigContext struct {
@@ -143,6 +144,7 @@ type ViewerConfig struct {
ShowHeaders bool `ini:"show-headers"`
AlwaysShowMime bool `ini:"always-show-mime"`
HeaderLayout [][]string `ini:"-"`
+ KeyPassthrough bool `ini:"-"`
}
type TriggersConfig struct {
@@ -591,14 +593,15 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
file.NameMapper = mapName
config := &AercConfig{
Bindings: BindingConfig{
- Global: NewKeyBindings(),
- AccountWizard: NewKeyBindings(),
- Compose: NewKeyBindings(),
- ComposeEditor: NewKeyBindings(),
- ComposeReview: NewKeyBindings(),
- MessageList: NewKeyBindings(),
- MessageView: NewKeyBindings(),
- Terminal: NewKeyBindings(),
+ Global: NewKeyBindings(),
+ AccountWizard: NewKeyBindings(),
+ Compose: NewKeyBindings(),
+ ComposeEditor: NewKeyBindings(),
+ ComposeReview: NewKeyBindings(),
+ MessageList: NewKeyBindings(),
+ MessageView: NewKeyBindings(),
+ MessageViewPassthrough: NewKeyBindings(),
+ Terminal: NewKeyBindings(),
},
ContextualBinds: []BindingConfigContext{},
@@ -703,13 +706,14 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
}
baseGroups := map[string]**KeyBindings{
- "default": &config.Bindings.Global,
- "compose": &config.Bindings.Compose,
- "messages": &config.Bindings.MessageList,
- "terminal": &config.Bindings.Terminal,
- "view": &config.Bindings.MessageView,
- "compose::editor": &config.Bindings.ComposeEditor,
- "compose::review": &config.Bindings.ComposeReview,
+ "default": &config.Bindings.Global,
+ "compose": &config.Bindings.Compose,
+ "messages": &config.Bindings.MessageList,
+ "terminal": &config.Bindings.Terminal,
+ "view": &config.Bindings.MessageView,
+ "view::passthrough": &config.Bindings.MessageViewPassthrough,
+ "compose::editor": &config.Bindings.ComposeEditor,
+ "compose::review": &config.Bindings.ComposeReview,
}
// Base Bindings