読者です 読者をやめる 読者になる 読者になる

by shigemk2

当面は技術的なことしか書かない

delete duplicated histories in peco/zsh

zsh

peco(w/ oh-my-zsh)

function peco-src () {
  local selected_dir=$(ghq list -p | peco --query "$LBUFFER")
  if [ -n "$selected_dir" ]; then
    BUFFER="cd ${selected_dir}"
    zle accept-line
  fi
  zle clear-screen
}
zle -N peco-src
bindkey '^]' peco-src

zsh

setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_SPACE