diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-08-20 23:18:08 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-08-20 23:18:08 -0300 |
commit | 72f818ce986b9881edb42f5613cb602964a5e5d2 (patch) | |
tree | d56c4b9822020d693dde9d55bcf7d5c2fda10f78 /profile.dot.link | |
parent | 80145b4306fa56d21a8b1941a78954d4f543fec7 (diff) | |
download | profile-72f818ce986b9881edb42f5613cb602964a5e5d2.tar.gz profile-72f818ce986b9881edb42f5613cb602964a5e5d2.tar.bz2 |
Full zsh support
Diffstat (limited to 'profile.dot.link')
-rw-r--r-- | profile.dot.link | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/profile.dot.link b/profile.dot.link index 17312d6..957e37d 100644 --- a/profile.dot.link +++ b/profile.dot.link @@ -47,33 +47,35 @@ export CDPATH=".:~:$WORKPATH" #done # Based on http://superuser.com/questions/90535/how-do-i-turn-of-auto-echo-in-bash-when-i-cd -cd() { - if [ -z "$*" ]; then - destination=~ - else - destination=$* - fi +if [ "$0" = "bash" ]; then + cd() { + if [ -z "$*" ]; then + destination=~ + else + destination=$* + fi - # Check if its a project under CPATH - cdpath=`command cd "${destination}" 2> /dev/null` - - # Got to folder - command cd "${destination}" > /dev/null - - # Update screen title - # - # Doesn't deal about getting out of a project path - # or if going into a project subfolder - # - #if [ ! -z "$cdpath" ] && [ ! -z "$STY" ]; then - # folder="`basename $cdpath`" - # - # if echo "$PROJECTS" | grep -q "/$folder$"; then - # # Got inside a project folder - # stitle `basename $folder` - # fi - #fi -} + # Check if its a project under CPATH + cdpath=`command cd "${destination}" 2> /dev/null` + + # Got to folder + command cd "${destination}" > /dev/null + + # Update screen title + # + # Doesn't deal about getting out of a project path + # or if going into a project subfolder + # + #if [ ! -z "$cdpath" ] && [ ! -z "$STY" ]; then + # folder="`basename $cdpath`" + # + # if echo "$PROJECTS" | grep -q "/$folder$"; then + # # Got inside a project folder + # stitle `basename $folder` + # fi + #fi + } +fi # Special cd: change folder and set title scd() { @@ -209,7 +211,8 @@ if [ -e "$HOME/apps/python" ]; then fi # Bash specifics -if [ -n "$BASH_VERSION" ]; then +#if [ -n "$BASH_VERSION" ]; then +if [ "$0" = "bash" ]; then # Command prompt if no system-wide custom prompt is available if ! type command_prompt &> /dev/null && [ -e "$HOME/apps/shellprompt/prompt" ]; then . $HOME/apps/shellprompt/prompt |