|0.1.0||Aug 10, 2023|
#2569 in Command line utilities
A warp-dir-like tool, written in Rust.
Think of this as a folder-navigation super-charge tool that you’d use on a most frequently-used set of folders. This becomes really useful if you are often finding yourself going into a small number of deeply nested folders with a long path prefix.
/home/me/a/b/c/d/> wd add foo /home/me> cd /home/me> z foo /home/me/a/b/c/d/> # Huzzah! /home/me/a/b/c/d/> wd help Usage: wd [OPTIONS] [target] [PATH] [COMMAND] Commands: add Adds the current working directory to your warp points remove Removes the given warp point list Print all stored warp points show Show the path to given warp point (pwd) clean Remove points warping to nonexistent directories shell Subcommands for hooking into the shell help Print this message or the help of the given subcommand(s) Arguments: [target] Warps to the directory specified by the warp point Possible values: - foo: /home/me/a/b/c/d
Why rewrite it in Rust?
- for fun!
- I encountered some issues, semiregularly, where it would fail to load/execute correctly until opening a new shell (presumably due to it being written in bash).
- Additional shell support
Essentially, this tool should act like a drop-in replacement for warp-dir in most cases.
At time of writing, most commands are implemented, although the CLI options will not work identically.
Notably, the default config lookup location is different! By default it will
$XDG_DATA_HOME/wd/config. This can be configured with the
environment variable, which is also respected by the original warp-dir project.
Currently explicitly supported shells include:
scaffolding exists to support other shells, which should make supporting other
common shells that might require
"$SHELL" specific behavior.
Changing the shell's directory requires a minimal amount of shell code to be executed, so after installing the binary (suggestion below), you will need to add add a hook to your bashrc/zshrc/config.fish, etc.
eval "$(wd --shell bash shell init)"
eval "$(wd --shell zsh shell init)"
wd --shell fish shell init | source
Depending on the level of similarity to the above shells, you may be able to get
away with using one of the above
shell init hooks until explicit support is
Additionally, you can generate CLI completions with
wd shell completion, and
write them to the appropriate location for your shell.
This should enable autocompletion of the warp directory target names!
cargo install warp-dir
- Download a pre-built binary from Releases