상세 컨텐츠

본문 제목

Zsh + Oh-my-zsh 설치 (온라인 및 오프라인)

카테고리 없음

by Keunwoo.LEE 2023. 5. 4. 13:06

본문

반응형

1. Online 설치

Zsh 설치

> yum install zsh

Oh-my-zsh 설치

> curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh

Shell 변경

> chsh -s /bin/zsh

Theme 변경 (가장 많이 사용하는 agnoster 테마)

> vi ~/.zshrc

ZSH_THEME="agnoster"

Prompt 변경 (time 추가)

> vi ~/.zshrc

PROMPT='%{$fg[yellow]%}[%D{%T}] '$PROMPT

적용 : 재접속!!

 

2. Offline 설치

설치파일 다운로드

 - zsh download : https://centos.pkgs.org/

 - oh-my-zsh download : https://github.com/ohmyzsh/ohmyzsh/

 

GitHub - ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 2,100+ contributors) framework for managing your zsh config

🙃 A delightful community-driven (with 2,100+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, pyth...

github.com

설치파일 업로드

 - 위 경로에서 받은 파일을 설치하고자 하는 계정의 홈 디렉토리에 업로드

-rw-r--r-- 1 root root 2267657 May  4 12:35 ohmyzsh-master.zip
-rw-r--r-- 1 root root 2497380 Apr  8  2020 zsh-5.0.2-34.el7_8.2.x86_64.rpm

Zsh 설치

> rpm -ivh zsh-5.0.2-34.el7_8.2.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:zsh-5.0.2-34.el7_8.2             ################################# [100%]

Oh-my-zsh 설치 (홈 디렉토리에서 압축 풀고 디렉토리 이름 변경)

> unzip ohmyzsh-master.zip 

> mv ohmyzsh-master .oh-my-zsh

Shell 변경

> chsh -s /bin/zsh

.zshrc 생성

> cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

Theme 변경 (가장 많이 사용하는 agnoster 테마)

> vi ~/.zshrc

ZSH_THEME="agnoster"

Prompt 변경 (time 추가)

> vi ~/.zshrc

PROMPT='%{$fg[yellow]%}[%D{%T}] '$PROMPT

적용 : 재접속!!

 

3. 다른 계정에 적용

  • ~/.oh-my-zsh 디렉토리와 ~/.zshrc 파일을 원하는 계정의 홈 디렉토리로 copy
  • 사용자 shell 변경 후 재접속

4. 글자가 깨질때...

터미널 프로그램을 이용할때 (SecureCRT 등)

  • agnoster 테마는 특수문자가 사용되는데 이때 windows의 기본 폰트가 특수문자를 지원하지 않아 깨지는 경우가 발생
  • 네이버에서 무료로 배포하는 d2coding 폰트를 설치하여 해결
  • https://github.com/naver/d2codingfont
 

GitHub - naver/d2codingfont: D2 Coding 글꼴

D2 Coding 글꼴. Contribute to naver/d2codingfont development by creating an account on GitHub.

github.com

 

 

반응형

댓글 영역