… | |
… | |
260 | |
260 | |
261 | Example configuration: |
261 | Example configuration: |
262 | |
262 | |
263 | URxvt.perl-ext: default,matcher |
263 | URxvt.perl-ext: default,matcher |
264 | URxvt.urlLauncher: sensible-browser |
264 | URxvt.urlLauncher: sensible-browser |
|
|
265 | URxvt.keysym.C-Delete: perl:matcher |
265 | URxvt.matcher.button: 1 |
266 | URxvt.matcher.button: 1 |
266 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
267 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
267 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
268 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
268 | URxvt.matcher.launcher.2: gvim +$2 $1 |
269 | URxvt.matcher.launcher.2: gvim +$2 $1 |
269 | |
270 | |
… | |
… | |
988 | $retval |
989 | $retval |
989 | } |
990 | } |
990 | |
991 | |
991 | sub SET_COLOR($$$) { |
992 | sub SET_COLOR($$$) { |
992 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
993 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
|
|
994 | } |
|
|
995 | |
|
|
996 | sub rend2mask { |
|
|
997 | no strict 'refs'; |
|
|
998 | my ($str, $mask) = (@_, 0); |
|
|
999 | my %color = ( fg => undef, bg => undef ); |
|
|
1000 | my @failed; |
|
|
1001 | for my $spec ( split /\s+/, $str ) { |
|
|
1002 | if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) { |
|
|
1003 | $color{lc($1)} = $2; |
|
|
1004 | } else { |
|
|
1005 | my $neg = $spec =~ s/^[-^]//; |
|
|
1006 | unless ( exists &{"RS_$spec"} ) { |
|
|
1007 | push @failed, $spec; |
|
|
1008 | next; |
|
|
1009 | } |
|
|
1010 | my $cur = &{"RS_$spec"}; |
|
|
1011 | if ( $neg ) { |
|
|
1012 | $mask &= ~$cur; |
|
|
1013 | } else { |
|
|
1014 | $mask |= $cur; |
|
|
1015 | } |
|
|
1016 | } |
|
|
1017 | } |
|
|
1018 | ($mask, @color{qw(fg bg)}, \@failed) |
993 | } |
1019 | } |
994 | |
1020 | |
995 | # urxvt::term::extension |
1021 | # urxvt::term::extension |
996 | |
1022 | |
997 | package urxvt::term::extension; |
1023 | package urxvt::term::extension; |
… | |
… | |
2148 | http://software.schmorp.de/pkg/rxvt-unicode |
2174 | http://software.schmorp.de/pkg/rxvt-unicode |
2149 | |
2175 | |
2150 | =cut |
2176 | =cut |
2151 | |
2177 | |
2152 | 1 |
2178 | 1 |
|
|
2179 | |
|
|
2180 | # vim: sw=3: |