# zsh prompt 설정 툴로 oh-my-zsh, prezto 를 사용했는데 좀 올드해서 starship, oh-my-posh 을 메인으로 사용하기로 했다.
# starship/oh-my-posh 은 brew 로 쉽게 설치 할 수 있다.
brew install starship oh-my-posh
# starship/oh-my-posh 은 json(or toml)설정만 수정하면 재시작 없이 적용된다.
# toml은 주석을 추가할 수 있어 json 보단 toml 이 사용하기 좋다.
# oh-my-posh 는 다음과 같이 json -> toml 로 변경해서 사용하면 된다.
oh-my-posh config export --config ysoftman.omp.json --format toml -o ysoftman.omp.toml
# 설정에 따른 프롬프트 화면이다.
1. oh-my-zsh > bira theme + kube_ps1
2. prezto > sorin theme + kube+ps1 + time/elapsed/path-color등 커스터마이징 스크립트 추가
3. starship > catppuccin-powerline + kubernetes, golang, rust, python 등 포맷 추가
4. oh-my-posh > montys + 색상/아이콘 수정 + kubectl, golang, rust, python 등 타입 추가
# starship 은 python 디렉토리에서 버전이 표시될 때 좀 느리고 elapsed 포맷은 없다.
# oh-my-posh 는 elapsed(executiontime)이 있어 좋다.
# 참고로 prezto 외에는 별도로 다음 기능을 더 설치해야 한다.
# 자동 완성: 커맨드 입력시 탭 누르면 완성한다.
# 자동 제안: 히스토리를 바탕으로 현재 문자로 시작하는 적절한 완성된 문장을 흐릿한게 표시한다.
# 구문 하이라이팅: 입력된 구문이 맞다면 녹색으롶 표시한다.
git clone https://github.com/zsh-users/zsh-completions.git ~/.zsh/zsh-completions
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.zsh/zsh-syntax-highlighting
fpath=($HOME/.zsh/zsh-completions/src $fpath)
source "$HOME/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
source "$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
# prezto completion 은 탭과 방향키로 선택할 수 있어 prezto가 설치되어 있다면 사용하는게 좋다.
if [ -f "$HOME/.zprezto/modules/completion/init.zsh" ]; then
source "$HOME/.zprezto/modules/completion/init.zsh"
fi
comments:
댓글 쓰기