.bin
.config
.local
.ncmpcpp
.oh-my-zsh
lib
plugins
adb
ant
apache2-macports
arcanist
archlinux
asdf
autoenv
autojump
autopep8
aws
battery
bbedit
bgnotify
boot2docker
bower
branch
brew
bundler
bwana
cabal
cake
cakephp3
capistrano
cargo
cask
catimg
celery
chruby
chucknorris
cloudapp
codeclimate
coffee
colemak
colored-man-pages
colorize
command-not-found
common-aliases
compleat
composer
copybuffer
copydir
copyfile
cp
cpanm
debian
dircycle
dirhistory
dirpersist
django
dnf
docker
docker-compose
dotenv
droplr
emacs
ember-cli
emoji
emoji-clock
emotty
encode64
extract
fabric
fancy-ctrl-z
fasd
fastfile
fbterm
fedora
firewalld
forklift
fossil
frontend-search
gas
gb
geeknote
gem
git
git-extras
git-flow
git-flow-avh
git-hubflow
git-prompt
git-remote-branch
gitfast
github
gitignore
glassfish
globalias
gnu-utils
go
golang
gpg-agent
gradle
grails
grunt
gulp
heroku
history
history-substring-search
httpie
iwhois
jake-node
jhbuild
jira
jruby
jsontools
jump
kate
kitchen
knife
knife_ssh
kubectl
laravel
laravel4
laravel5
last-working-dir
lein
lighthouse
lol
macports
man
marked2
mercurial
meteor
mix
mix-fast
mosh
mvn
mysql-macports
n98-magerun
nanoc
ng
nmap
node
nomad
npm
nvm
nyan
osx
pass
paver
pep8
per-directory-history
perl
perms
phing
pip
pj
pod
postgres
pow
powder
powify
profiles
pyenv
pylint
python
rails
rake
rake-fast
rand-quote
rbenv
rbfu
react-native
rebar
redis-cli
repo
rsync
ruby
rust
rvm
safe-paste
sbt
scala
scd
screen
scw
sfffe
shrink-path
README.md
shrink-path.plugin.zsh
singlechar
spring
sprunge
ssh-agent
stack
sublime
sudo
supervisor
suse
svn
svn-fast-info
swiftpm
symfony
symfony2
systemadmin
systemd
taskwarrior
terminalapp
terminitor
terraform
textastic
textmate
thefuck
themes
thor
tig
tmux
tmux-cssh
tmuxinator
torrent
tugboat
ubuntu
urltools
vagrant
vault
vi-mode
vim-interaction
virtualenv
virtualenvwrapper
vundle
wakeonlan
wd
web-search
wp-cli
xcode
yarn
yii
yii2
yum
z
zeus
zsh-navigation-tools
zsh_reload
templates
themes
tools
CONTRIBUTING.md
LICENSE.txt
README.md
oh-my-zsh.sh
.themes
.vim
.Xdefaults
.Xresources
.bash_profile
.bashrc
.profile
.vimrc
.xinitrc
.xsessionrc
.zshrc
README.md
A plugin to shrink directory paths for brevity and pretty-printing
Examples
For this directory tree:
/home/
me/
foo/
bar/
quux/
biz/ # The prefix b is ambiguous between bar and biz.
here are the results of calling shrink_path <option> /home/me/foo/bar/quux
:
Option Result
<none> /h/m/f/ba/q
-l|--last /h/m/f/ba/quux
-s|--short /h/m/f/b/q
-t|--tilde ~/f/ba/q
-f|--fish ~/f/b/quux
Usage
For a fish-style working directory in your command prompt, add the following to your theme or zshrc:
setopt prompt_subst
PS1='%n@%m $(shrink_path -f)>'
The following options are available:
-f, --fish fish simulation, equivalent to -l -s -t.
-l, --last Print the last directory's full name.
-s, --short Truncate directory names to the first character. Without
-s, names are truncated without making them ambiguous.
-t, --tilde Substitute ~ for the home directory.
-T, --nameddirs Substitute named directories as well.
The long options can also be set via zstyle, like
zstyle :prompt:shrink_path fish yes
Note: Directory names containing two or more consecutive spaces are not yet supported.
License
Copyright (C) 2008 by Daniel Friesel derf@xxxxxxxxxxxxxxxxxx
License: WTFPL http://sam.zoy.org/wtfpl
Ref: http://www.zsh.org/mla/workers/2009/msg00415.html http://www.zsh.org/mla/workers/2009/msg00419.html
Misc
Keywords: prompt directory truncate shrink collapse fish