urxvt-selection-autotransform(1)
π urxvt-selection-autotransform(1) β the RXVT-UNICODE glow-up π¦
okay bestie, so this is one of those urxvt helper pages and honestly? it's a little cutie. it's part of the RXVT-UNICODE family, and it's here to make your selections do tricks β¨
π NAME π
selection-autotransform β it automatically transforms the text you select, no cap π«
πΈ DESCRIPTION πΈ
So here's the vibe: this selection lets you do automatic transforms on a selection every single time a selection is made. Like, the moment you highlight something, it gets rewrote. main character behaviour honestly π
The way it works is you specify perl snippets (and lowkey the most useful one is a single s/// operator, periodt) that modify $_, and you give them to urxvt as resources:
URxvt.selection-autotransform.0: transform
URxvt.selection-autotransform.1: transform
...
Yup, that's it β numbered resources, .0, .1, and so on forever if you want π
π§ example time, bestie π§
Say you've got selections of the form filename:number β you know, the classic thing that shows up in compiler messages all the time π well, this lil number right here will transform them into vi +$filename $word:
URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/
And this next example matches the same,but replaces it with vi-commands you can paste directly into your (vi :) editor β yes, that's the whole point, chef's kiss π€:
URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/:e \\Q$1\\E\\x0d:$2\\x0d/
Of course, this can be modified to suit your needs and your editor :) β go off, customize it, make it yours π
π¦ levelling up to perl error messages π¦
To expand the example above to typical perl error messages (the "XXX at FILENAME line YYY." kind, you've definitely seen them and you've definitely cried a little π), you need a slightly more elaborate solution:
URxvt.selection.pattern-0: ( at .*? line \\d+[,.])
URxvt.selection-autotransform.0: s/^ at (.*?) line (\\d+)[,.]$/:e \\Q$1\\E\\x0d:$2\\x0d/
Let me break it down because it's giving two-step slay π₯:
- The first line tells the selection code to treat the unchanging part of every error message as a selection pattern π
- The second line transforms that message into vi commands to load the file π―
fr fr, that's the whole trick. pattern first, transform second, and your compiler errors become clickable-ish little portals into your editor. iconic.
π«Ά and that's the page! cute lil sign-off for you: this was version 9.31, dated 2023-12-02, and it's the urxvt-selection-autotransform(1) page from the RXVT-UNICODE crew. go transform some selections bestie, you've got this βπ
π¦ where this page comes from
- opensuse-leap 16.0: rxvt-unicode 9.31-bp160.1.13 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rxvt-unicode 9.31-bp160.1.13 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rxvt-unicode 9.31-bp160.1.13 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rxvt-unicode 9.31-bp160.1.13 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms