mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
doc: improve regex example
This commit is contained in:
parent
0a32dc3820
commit
b1f16c84e0
2 changed files with 11 additions and 10 deletions
|
|
@ -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
|
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
|
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:hashes]
|
||||||
regex=foo(bar)?
|
regex=([a-fA-f0-9]{7,128})
|
||||||
launch=path-to-script-or-application ${match}
|
launch=path-to-script-or-application ${match}
|
||||||
|
|
||||||
[key-bindings]
|
[key-bindings]
|
||||||
regex-launch=[foo] Control+Shift+q
|
regex-launch=[hashes] Control+Shift+q
|
||||||
regex-copy=[foo] Control+Mod1+Shift+q
|
regex-copy=[hashes] Control+Mod1+Shift+q
|
||||||
```
|
```
|
||||||
|
|
||||||
*launch*
|
*launch*
|
||||||
|
|
@ -1278,13 +1279,13 @@ e.g. *search-start=none*.
|
||||||
binding:
|
binding:
|
||||||
|
|
||||||
```
|
```
|
||||||
[regex:foo]
|
[regex:hashes]
|
||||||
regex=foo(bar)?
|
regex=([a-fA-f0-9]{7,128})
|
||||||
launch=path-to-script-or-application ${match}
|
launch=path-to-script-or-application ${match}
|
||||||
|
|
||||||
[key-bindings]
|
[key-bindings]
|
||||||
regex-launch=[foo] Control+Shift+q
|
regex-launch=[hashes] Control+Shift+q
|
||||||
regex-copy=[foo] Control+Mod1+Shift+q
|
regex-copy=[hashes] Control+Mod1+Shift+q
|
||||||
```
|
```
|
||||||
|
|
||||||
Default: _none_.
|
Default: _none_.
|
||||||
|
|
|
||||||
2
foot.ini
2
foot.ini
|
|
@ -73,7 +73,7 @@
|
||||||
|
|
||||||
# You can define your own regex's, by adding a section called
|
# 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
|
# '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:your-fancy-name]
|
||||||
# regex=<a POSIX-Extended Regular Expression>
|
# regex=<a POSIX-Extended Regular Expression>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue