본문 바로가기

시스템/Macos

터미널 iTerm2 , oh-my-zsh 설정

HomeBrew

https://brew.sh/index_ko

 

Homebrew

The Missing Package Manager for macOS (or Linux).

brew.sh

 

> /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

 

zsh 이 아닌 경우 교체

> brew install zsh

기본쉘 변경
> chsh -s $(which zsh)

 

git, curl 등 설치 : 테마와 색상 다운로드시 필요하므로 설치되어 있지 않은 경우 설치한다

> brew install git
> brew install curl

 

iTerm2

https://www.iterm2.com/downloads.html

 

Downloads - iTerm2 - macOS Terminal Replacement

 

iterm2.com

위에서 다운로드하거나 brew 로 설치

> brew install iterm2

 

iTerm2 Color Schemes

Iterm Themes - Color Schemes and Themes for Iterm2 (iterm2colorschemes.com)

 

Iterm Themes - Color Schemes and Themes for Iterm2

 

iterm2colorschemes.com

색상 링크 복사 후 다운로드

예) dracula+

curl -LO https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Dracula%2B.itermcolors

iTerm2 설정에서 Profiles > Colors > Color Presets 에서 위 파일 선택

 

 

oh-my-zsh

Oh My Zsh - a delightful & open source framework for Zsh

 

Oh My Zsh - a delightful & open source framework for Zsh

Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration. It comes bundled with several helpful functions, helpers, plugins, themes, and a few things that make you shout... OH MY ZSH!

ohmyz.sh

> sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

 

 

테마

Themes · ohmyzsh/ohmyzsh Wiki · GitHub

 

Themes

🙃 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

원하는 테마를 .zshrc 의 ZSH_THEME="테마" 에 설정하면 된다.

 

 

powerlevel10k 테마

GitHub - romkatv/powerlevel10k: A Zsh theme

 

GitHub - romkatv/powerlevel10k: A Zsh theme

A Zsh theme. Contribute to romkatv/powerlevel10k development by creating an account on GitHub.

github.com

 

많이들 쓰는 테마긴 한데... 

> git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

 

~/.zshrc 파일을 열어서 ZSH_THEME="powerlevel10k/powerlevel10k" 수정 및 반영

> vim ~/.zshrc

> source ~/.zshrc

 

 

터미널 재시작하면 여러 가지 설정 진행.

설정 완료 후 다시 설정

> p10k configure

참고) powerlevel10k 의 경우 특정 아이콘들이 포함된 Nerd Fonts 기반의 'MesloLGS NF' 폰트가 사용되므로, vscode 의 콘솔화면 등에서 아이콘이 깨지면 해당 폰트로 맞춰줘야 정상 출력됨

 

제거

rc 내 관련 항목 확인, 제거

> grep -E 'p10k|powerlevel10k' ~/.zshrc ~/.zpreztorc ~/.zimrc 2>/dev/null

> rm -f ~/.p10k.zsh
> rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

 

zsh 재시작 후 캐시 제거

> rm -rf -- "${XDG_CACHE_HOME:-$HOME/.cache}"/p10k-*(N) "${XDG_CACHE_HOME:-$HOME/.cache}"/gitstatus

'시스템 > Macos' 카테고리의 다른 글

rename 을 사용한 파일명 변경  (0) 2023.07.24