See details of the egg you are currently using in pip + peco + $ {your favorite editor}

inspired by: http://qiita.com/udzura/items/53d51af129b400fd2b45

I had the best convenience I was looking for, but I usually write Python, so I made a pip version.


function peco-installed-pip-open() {
  PIP_MODULE=$(pip freeze | peco | sed -e "s/==.\+$//g")
  if [ "$PIP_MODULE" = "" ]; then
    return 1
  fi

  PKG_LOCATION=$(pip show ${PIP_MODULE} | grep '^Location:\s' | sed -e "s/^Location:\s//g")
  if [ "$PKG_LOCATION" = "" ]; then
    return 1
  fi

  PATH_TO_PKG_DIR="${PKG_LOCATION}/${PIP_MODULE}"
  if [ -e ${PATH_TO_PKG_DIR} ]; then
    BUFFER="${EDITOR} ${PATH_TO_PKG_DIR}"
  else
    BUFFER="${EDITOR} ${PATH_TO_PKG_DIR}.py"
  fi
  zle accept-line
}

zle -N peco-installed-pip-open
bindkey '^[;p' peco-installed-pip-open  # Meta-; p

This is safe even on many days.

pip show --files isn't as convenient as the bundle guy, so it's a good fit. Also, I think that if you don't want to zle clear-screen, you should do it appropriately.

Atom project search seems convenient, but for the time being I am vim. For vim people, I think it's convenient to have VimFiler open when you open the directory.

[Codic from peco](http://hachibeechan.hateblo.jp/entry/2014/07/09/peco%E3%81%8B%E3%82%89Codic%E3%82%92%E4%BD% BF% E3% 81% A3% E3% 81% A6% E5% A4% 89% E6% 95% B0% E5% 90% 8D% E3% 81% A8% E3% 81% 8B% E8% 80% 83% I made E3% 81% 88% E3% 82% 8B), but it's quite convenient, so I hope everyone will try peco. That's it.

Recommended Posts

See details of the egg you are currently using in pip + peco + $ {your favorite editor}
Check the type of the variable you are using
How to get the notebook name you are currently using in Google Colab
If you think that the person you put in with pip doesn't work → Maybe you are using python3?
You can see the transition of points in the J League on the graph!
About the development environment you are using
Check the status of your data using pandas_profiling
Let's get notified of the weather in your favorite area from yahoo weather on LINE!