코딩과로그

zsh 자동명령어 보여주기 본문

Linux/Terminal

zsh 자동명령어 보여주기

피리음 2023. 5. 3. 04:33

https://github.com/marlonrichert/zsh-autocomplete

 

GitHub - marlonrichert/zsh-autocomplete: 🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocomplet

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion. - GitHub - marlonrichert/zsh-autocomplete: 🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-y...

github.com

 

# Download Znap, if it's not there yet.
[[ -r ~/Repos/znap/znap.zsh ]] ||
    git clone --depth 1 -- \
        https://github.com/marlonrichert/zsh-snap.git ~/Repos/znap
source ~/Repos/znap/znap.zsh  # Start Znap

znap source marlonrichert/zsh-autocomplete

# https://github.com/marlonrichert/zsh-autocomplete#reset-history-key-bindings-to-zsh-default
# don't use zsh-autocomplete's up key
() {
   local -a prefix=( '\e'{\[,O} )
   local -a up=( ${^prefix}A ) down=( ${^prefix}B )
   local key=
   for key in $up[@]; do
      bindkey "$key" up-line-or-history
   done
}