… | |
… | |
28 | C<matcher.pattern.0> resource, and additional patterns can be specified |
28 | C<matcher.pattern.0> resource, and additional patterns can be specified |
29 | with numbered patterns, in a manner similar to the "selection" extension. |
29 | with numbered patterns, in a manner similar to the "selection" extension. |
30 | The launcher can also be overridden on a per-pattern basis. |
30 | The launcher can also be overridden on a per-pattern basis. |
31 | |
31 | |
32 | It is possible to activate the most recently seen match or a list of matches |
32 | It is possible to activate the most recently seen match or a list of matches |
33 | from the keyboard. Simply bind a keysym to "perl:matcher:last" or |
33 | from the keyboard. Simply bind a keysym to "matcher:last" or |
34 | "perl:matcher:list" as seen in the example below. |
34 | "matcher:list" as seen in the example below. |
35 | |
35 | |
36 | Example: load and use the matcher extension with defaults. |
36 | Example: load and use the matcher extension with defaults. |
37 | |
37 | |
38 | URxvt.perl-ext: default,matcher |
38 | URxvt.perl-ext: default,matcher |
39 | |
39 | |
40 | Example: use a custom configuration. |
40 | Example: use a custom configuration. |
41 | |
41 | |
42 | URxvt.url-launcher: sensible-browser |
42 | URxvt.url-launcher: sensible-browser |
43 | URxvt.keysym.C-Delete: perl:matcher:last |
43 | URxvt.keysym.C-Delete: matcher:last |
44 | URxvt.keysym.M-Delete: perl:matcher:list |
44 | URxvt.keysym.M-Delete: matcher:list |
45 | URxvt.matcher.button: 1 |
45 | URxvt.matcher.button: 1 |
46 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
46 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
47 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
47 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
48 | URxvt.matcher.launcher.2: gvim +$2 $1 |
48 | URxvt.matcher.launcher.2: gvim +$2 $1 |
49 | |
49 | |
… | |
… | |
87 | $self->most_recent; |
87 | $self->most_recent; |
88 | } elsif ($cmd =~ s/^matcher\b//) { |
88 | } elsif ($cmd =~ s/^matcher\b//) { |
89 | # for backward compatibility |
89 | # for backward compatibility |
90 | $self->most_recent; |
90 | $self->most_recent; |
91 | } |
91 | } |
|
|
92 | } |
|
|
93 | |
|
|
94 | () |
|
|
95 | } |
|
|
96 | |
|
|
97 | sub on_action { |
|
|
98 | my ($self, $action) = @_; |
|
|
99 | |
|
|
100 | if ($action eq "list") { |
|
|
101 | $self->matchlist; |
|
|
102 | } elsif ($action eq "last") { |
|
|
103 | $self->most_recent; |
92 | } |
104 | } |
93 | |
105 | |
94 | () |
106 | () |
95 | } |
107 | } |
96 | |
108 | |