aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/foot.ini.5.scd19
-rw-r--r--foot.ini2
2 files changed, 11 insertions, 10 deletions
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index 89984ef5..68216fcd 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -801,16 +801,17 @@ Similar to the 'url' mode, but with custom defined regular expressions
To use a custom defined regular expression, you also need to add a key
binding for it. This is done in the *key-binding* section, see below
-for details. In short, you need to:
+for details. For example, a regex to detect hash digests (e.g. git
+commit hashes) could look like:
```
-[regex:foo]
-regex=foo(bar)?
+[regex:hashes]
+regex=([a-fA-f0-9]{7,128})
launch=path-to-script-or-application ${match}
[key-bindings]
-regex-launch=[foo] Control+Shift+q
-regex-copy=[foo] Control+Mod1+Shift+q
+regex-launch=[hashes] Control+Shift+q
+regex-copy=[hashes] Control+Mod1+Shift+q
```
*launch*
@@ -1278,13 +1279,13 @@ e.g. *search-start=none*.
binding:
```
- [regex:foo]
- regex=foo(bar)?
+ [regex:hashes]
+ regex=([a-fA-f0-9]{7,128})
launch=path-to-script-or-application ${match}
[key-bindings]
- regex-launch=[foo] Control+Shift+q
- regex-copy=[foo] Control+Mod1+Shift+q
+ regex-launch=[hashes] Control+Shift+q
+ regex-copy=[hashes] Control+Mod1+Shift+q
```
Default: _none_.
diff --git a/foot.ini b/foot.ini
index 2489887f..a1aa118c 100644
--- a/foot.ini
+++ b/foot.ini
@@ -73,7 +73,7 @@
# You can define your own regex's, by adding a section called
# 'regex:<ID>' with a 'regex' and 'launch' key. These can then be tied
-# to a key-binding:
+# to a key-binding. See foot.ini(5) for details
# [regex:your-fancy-name]
# regex=<a POSIX-Extended Regular Expression>