]> git.phdru.name Git - dotfiles.git/blobdiff - .shellrc
.shellrc: declare a variable local instead of unsetting it
[dotfiles.git] / .shellrc
index 5975ab3a7f4ab27cd2002f40839f4bc7d4d12c77..f027cc123032170fbbf361827660a1c3eba6cb66 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -121,7 +121,7 @@ if test -n "$BASH_VERSION"; then
    fi
    complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser
 
-   if which pip >/dev/null 2>&1; then
+   if type -p pip >/dev/null 2>&1; then
       eval "`pip completion --bash`"
       rm -rf /tmp/pip_build_"$USER"
    fi
@@ -171,13 +171,12 @@ if test -n "$BASH_VERSION"; then
    # list remotes with URLs matching a regexp
    list_remotes() {
       GIT_REMOTES=""
+      local remote
       for remote in `git remote`; do
          if git config --get remote.$remote.url | grep -q "$1"; then
             GIT_REMOTES="$GIT_REMOTES $remote"
          fi
       done
-      remote=""
-      unset remote
    }
 
    # completion for cdremote - list remotes with directories as URLs
@@ -185,7 +184,6 @@ if test -n "$BASH_VERSION"; then
       local cur="${COMP_WORDS[COMP_CWORD]}";
       list_remotes '^\(/\|\.\./\)' # (/ or ../ at the beginning)
       COMPREPLY=(`compgen -W "$GIT_REMOTES" -- "$cur"`)
-      GIT_REMOTES=""
       unset GIT_REMOTES
    }
 
@@ -196,7 +194,6 @@ if test -n "$BASH_VERSION"; then
       local cur="${COMP_WORDS[COMP_CWORD]}";
       list_remotes '^http\(s\)\?://'
       COMPREPLY=(`compgen -W "$GIT_REMOTES" -- "$cur"`)
-      GIT_REMOTES=""
       unset GIT_REMOTES
    }
 
@@ -319,15 +316,15 @@ tmux() {
 }
 
 
-if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then
-   source /usr/local/bin/virtualenvwrapper_lazy.sh
-fi
-
 #if which pyenv >/dev/null 2>&1; then
 #   eval "`pyenv init -`"
 #   eval "`pyenv virtualenv-init -`"
 #fi
 
+if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then
+   source /usr/local/bin/virtualenvwrapper_lazy.sh
+fi
+
 
 X() { startx >> .Xserver.log 2>&1; cyr; }
 x() { exit; }