"Boldness has genius, power, and magic in it." - Johann Wolfgang von Goethe

Mac

[Mac] 맥북 M1 개발자 답게 터미널(iTemr2) 꾸미기

Toproot 2021. 6. 24. 10:13
728x90
728x90

 

🌈 매일 보는 터미널 눈이 즐겁게 꾸며보자!

  • 기존에 사용하는 터미널은 꾸미는 데에 한계가 있기 때문에,
  • iTerm2 터미널을 설치해주어서 그 터미널을 커스텀 하는 방법입니다.
  • 아래의 방법을 천천히 따라해보세요!

 

🛠 iTerm2 설치

  • 간단하게 사이트에 접속해서 다운로드 받으시면 됩니다.

https://iterm2.com/

 

iTerm2 - macOS Terminal Replacement

iTerm2 by George Nachman. Website by Matthew Freeman, George Nachman, and James A. Rosen. Website updated and optimized by HexBrain

iterm2.com

 

 

🛠 zsh 설치

  • zsh를 설치하기 전에 Homebrew를 먼저 설치해 줍니다.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  • 다운로드 후에, zsh와 커스텀을 위한 oh-my-zsh를 설치해 줍니다.
# zsh install
brew install zsh

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

 

 

 

🌈 전체 컬러 테마 적용하기

  • 사이트에 접속해서 원하는 테마의 코드를 복사합니다.
  • https://iterm2colorschemes.com/
  • 저는 snazzy 테마를 사용해보겠습니다!
 

Iterm Themes - Color Schemes and Themes for Iterm2

iTerm Themes Intro This is a set of color themes for iTerm (aka iTerm2). Screenshots below and in the screenshots directory. Installation Instructions To install: Launch iTerm 2. Get the latest version at iterm2.com Type CMD+i Navigate to Colors tab Click

iterm2colorschemes.com

# curl이 설치되어 있지 않은 경우
brew install curl

# util이라는 이름의 directory를 생성하고 이동
mkdir util && cd util

# snazzy color theme를 download
# 만약 다른 color 테마를 다운로드 할 경우 curl -LO 이후에 해당 URL을 넣으면 됨
curl -LO https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Snazzy.itermcolors

이때 테마가 어디에 저장되었는지 파일경로를 잘 파악하시고,
iTerm2 터미널의 상단에 prefernect를 열어서 profiles > colors를 들어갑니다.
그리고 우측하단에 colorpreset을 누른후 import를 눌러서 해당 테마가 있는 경로로 들어가
테마를 클릭하게 되면 리스트에 나타나게 되는데 그때 테마를 클릭해서 추가해줍니다.

 

 

 

🌈 Theme 변경하기

  • oh-my-zsh의 테마를 바꿔줄 수 있는데,
  • 아래 사이트에 접속해 원하는 테마를 선택합니다.

https://github.com/ohmyzsh/ohmyzsh/tree/master/themes

 

ohmyzsh/ohmyzsh

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

github.com

 

저는 vscode를 활용해서 theme를 'agnoster'로 바꿔보겠습니다.
iTerm2 터미널에서 다음과 같이 입력해주세요.
(code는 vscode로 열기로 vscode에서 설치가능합니다.)

code ~/.zshrc

그러면 vscode에 해당 속성들이 나타나게 되는데 그 중에서
ZSH_THEME를 찾아 괄호안에 테마이름(agnoster)를 입력하시고 저장하시면 됩니다.

 

 

 

✍🏻 폰트 변경

폰트를 바꿔주지 않으면 터미널이 깨지는 현상이 발생하는데,
저는 D2coding 폰트를 설치하여 prefernece > text > font 에서 변경해주겠습니다.

https://github.com/naver/d2codingfont

 

naver/d2codingfont

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

github.com

개인적인 스타일 참고
  • Cursor : Vertical bar
  • Unicode : NFC
  • Font : Bold 14 100 110

 

 

🌈 그 밖의 스타일 적용

적용하실 때 주의할 점은 Vscode 맨 하단에 코드를 작성해주셔야합니다!
Syntax_Highlighting, 이모티콘 추가, 원하는 사용자명 지정

  • 자세한 코드 내용은 다음 블로그를 참고해주세요!

https://ooeunz.tistory.com/21

 

[개발 환경] iTerm2로 터미널 커스텀하기

이번 포스팅에선 Mac에서 사용하는 터미널을 꾸며보도록 하겠습니다. 사실 오래전에 작성한 글이지만, 꾸준하게 조회수가 있는 포스팅이라 좀 더 상세한 내용과 최근에 추가한 커스텀 항목을 추

ooeunz.tistory.com

 

~/.zshrc 전체코드

728x90
728x90