タグ

ブックマーク / qiita.com/tutuming (1)

  • zsh + peco-select-histroy でhistoryをユニークにする - Qiita

    update: 同じことをしている方がいて、そちらのほうが優秀なので、下記参照 巷に公開されている peco-select-history だと、同じコマンドの履歴が沢山表示されて不便なので、ユニークに表示されるようにした。 ユニークにしたときに、順番が崩れないようにソートしなおしてる。 function peco-select-history() { BUFFER=$(\history 1 | \ sort -r -k 2 |\ uniq -1 | \ sort -r | \ awk '$1=$1' | \ cut -d" " -f 2- | \ peco --query "$LBUFFER") CURSOR=$#BUFFER zle clear-screen } zle -N peco-select-history bindkey '^r' peco-select-history Re

    zsh + peco-select-histroy でhistoryをユニークにする - Qiita
    animist
    animist 2017/01/30
  • 1