warpdrive-go
warpdrive-go copied to clipboard
Warp across your filesystem in ~5 ms
WarpDrive: the Go version.

What does this do?
Instead of having a huge cd routine to get where you want, with WarpDrive you use short keywords to warp to the directory in ~5 ms.
Help
WarpDrive - Warp across the filesystem instantly
Usage: wd [<pattern> ...]
wd --list/-l | --help/-h | --version/-v
wd {--add/-a | --remove/-r} <path>
Options:
--list/-l List currently tracked paths along with their frecency scores
--add/-a Add a path to the data file (paths will be added automatically)
--remove/-r Remove a path from the data file
--help/-h Print this help message
--version/-v Print the version of WarpDrive installed
Examples:
wd -l # list all tracked paths and scores
wd # cd to home directory
wd s # tries to match 's'
wd someDir # tries to match 'someDir'
wd some subDir # ensures matched path also contains 'some'
wd /absolute/path/to/someDir # absolute paths work too
Note:
When specifying multiple patterns, order does not matter, except for the last pattern.
WarpDrive will always cd to a directory that matches the last pattern.
Related: https://github.com/quackduck/WarpDrive. That repo has the earlier, slower, Java version of this.
Install directions
If you're a bash or zsh user:
- Put
bash-zsh-support/wd.shsomewhere you want. - Put
. /path/to/wd.shin your relevant rc/profile file (you know what I mean) - Run
go installin this directory - Profit!
If you're a fish user:
- Put
fish-support/wd-go_on_prompt.fishin~/.config/fish/conf.d/ - Put
fish-support/wd.fishin~/.config/fish/functions/ - Run
go installin this directory - Profit!
If you're a windows command prompt user:
- Put
windows-support\wd-go_on_prompt.batandwindows-support\wd.batin a directory of your choice. - Compile the go module into a .exe file and put that in the same directory.
- Add the directory to the
PATHenvironment variable - Make a script that runs when command prompt is opened: https://superuser.com/a/916478.
- In the script add the line
doskey cd=wd-go_on_prompt $* - Profit!
If you use some other shell:
Make a PR to add support for your shell. Adding support for other shells is easier than for similar programs. All you need is:
-
A way for
wdto add a new directory when you usecdYou can do this with a prompt hook that detects a change in the pwd.
-
A way for your shell to
cdtowd's result, or show its output as needed.The
wd-gobinary returns an exit code of3if it wants you tocdto its output. Else, please show the user the output.
See the bash-zsh-support/ and fish-support/ directories for examples of how to do this.