My directory shortener for bash and zsh $PS1 prompts.
- Python 3
- Make
pwd-shortenavailable in your$PATH. - Add
$(pwd-shorten)to your$PS1prompt.
- Make
pwd-shortenavailable in your$PATH. - Add
$(pwd-shorten)to your*.zsh-themefile.
The directory path in your prompt will be shortened:
/very-long-directory-name/another-long-one/tacos.txt
becomes
/ver+/ano+/tacos.txt
Home directories will be changed out as well:
/home/jonball/example/directory
becomes
~/exa+/directory
You can override these defaults by creating a config file in ~/.config/pwd-shorten called config.ini containing a top-level section titled [settings].
The following values can be set in your config
Length at which a directory name will be shortened
- default:
5
How much of the original directory name to keep
- default
3
Symbol used to indicate that a directory name has been shortened.
- default
+
[settings]
break_length = 5
keep_length = 3
replacement = +