Published on

MacOS iTerm2

[MacOS] iTerm2

맥북에 기본적으로 설치 된 터미널은 v10.15(카탈리나)이후 부터 zsh 쉘을 기본적으로 사용할 수 있습니다.
하지만, iTerm2를 설치하면 더 다양한 기능과 커스텀을 할 수 있으므로 iTerm2를 설치하여 터미널을 이쁘게 꾸며보겠습니다.

iTerm2 설치

  • itermhomebrew를 통해 검색합니다.
brew search iterm
==> Formulae
term                xterm               dterm               aterm

==> Casks
iterm2
  • 이 중 Casksiterm2를 설치하면 됩니다.
brew install --cask iterm2

기본적인 터미널 커스텀

테마 설정

  • Preferences -> Appearance -> themeMinimal로 변경 (자신이 원하는 걸로 하면 됩니다.)
Preferences Appearance

상태 바 설정

  • Preferences -> Profiles -> Session -> Status bar enabled 체크 -> Configure Status Bar
Profiles Session Status bar enabled
  • 원하는 기능들을 밑으로 드래그 -> 하단의 Auto-Rainbow에서 원하는 색상 입히기
Profiles Session Status bar Configuration
  • 터미널 상단에 보면 이쁘게 기능들이 추가되어 있습니다.
Terminal Status bar

컬러 설정

Github Dark Color Schemes
  • 저장
Save Github Dark Color Schemes
  • .txt 제거 -> .itermcolors 사용 -> 실행
Run Github Dark Color Schemes
  • Profiles -> Colors -> 오른쪽 하단에서 테마 선택
Select Github Dark Color Schemes

oh my zsh

oh my zsh을 설치하면 더 다양하게 터미널을 커스텀 할 수 있습니다.

oh my zsh 설치

oh my zshhomebrew를 통해 설치 할 수 없으므로 공식사이트 에 가서 커맨드를 복사해서 붙여 넣어줍니다.

oh my zsh 공식사이트
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  • 아래와 같이 나오면 정상적으로 설치가 완료된 것 입니다.
oh my zsh 설치 완료 화면

테마 바꾸기

oh my zsh 설치 완료 화면
  1. 위에 적힌대로 git clone을 받습니다.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
  1. .zshrc파일을 열어줍니다.
open ~/.zshrc
  1. ZSH_THEME 부분을 찾아 powerlevel10k/powerlevel10k로 수정 후 저장합니다.
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"

# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in $ZSH/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment one of the following lines to change the auto-update behavior
# zstyle ':omz:update' mode disabled  # disable automatic updates
# zstyle ':omz:update' mode auto      # update automatically without asking
# zstyle ':omz:update' mode reminder  # just remind me to update when it's time

# Uncomment the following line to change how often to auto-update (in days).
# zstyle ':omz:update' frequency 13

# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS="true"

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
  1. 다시 터미널을 실행하면 아래와 같이 나옵니다.

가운데 보이는 부분이 깨져 보이지 않는다면 y 깨져 보인다면 n을 적어줍니다.

powerlevel10k 설정 다이아몬드

이후, 보기에서 원하는 테마를 선택합니다. (제가 선택한 번호를 적어 두었습니다.)

  • 1
powerlevel10k 설정 질문 1
  • 1
powerlevel10k 설정 질문 1
  • 1
powerlevel10k 설정 질문 2
  • 2
powerlevel10k 설정 질문 3
  • 2
powerlevel10k 설정 질문 4
  • 1
powerlevel10k 설정 질문 5
  • 2
powerlevel10k 설정 질문 6
  • 4
powerlevel10k 설정 질문 7
  • 2
powerlevel10k 설정 질문 8
  • 2
powerlevel10k 설정 질문 9
  • 1
powerlevel10k 설정 질문 10
  • n
powerlevel10k 설정 질문 11
  • 1
powerlevel10k 설정 질문 12
  • y
powerlevel10k 설정 질문 13
  • 모든 설정이 끝났습니다. 아래와 같이 이쁘게 커스텀 된걸 볼 수 있습니다.
powerlevel10k 설정 끝

다시 설정 하고 싶다면 p10k configure 커맨드를 입력하면 됩니다.


참고 사이트