From 9cc2d0964beb4249434e773819a9345da713573b Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Fri, 23 Apr 2010 11:20:24 -0400 Subject: [PATCH] Add the cdp function. --- lib/python.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/python.zsh b/lib/python.zsh index 1eeb65741..f1e507c48 100644 --- a/lib/python.zsh +++ b/lib/python.zsh @@ -3,3 +3,9 @@ function wo() { } alias cdv='cd $WORKON_HOME' + +function cdp () { + cd "$(python -c "import os.path as _, ${1}; \ + print _.dirname(_.realpath(${1}.__file__[:-1]))" + )" +} \ No newline at end of file