17
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

posted at

updated at

Organization

[小ネタ]pecoでbundler管理下にあるgemのディレクトリに移動する

peco/pecoのwikiにそれっぽいのが書いてあるのだが、例みたいに別のコマンド作って噛まさなくてもzshだけで行けそうだったので、自分なりに設定書いてみた。

function cdgem() {
  local gem_name=$(bundle list | sed -e 's/^ *\* *//g' | peco | cut -d \  -f 1)
  if [ -n "$gem_name" ]; then
    local gem_dir=$(bundle show ${gem_name})
    echo "cd to ${gem_dir}"
    cd ${gem_dir}
  fi
}

動作イメージ
http://quick.as/lxxjhxx6

Register as a new user and use Qiita more conveniently

  1. You can follow users and tags
  2. you can stock useful information
  3. You can make editorial suggestions for articles
What you can do with signing up
17
Help us understand the problem. What are the problem?