- Copy history of z.sh to enhancd.log
cat ~/.z | awk -F "|" '{print $1}' >> ~/.enhancd/enhancd.log
- Setup enhancd + peco + shortcut(see config.zsh)
It means that avoid following warning
awk: i/o error occurred while closing /dev/stdin
function peco_select_directory() { | |
local dest=$(tail -r ~/.enhancd/enhancd.log | peco --query "$LBUFFER") | |
if [ -n "${dest}" ]; then | |
BUFFER="cd ${dest}" | |
zle accept-line | |
fi | |
zle clear-screen | |
} | |
zle -N peco_select_directory | |
bindkey '^x;' peco_select_directory |