Created
June 10, 2015 20:44
-
-
Save andreasBihlmaier/8e9590b5294c29137d8f to your computer and use it in GitHub Desktop.
Cd_current completion zsh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef Cd_current | |
List_current_dirs() { | |
ps ewwo command | \ | |
fgrep -v COMMAND | \ | |
awk '{ match($0,/PWD=[^ ][^ ]*/); { print substr($0, RSTART + 4, RLENGTH - 4) } }' | \ | |
grep -v '\[^' | \ | |
grep -v $HOME\$ | \ | |
sort | \ | |
uniq | |
} | |
_arguments "1:CurrentDirectories:($(List_current_dirs))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment