File system's path shortener
pathshortener
is a file system's path shortener written in portable sh
inspired by Fish's prompt_pwd
command and Starship's Directory module.
- Unix commands to process
Option 1: using curl
curl https://raw.githubusercontent.com/info-mono/pathshortener/main/bin/pathshortener > ~/.local/bin/pathshortener
chmod +x ~/.local/bin/pathshortener
Option 2: using git
git clone https://github.com/info-mono/pathshortener.git ~/.local/share/pathshortener
ln -s ~/.local/share/pathshortener/bin/pathshortener ~/.local/bin/pathshortener
For Bpkg user:
bpkg install info-mono/pathshortener
For Basher user:
basher install info-mono/pathshortener
If you can and want to port Pathshortener to other package managers, feel free to do so.
Run 'pathshortener' in the terminal:
pathshortener PATHS
Pathshortener is configured through environment variables: export PATHSHORTENER_<SETTING>="<value>"
Value | Valid | Default | Description |
---|---|---|---|
PATHSHORTENER_TRUNCATION_LENGTH |
<integer> |
3 |
The number of parent folders that the current directory should be truncated to (set to 0 to disable) |
PATHSHORTENER_SHORT_LENGTH |
<integer> |
0 |
The number of characters to display in truncated paths |
PATHSHORTENER_TRUNCATION_SYMBOL |
<string> |
…/ |
The symbol to prefix to truncated paths |
PATHSHORTENER_HOME_SYMBOL |
<string> |
~ |
The symbol indicating home directory |
Special thanks to:
Made with ❤️ by
@info-mono