Crates.io | warp-dir |
lib.rs | warp-dir |
version | 0.1.0 |
source | src |
created_at | 2023-08-10 20:27:36.826057 |
updated_at | 2023-08-10 20:27:36.826057 |
description | A CLI tool for warping from one directory to another. |
homepage | https://github.com/DanCardin/warp-dir |
repository | https://github.com/DanCardin/warp-dir |
max_upload_size | |
id | 941329 |
size | 47,809 |
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?
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
look at $XDG_DATA_HOME/wd/config
. This can be configured with the $WD_CONFIG
environment variable, which is also respected by the original warp-dir project.
Currently explicitly supported shells include: zsh
, bash
, and fish
. The
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
added
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