Home

Awesome

wdx: like wd but different.

Summary

wdx is a Zsh plugin which allows you to designate directories with abbreviations, and later use those abbreviations to jump to the directories.

Installing

The easiest way to install wdx is using zinit:

$ zplugin light radian-software/wdx

Otherwise, you can install wdx manually:

Basic usage

Here is the command syntax:

usage: wdx [-s | --shell] <subcommand>

subcommands:
  wdx [go] <point>
  wdx show <point>
  wdx set [<point> [<target>]] [-f | --force]
  wdx rm [<point>]
  wdx ls
  wdx help [<subcommand>]
  wdx version

The subcommands are as follows:

Ambiguities are resolved like so:

The -s, --shell option causes wdx to print shell code to stdout instead of performing the action directly. This feature is used implicitly by the shell wrapper defined in wdx.zsh, so that the go subcommand can actually change the working directory of your shell. It is probably not much use to the end user, unless you are bypassing the shell wrapper and working directly with the wdx script in the bin subdirectory.

Save file format

Your warp points are put in $XDG_CONFIG_HOME/wdx/points, or by default ~/.config/wdx/points.

The file format is plain-text. Lines alternate between warp point names and target directories. Any characters except newlines are allowed in point names and target paths. In particular, empty strings are allowed. Points are sorted first by target path, and then by point name.

Editing the save file by hand is encouraged if you rename a parent directory, which will otherwise break your warp points.

Note that warp point targets need not be absolute paths. They are not resolved at any time, but are saved and passed to cd unmodified.

Tips

You can use wdx with the name wd instead, simply by defining

alias wd=wdx

in your .zshrc.

Why?

Because I thought the command-line interface of wd was a bit messy, and it didn't allow for arbitrary warp point names.