LoginSignup
17
17

More than 5 years have passed since last update.

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

Last updated at Posted at 2014-06-23

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

17
17
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
17