Getting Started
Installation
Build from Source
Install the following tools:
Install the following dependencies:
This will clone the repository, build the project, and create an executable in the target/release directory.
git clone https://github.com/deorbil/zd.git
cd zd
cargo build --release --lockedTIP
Move the executable to a directory in your PATH (such as /usr/local/bin or ~/.local/bin):
sudo cp target/release/zd /usr/local/bin/
# or
cp target/release/zd ~/.local/bin/Download Prebuilt Binary
Install the following dependencies:
Download the binary from the latest GitHub release and then extract the archive.
TIP
Move the executable to a directory in your PATH (such as /usr/local/bin or ~/.local/bin).
Setup
Bash
Add the following to your ~/.bashrc:
eval "$(zd init bash)"Zsh
Add the following to your ~/.zshrc:
eval "$(zd init zsh)"Adding Directories
By default, zd will use your default shell as the script interpreter.
Bash
Create a new file ~/.zdrc with the following content to add your first directory:
#!/usr/bin/env bash
echo "$HOME"TIP
You can add more directories using echo or any other command that outputs directory paths. For example, use find to add multiple directories:
#!/usr/bin/env bash
echo "$HOME"
find "$HOME/source" -maxdepth 1 -type dZsh
Create a new file ~/.zdrc with the following content to add your first directory:
#!/usr/bin/env zsh
echo "$HOME"TIP
You can add more directories using echo or any other command that outputs directory paths. For example, use find to add multiple directories:
#!/usr/bin/env zsh
echo "$HOME"
find "$HOME/source" -maxdepth 1 -type dAlternatively, replace ~/.zdrc with an executable. This can be either a binary or a shebang script.
Binary
Move the binary to ~/.zdrc, then make it executable:
chmod +x ~/.zdrcLua
Add the following to your ~/.zdrc:
#!/usr/bin/env lua
print(os.getenv("HOME"))Make ~/.zdrc executable:
chmod +x ~/.zdrcNode.js
Add the following to your ~/.zdrc:
#!/usr/bin/env node
const os = require("os");
console.log(os.homedir());Make ~/.zdrc executable:
chmod +x ~/.zdrcPython
Add the following to your ~/.zdrc:
#!/usr/bin/env python3
import os
print(os.path.expanduser("~"))Make ~/.zdrc executable:
chmod +x ~/.zdrcInstalling a Plugin
Install the zd-cd plugin:
zd plugin install deorbil/zd-cdThen reload your shell and run the following command:
z