본문 바로가기
개발환경/Ubuntu

zsh 와 oh-my-zsh로 Shell 사용하기 / 테마 바꾸기

by xangmin 2020. 4. 18.
반응형

ubuntu 18.04에서 설치하기

sudo apt-get install zsh
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/shells:/zsh-users:/zsh-completions/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/shells:zsh-users:zsh-completions.list"
wget -nv https://download.opensuse.org/repositories/shells:zsh-users:zsh-completions/xUbuntu_18.04/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update
sudo apt-get install zsh-completions

zsh-completions 의 경우 만약 다른 버전의 우분투나 다른 리눅스 배포판에 설치하는 경우 아래 링크에 접속해서 해당 배포판의 버전에 따른 설치방법을 참고하여 설치한다.

https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-completions&package=zsh-completions

 

oh-my-zsh 설치

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

 

테마 변경하기

oh-my-zsh의 기본 테마는 robbyrussell이다. 다른 테마로 변경해보자.

vim ~/.zshrc

 

# ZSH_THEME="robbyrussell"
# ZSH_THEME="agnoster"
ZSH_THEME="random"

기본으로 설정되어있는 ZSH_THEME="robbyrusell"을 다른 테마 이름으로 바꿔서 변경한다. 여러가지 테마를 써보고 싶은 경우는 random으로 설정한 후 source ~/.zshrc를 입력할 때 마다 새로운 테마로 새로고침 된다.

 

플러그인 설정하기 [zsh-syntax-highlighting / zsh-autosuggestions]

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

# zsh-autosuggestions
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

 설치 후 다시 들어가서 수정한다.

vim ~/.zshrc

 

Before:

plugins=(git)

After:

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

 

 

추가적인 플러그인 설치 및 출처는 아래 링크와 같다.

https://im-nc2u.tistory.com/entry/zsh-%EC%99%80-ohmyzsh-%EB%A1%9C-%ED%84%B0%EB%AF%B8%EB%84%90-%EC%97%85%EA%B7%B8%EB%A0%88%EC%9D%B4%EB%93%9C%ED%95%98%EA%B8%B0?category=816854

 

반응형

댓글