blob: 97deaf3117f913ef0dbcf23494960f398eaa0734 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
NAME reselect
SITE https://git.khirnov.net/urxvt-ext-reselect.git/
AUTHOR Anton Khirnov,
based on url-picker by Chip Camden
DESCRIPTION
Perl extension for rxvt-unicode (aka urxvt) to enable quickly grabbing a regex match into
X11 clipboard. The design is similar to the 'follow hints' feature of Vimperator
(http://vimperator.org/vimperator).
INSTALLATION
See the man page for urxvtperl(3) for a full discussion of Perl extensions. Enable this
extension using one of the methods documented there. For instance, you could place the
script 'reselect' under ~/.urxvt/ext/, then add keybindings for it in .Xresources as
URxvt.keysym.M-u: reselect:url
This will bind the 'Meta-u' key combination to the 'url' action, which selects URLs.
OPERATION
Each action has an associated regex pattern. The extension finds all matches of that
regex in visible text and assigns a short character sequence ('hint') to each of them.
The hints are displayed as overlays over the matches.
If no matches are found, the extesnion just pops up a warning overlay. The overlay
disappears after five seconds, but the terminal is immediately operable. If the region
contains only one match, it is immediately grabbed.
Typing the characters making up a hint grabs the corresponding match into clipboard. The
backspace key erases the last character typed, if there is one. Escape exits the
selection mode and removes all overlay windows, without doing anything.
When a match is grabbed, all overlay windows are removed and the cursor position is
restored to where it was in the terminal window before url-picker was invoked. The match
that was grabbed is displayed on the bottom row of the terminal window for five seconds.
ACTIONS
The following actions are defined by this extension:
url Matches URLs.
git_hash Mathes git commit hashes.
message_id Matches angle-quote-enclosed email message IDs.
user.<n> Matches the user-defined pattern number <n>. Patterns must be
numbered consecutively.
RESOURCES
The following resources are recognized by url-picker:
URxvt.reselect.launchsingle "false" to not auto-grab a single match
URxvt.reselect.order "descending" to assign hints in reverse order
URxvt.reselect.pattern.<n> define a custom pattern, which will be available
as the 'user.<n>' action
URxvt.reselect.input.backgroundColor Bg color for numbers typed
URxvt.reselect.input.foregroundColor Fg color for numbers typed
URxvt.reselect.label.backgroundColor Bg color for numbered labels
URxvt.reselect.label.foregroundColor Fg color for numbered labels
URxvt.reselect.prompt.backgroundColor Bg color for "Follow:" prompt
URxvt.reselect.prompt.foregroundColor Fg color for "Follow:" prompt
URxvt.reselect.status.backgroundColor Bg color for status messages
URxvt.reselect.status.foregroundColor Fg color for status messages
Colors must be specified using urxvt color indices as described in
the urxvt(1) man page under COLORS AND GRAPHICS.
|