X-Git-Url: https://ruderich.org/simon/gitweb/?p=fcscs%2Ffcscs.git;a=blobdiff_plain;f=bin%2Ffcscs;h=b2bef5d38dc0ae6d372fdc28bbabdd4c14b6d7d1;hp=95a769a40d0225ade2fd7b0a2c205500e80ff60e;hb=210f7c020e1cf68842eeefb6daecd01b1b38780b;hpb=37ec012bdcb1ac20deea423cb9b4ff4d8c13cade diff --git a/bin/fcscs b/bin/fcscs index 95a769a..b2bef5d 100755 --- a/bin/fcscs +++ b/bin/fcscs @@ -54,6 +54,28 @@ None so far. =head1 USAGE +Short overview of the general usage, details below: + + - start fcscs + - configure actions (optional) + - enable pasting + - ... + - select mode (optional, URL mode is used on startup): + - f: file paths + - u: URLs + - ... + - /: search mode + - for `normal' modes: + - select match by displayed number or for lowest numbered + match + - configured action is run, e.g. URL is opened with browser + - for `search' mode: + - perform incremental search + - on go to `normal' mode to select a match + - after the match is selected wait for confirmation or extension + - confirmation: run previously selected action + - extension: change match, e.g. select complete word or line + GNU Screen setup (add to F<~/.screenrc>): bind ^B eval "hardcopy $HOME/.tmp/screen-fcscs" "screen fcscs $HOME/.tmp/screen-fcscs" @@ -87,16 +109,18 @@ explained below. Per default URLs are selected, see options for a way to change this. I: When yanking (copying) a temporary file is used to pass the data to -GNU screen/Tmux without exposing it to C or C. However this may +GNU screen/Tmux without exposing it to C or C. However this may leak data if those temporary files are written to disk. To prevent this change -your C<$TMP> accordingly to point to a memory-only location or encrypted -storage. +your C<$TMP> to point to a memory-only location or encrypted storage. If no window appears, try running B manually to catch the error message and please report the bug: fcscs /path/to/screen-or-tmux-fcscs-file + +=head1 MODES + =cut @@ -661,6 +685,22 @@ sub mapping_yank { } +=head2 NORMAL MODES + +Normal modes select matches by calling a function which returns them, e.g. by +using a regex. + +The following normal modes are available: + +=over 4 + +=item B select relative/absolute paths + +=item B select URLs + +=back + +=cut sub mapping_mode_path { my ($key, $screen, $config, $input) = @_; @@ -686,6 +726,40 @@ sub mapping_mode_url { }; } +=head2 SEARCH MODE (AND EXTEND MODE) + +Search mode is a special mode which lets you type a search string (a Perl +regex) and then select one of the matches. Afterwards you can extend the +match. For example select the complete word or to the end of the line. This +allows quick selection of arbitrary text. + +The following mappings are available during the extension mode (not +configurable at the moment): + +=over 4 + +=item B select current word + +=item B extend word to the left + +=item B extend word to the right + +=item B select current WORD + +=item B extend WORD to the left + +=item B extend WORD to the right + +=item B<^> extend to beginning of line + +=item B<$> extend to end of line + +=back + +C includes any characters matching C<\w+>, C any non-whitespace +characters (C<\S+>), just like in Vim. + +=cut sub mapping_mode_search { my ($key, $screen, $config, $input) = @_; @@ -1036,7 +1110,7 @@ my %setting = ( =over -=item B used by C<\&mapping_mode_url()> +=item B used by C<\&mapping_mode_url()> =item B used by C<\&mapping_mode_path()>