LoginSignup
54
53

More than 3 years have passed since last update.

pecoが便利過ぎる件

Last updated at Posted at 2014-07-05

pecoとは

説明するより、Demoをみてもらったほうが早いです。

Peco Demo

使いかた次第で何でも出来そう。

個人的な使い方

  1. 管理しているRepositoryの一覧を表示

    $ find ~/repos -mindepth 1 -name "*" -type d | grep -v "\/." | peco

  2. 実行コマンドの絞込
    $ history | peco

  3. 管理しているRepositoryへcd
    $ cd $(find ~/example ~/hoge -mindepth 1 -name "*" -type d | grep -v "\/." | peco)

  4. Repositoryのブランチを絞り込んでチェックアウト
    $ git checkout $(git branch | peco)

3, 4に関してはよく使うのでaliasに設定しています。

zshrc
$ vim ~/.zshrc

.....
.....


alias repos='cd $( find ~/example ~/hoge -maxdepth 3 -mindepth 1 -name "*" -type d | grep -v "\/\." | peco )'
  • 実行
    $ repos
~/.gitconfig
[alias]
    detect-branches = !git checkout $(git branch | peco)

ぜひお試しあれ。

参考

peco(Simplistic interactive filtering tool)を作った話

54
53
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
54
53