aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2022-06-14 21:10:48 +0200
committerRobin Jarry <robin@jarry.cc>2022-06-14 22:12:48 +0200
commite1d8bc4d17cb7bd79e19fdf866d1da2fedda4de5 (patch)
treeececff85e82e42a2b95b27b03e53c79768ad0709 /config
parent4753cfd3e33f985ec22c5600a8d7e68b72175607 (diff)
downloadaerc-e1d8bc4d17cb7bd79e19fdf866d1da2fedda4de5.tar.gz
msgviewer: open http links from messages
Parse http links from a message and display them as completions in the :open-link command. Add the following binds to the [view] section in your binds.conf: <C-l> = :open-link <space> Parsing can be disabled in aerc.conf by setting parse-http-links to false in the viewer section. Thanks to Moritz for the help with the regular expression. Signed-off-by: Koni Marti <koni.marti@gmail.com> Reviewed-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf6
-rw-r--r--config/binds.conf2
-rw-r--r--config/config.go2
3 files changed, 10 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf
index 1a3c1f42..80434127 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -209,6 +209,12 @@ header-layout=From|To,Cc|Bcc,Date,Subject
# Default: false
always-show-mime=false
+# Parses and extracts http links when viewing a message. Links can then be
+# accessed with the open-link command.
+#
+# Default: true
+parse-http-links=true
+
# How long to wait after the last input before auto-completion is triggered.
#
# Default: 250ms
diff --git a/config/binds.conf b/config/binds.conf
index 4f67bbe4..589dc55a 100644
--- a/config/binds.conf
+++ b/config/binds.conf
@@ -64,6 +64,8 @@ S = :save<space>
D = :delete<Enter>
A = :archive flat<Enter>
+<C-l> = :open-link <space>
+
f = :forward<Enter>
rr = :reply -a<Enter>
rq = :reply -aq<Enter>
diff --git a/config/config.go b/config/config.go
index 923a1a02..dae32b7c 100644
--- a/config/config.go
+++ b/config/config.go
@@ -160,6 +160,7 @@ type ViewerConfig struct {
Alternatives []string
ShowHeaders bool `ini:"show-headers"`
AlwaysShowMime bool `ini:"always-show-mime"`
+ ParseHttpLinks bool `ini:"parse-http-links"`
HeaderLayout [][]string `ini:"-"`
KeyPassthrough bool `ini:"-"`
}
@@ -705,6 +706,7 @@ func LoadConfigFromFile(root *string, logger *log.Logger) (*AercConfig, error) {
{"Date"},
{"Subject"},
},
+ ParseHttpLinks: true,
},
Statusline: StatuslineConfig{