X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=bin%2Ffcscs;h=9f58c36d8e40f4bd5fe4f26f92684e7385d632bb;hb=1a5fd0bef334ba6ccacebdb206a8e060b3666a26;hp=d6a5878a6dcf51e3e911bde3748bcd64a1fdcb52;hpb=f184689fefd13bc5d5837d35ad36d454228277fb;p=fcscs%2Ffcscs.git diff --git a/bin/fcscs b/bin/fcscs index d6a5878..9f58c36 100755 --- a/bin/fcscs +++ b/bin/fcscs @@ -553,7 +553,8 @@ sub select_match { $number = $number * 10 + $char; } elsif ($char eq "\b" or $char eq "\x7f") { # backspace $number = int($number / 10); - } elsif ($char eq "\n") { + } elsif ($char eq "\n" + or $char eq $config->{setting}{alternative_return}) { if ($number == 0) { # number without selection matches last entry $number = 1; } @@ -631,8 +632,9 @@ sub extend_match { my $match_old = \%{$match}; my $char = $screen->getch; - if ($char eq "\n") { # accept match - last; + if ($char eq "\n" + or $char eq $config->{setting}{alternative_return}) { + last; # accept match } elsif ($char eq 'w') { # select current word (both directions) extend_match_regex_left($line, $match, qr/\w+/); @@ -650,7 +652,7 @@ sub extend_match { } elsif ($char eq 'E') { # select current WORD (only right) extend_match_regex_right($line, $match, qr/\S+/); - } elsif ($char eq '^') { # select to beginning of line + } elsif ($char eq '0') { # select to beginning of line extend_match_regex_left($line, $match, qr/.+/); } elsif ($char eq '$') { # select to end of line extend_match_regex_right($line, $match, qr/.+/); @@ -767,7 +769,7 @@ configurable at the moment): =item B extend WORD to the right -=item B<^> extend to beginning of line +=item B<0> extend to beginning of line =item B<$> extend to end of line @@ -1017,6 +1019,16 @@ The following simple mappings are available by default: =back +The following additional mappings are available by default: + +=over + +=item B<\n> accept current selection (not customizable) + +=item B additional key to accept selection (B option) + +=back + All (single-byte) keys except numbers, backspace and return can be mapped. Unknown mappings are ignored when pressing keys. @@ -1101,6 +1113,8 @@ Defaults in parentheses. =item B GNU Screen's msgwait variable, used when yanking (C<5>) +=item B additional accept key like return, set to C<\n> to disable (C) + =item B browser command as array reference (C<['x-www-browser']>) =back @@ -1120,6 +1134,8 @@ my %setting = ( smartcase => 1, paste_sleep => 100_000, screen_msgwait => 5, + # global mappings + alternative_return => 's', # commands browser => ['x-www-browser'], );