본문 바로가기

AI_Development/dev

Oh My Zsh 자동 명령어 제안 (Autosuggestion) 설정

터미널에서 이전에 실행했던 명령어가 회색으로 자동 제안되는 기능은 zsh-autosuggestions 플러그인을 사용하면 된다.

1. zsh-autosuggestions 설치

 
git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
 

2. .zshrc에 플러그인 추가

 
plugins=(git zsh-autosuggestions)
 

3. 설정 적용

 
source ~/.zshrc
 

이후 명령어를 입력하면 이전에 사용했던 명령어가 회색으로 자동 제안되며 → 키로 바로 완성할 수 있다.


같이 사용하면 좋은 플러그인

zsh-syntax-highlighting

명령어 문법을 색상으로 표시해 잘못된 명령어를 쉽게 구분할 수 있다.

설치

 
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
 

.zshrc 설정

 
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
 

적용

 
source ~/.zshrc
 

💡 zsh-autosuggestions + zsh-syntax-highlighting 조합은 많은 개발자들이 기본적으로 사용하는 터미널 생산성 플러그인 조합이다. 🚀