Page 1 of 1

zump.xys - z-like recent locations jumping

Posted: 18 Jun 2019 13:10
by bdeshi
a simple approximation of github:rupa/z for XYplorer. Navigates to most recent location matching given patterns.
in short, type @z foo bar and jump to most-recent location with "foo" and "bar" in path.

Installation
zump runs as an alias. Enter this in the addressbar to define the alias:

Code: Select all

@z=::global $G_zump_pattern='<@0>'; load "<xyscripts>/_alias/zump.xys";
Don't forget to adjust the path to zump.xys as necessary.
The "z" in @z is the alias name. It may contain any character apart from "=", "/", and space. It may even be empty, in which case "@" alone calls zump.

Usage
Run from the address bar: @z [/options] pattern [pattern ...]
Run from within xyscripts: goto "@z [/options] pattern [pattern ...]";

Recognized options:
        /l: list matching dirs
        /h: include pane history in search candidates
        /r: go to last matching dir
        /n: go to nth matching dir
        /-n: go to nth-to-last matching dir


• To include pane history by default, set ::perm $P_ZUMP_APPEND_HISTORY=1;
• To search in reverse by default, set ::perm $P_ZUMP_SEARCH_REVERSE=1;

Notes:
Each single quote in pattern must be typed twice.
• Patterns are always matched from left to right.
• Nested quotes are not supported.

Examples

Code: Select all

    @z foo bar       // goto latest dir with "foo" and "bar" in path
    @z "foo bar"     // goto latest dir with exactly "foo bar" in path
    @z foo\bar       // match foo and bar at different path levels

    @z /l foo bar    // list dirs that match given pattern
    @z /r foo bar    // goto last matching dir (reverse order)
    @z /2 foo bar    // goto 2nd matching dir
    @z /-1 foo bar   // goto last matching dir
    @z /lr foo bar   // list matching dirs in reversed order
    @z /lh foo bar   // list matching dirs, history inclusive
-------------------------------------------------------------------------
Downloads
Latest release:
zump.xys
v1.3.0
(6.18 KiB) Downloaded 162 times
-------------------------------------------------------------------------
older releases:
zump.xys
v1.2.0
(5.82 KiB) Downloaded 165 times
zump.xys
v1.0.1
(5.27 KiB) Downloaded 135 times
zump.xys
v1.0.0
(5.15 KiB) Downloaded 147 times

Re: zump.xys - z-like recent locations jumping

Posted: 18 Jun 2019 16:24
by bdeshi
v1.0.1
  • fixed erratic detection of /n & /-n , ie, index options.
  • fixed off-target index selection in matches.

Re: zump.xys - z-like recent locations jumping

Posted: 20 Jun 2019 09:57
by bdeshi
v1.2.0
  • can search history in addition to recent locations. This is disabled by default. History items always come after recents.
    History means current pane's global history only.
  • fixed parsing of "\"-format patterns.
  • Removed a stray step; statement
Oh and this requires at least XYplorer v20.20.0001.

Re: zump.xys - z-like recent locations jumping

Posted: 12 Jan 2020 07:32
by bdeshi
v1.3.0
  • fixed buggy application of permanent variables and inline options in tandem.
  • added a permavar for the /r flag.
  • slightly more helpful status messages.