티스토리 뷰

728x90
SMALL

https://www.themoderncoder.com/add-git-branch-information-to-your-zsh-prompt/

https://gist.github.com/reinvanoyen/05bcfe95ca9cb5041a4eafd29309ff29

https://gist.github.com/doubleknd26/c4fcd2e65c3397947248878065b644ed

 

vi ~/.zshrc

export NVM_DIR="$HOME/.nvm"
  [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion
eval $(/opt/homebrew/bin/brew shellenv)

function parse_git_branch() {
    git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/[\1]/p'
}

setopt PROMPT_SUBST
export PROMPT='%F{245}%n%f %F{normal}%~%f %F{green}$(parse_git_branch)%f %F{normal}$%f '
728x90
LIST

'개발환경 > mac' 카테고리의 다른 글

맥북에서 백틱키 변경, 한영키 변경하기  (0) 2022.03.13
댓글
공지사항