KO EN

[Window] Set zsh(oh-my-zsh) on Git Bash

by 민갤

ETC /

Download zsh

Download the compressed file via the download link.

Insert zsh settings folder

  1. Disassemble the downloaded zst compressed file.
  2. Release the tar compressed file in the decompressed folder.
  3. Overwrite the etc, user folder in the decompressed folder to the Git installation folder (C:\Program Files\Git).
git_zsh.png

git_zsh.png

Run zsh

zsh

There are a few questions for setting up the basics. Proceed with a careful reading.

after.png

설정 완료 후 화면

oh-my-zsh installation

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
ohmyzsh.png

Set to go to zsh when running Git Bash

~/.bashrc file modification

vi ~/.bashrc
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi

Apply modifications

source ~/.bashrc

Restart Git Bash

Theme Settings

Check the link for the theme type

vi ~/.zshrc
ZSH_THEME="agnoster"
zsh.png

Apply modifications

source ~/.zshrc 

Delete the user name that appears at the prompt

vi ~/.zshrc
prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
  fi
}
source ~/.zshrc 
zsh01.png

Before and after application

Reference

https://wayhome25.github.io/etc/2017/03/12/zsh-alias

https://cyanlh.github.io/Dev-ETC/windows10에서-powershell과-git-bash에-zsh-설치하기

https://doda.tistory.com/entry/Windows-git-bash%EC%97%90-zsh-oh-my-zsh

Author

민갤

민갤

Back-End Developer

꾸잉꾸잉하고 웁니다.

로그인

디코에 오신 것을 환영해요!
전문가들의 수많은 아티클 창고 🤓