3
#:META:X_RESOURCE:%.pattern-0:string:first selection pattern
7
selection - more intelligent selection (enabled by default)
11
This extension tries to be more intelligent when the user extends
12
selections (double-click and further clicks). Right now, it tries to
13
select words, urls and complete shell-quoted arguments, which is very
14
convenient, too, if your F<ls> supports C<--quoting-style=shell>.
16
A double-click usually selects the word under the cursor, further clicks
17
will enlarge the selection.
19
The selection works by trying to match a number of regexes and displaying
20
them in increasing order of length. You can add your own regexes by
21
specifying resources of the form:
23
URxvt.selection.pattern-0: perl-regex
24
URxvt.selection.pattern-1: perl-regex
27
The index number (0, 1...) must not have any holes, and each regex must
28
contain at least one pair of capturing parentheses, which will be used for
29
the match. For example, the following adds a regex that matches everything
30
between two vertical bars:
32
URxvt.selection.pattern-0: \\|([^|]+)\\|
34
Another example: Programs I use often output "absolute path: " at the
35
beginning of a line when they process multiple files. The following
36
pattern matches the filename (note, there is a single space at the very
39
URxvt.selection.pattern-0: ^(/[^:]+):\
41
You can look at the source of the selection extension to see more
42
interesting uses, such as parsing a line from beginning to end.
44
This extension also offers following bindable keyboard commands:
50
Rot-13 the selection when activated. Used via keyboard trigger:
52
URxvt.keysym.C-M-r: perl:selection:rot13
3
58
sub on_user_command {
4
59
my ($self, $cmd) = @_;