3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pecoインストール

Last updated at Posted at 2015-08-19

方法1

からバイナリダウンロード

方法2

sudo apt-get install gccgo-go
~/.bashrc
export GOPATH=$HOME/bin/go
export PATH=$PATH:$HOME/bin:$GOPATH/bin
source ~/.bashrc
mkdir -p $GOPATH
cd $GOPATH
go get github.com/peco/peco/cmd/peco

使い方

man man | peco
  • ctrl-n, ctrl-p で上下に移動。

ctrl-r を強化する

~/.bashrc
# scp時、「bind: 警告: 行編集が有効になっていません」対策
if [ -z "$PS1" ]; then
    return;
fi

peco-select-history() {
    declare l=$(HISTTIMEFORMAT= history | sort -k1,1nr | perl -ne 'BEGIN { my @lines = (); } s/^\s*\d+\s*//; $in=$_; if (!(grep {$in eq $_} @lines)) { push(@lines, $in); print $in; }' | peco --query "$READLINE_LINE")
    READLINE_LINE="$l"
    READLINE_POINT=${#l}
}
bind -x '"\C-r": peco-select-history'
  • ctrl-r を押すとpeco-select-historyが実行される。便利
3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?