… | |
… | |
48 | C<--quoting-style=shell>. |
48 | C<--quoting-style=shell>. |
49 | |
49 | |
50 | A double-click usually selects the word under the cursor, further clicks |
50 | A double-click usually selects the word under the cursor, further clicks |
51 | will enlarge the selection. |
51 | will enlarge the selection. |
52 | |
52 | |
|
|
53 | The selection works by trying to match a number of regexes and displaying |
|
|
54 | them in increasing order of length. You can add your own regexes by |
|
|
55 | specifying resources of the form: |
|
|
56 | |
|
|
57 | URxvt.selection.pattern-0: perl-regex |
|
|
58 | URxvt.selection.pattern-1: perl-regex |
|
|
59 | ... |
|
|
60 | |
|
|
61 | The index number (0, 1...) must not have any holes, and each regex must |
|
|
62 | contain at least one pair of capturing parentheses, which will be used for |
|
|
63 | the match. For example, the followign adds a regex that matches everything |
|
|
64 | between two vertical bars: |
|
|
65 | |
|
|
66 | URxvt.selection.pattern-0: \\|([^|]+)\\| |
|
|
67 | |
|
|
68 | You can look at the source of the selection extension to see more |
|
|
69 | interesting uses, such as parsing a line from beginning to end. |
|
|
70 | |
53 | It also offers the following bindable keyboard command: |
71 | This extension also offers the following bindable keyboard command: |
54 | |
72 | |
55 | =over 4 |
73 | =over 4 |
56 | |
74 | |
57 | =item rot13 |
75 | =item rot13 |
58 | |
76 | |
… | |
… | |
86 | bottom. C<Escape> leaves search mode and returns to the point where search |
104 | bottom. C<Escape> leaves search mode and returns to the point where search |
87 | was started, while C<Enter> or C<Return> stay at the current position and |
105 | was started, while C<Enter> or C<Return> stay at the current position and |
88 | additionally stores the first match in the current line into the primary |
106 | additionally stores the first match in the current line into the primary |
89 | selection. |
107 | selection. |
90 | |
108 | |
91 | =item digital-clock |
109 | =item selection-autotransform |
92 | |
110 | |
93 | Displays a digital clock using the built-in overlay. |
111 | This selection allows you to do automatic transforms on a selection |
|
|
112 | whenever a selection is made. |
|
|
113 | |
|
|
114 | It works by specifying perl snippets (most useful is a single C<s///> |
|
|
115 | operator) that modify C<$_> as resources: |
|
|
116 | |
|
|
117 | URxvt.selection-autotransform.0: transform |
|
|
118 | URxvt.selection-autotransform.1: transform |
|
|
119 | ... |
|
|
120 | |
|
|
121 | For example, the following will transform selections of the form |
|
|
122 | C<filename:number>, often seen in compiler messages, into C<vi +$filename |
|
|
123 | $word>: |
|
|
124 | |
|
|
125 | URxvt.selection-autotransform.0: s/^(\\S+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/ |
|
|
126 | |
|
|
127 | And this example matches the same,but replaces it with vi-commands you can |
|
|
128 | paste directly into your (vi :) editor: |
|
|
129 | |
|
|
130 | URxvt.selection-autotransform.0: s/^(S+):(d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/ |
94 | |
131 | |
95 | =item mark-urls |
132 | =item mark-urls |
96 | |
133 | |
97 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
134 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
98 | make them clickable. When middle-clicked, the program specified in the |
135 | make them clickable. When middle-clicked, the program specified in the |
… | |
… | |
102 | =item block-graphics-to-ascii |
139 | =item block-graphics-to-ascii |
103 | |
140 | |
104 | A not very useful example of filtering all text output to the terminal, |
141 | A not very useful example of filtering all text output to the terminal, |
105 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
142 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
106 | similar-looking ascii character. |
143 | similar-looking ascii character. |
|
|
144 | |
|
|
145 | =item digital-clock |
|
|
146 | |
|
|
147 | Displays a digital clock using the built-in overlay. |
107 | |
148 | |
108 | =item example-refresh-hooks |
149 | =item example-refresh-hooks |
109 | |
150 | |
110 | Displays a very simple digital clock in the upper right corner of the |
151 | Displays a very simple digital clock in the upper right corner of the |
111 | window. Illustrates overwriting the refresh callbacks to create your own |
152 | window. Illustrates overwriting the refresh callbacks to create your own |