[macOS Sequoia] 맥북 터미널 꾸미기 - iTerm2와 Oh My Zsh로 개발 환경 개선하기

개발

개발인 ·

07-02

개발자에게 터미널은 필수 도구입니다. 매일 사용하는 도구인 만큼 더 효율적이고 보기 좋게 꾸미는 것은 생산성 향상에 큰 도움이 됩니다. 이번 글에서는 macOS의 기본 터미널을 대체하는 iTerm2와 Oh My Zsh를 사용하여 터미널을 꾸미는 방법을 알아보겠습니다.

목차

  1. Homebrew 설치하기
  2. iTerm2 설치하기
  3. Oh My Zsh 설치하기
  4. 테마 설정하기
  5. 유용한 플러그인 설치하기
  6. 커스텀 설정하기

Homebrew 설치하기

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

iTerm2 설치하기

먼저 Homebrew를 통해 iTerm2를 설치합니다.

brew install --cask iterm2

iTerm2는 macOS의 기본 터미널보다 다음과 같은 장점이 있습니다:

  • 분할 창 지원
  • 검색 기능 강화
  • 자동 완성 기능
  • 커스터마이징 옵션 다양

Oh My Zsh 설치하기

Oh My Zsh는 Zsh 설정을 관리하는 프레임워크입니다. 다음 명령어로 설치합니다:

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

테마 설정하기

Oh My Zsh에서 가장 인기 있는 테마인 Powerlevel10k를 설치해보겠습니다:

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

~/.zshrc 파일을 열어 테마를 설정합니다:

ZSH_THEME="powerlevel10k/powerlevel10k"

유용한 플러그인 설치하기

Oh My Zsh의 강력한 기능 중 하나는 플러그인입니다. 추천 플러그인:

  1. zsh-autosuggestions: 명령어 자동 완성

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  2. zsh-syntax-highlighting: 명령어 구문 강조

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

~/.zshrc 파일에 플러그인을 추가:

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

커스텀 설정하기

1. 색상 테마 설정

iTerm2 > Preferences > Profiles > Colors에서 원하는 색상 프리셋을 선택할 수 있습니다. 추천 프리셋:

  • Solarized Dark
  • Dracula
  • One Dark

2. 폰트 설정

프로그래밍용 폰트 설치:

brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font

3. 유용한 단축키 설정

자주 사용하는 명령어는 alias로 설정하면 편리합니다. ~/.zshrc에 추가:

# 자주 사용하는 명령어 단축키
alias gs='git status'
alias gc='git commit'
alias gl='git log'
alias ll='ls -la'

마무리

이렇게 설정한 터미널은 다음과 같은 장점이 있습니다:

  • 가독성 향상
  • 명령어 입력 효율 증가
  • Git 작업 효율 향상
  • 개발 생산성 전반적 향상

터미널을 이쁘게 꾸미는 것은 단순한 미적 개선을 넘어 실제 개발 생산성 향상으로 이어집니다. 본인의 취향과 작업 스타일에 맞게 커스터마이징하여 더 효율적인 개발 환경을 만들어보세요.

참고 자료