새소식

Welcome to the tech blog of Junior Backend Developer Myoungji Kim!

Development/Linux

macOS 터미널 개발 환경 세팅 (iterm, oh-my-zsh)

  • -
📝 들어가기 전
맥을 초기화할 때마다 환경 세팅을 기억해내려고 매번 구글링하는 게 귀찮아서,
이번 포스팅을 통해 나만의 세팅을 백업 겸 기록해두려 한다!

📌 homebrew

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

 

📌 iterm2 설치

## 설치
brew install --cask iterm2

 

📌 oh-my-zsh 설치

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

 

 

📌 oh-my-zsh 기능 추가

🔖 테마 설정

# 편집
sudo vim ~/.zshrc

# 수정 후 저장
source ~/.zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:$HOME/.local/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="robbyrussell"

🔖 스펠링 검사

setopt correct

 

스펠링 틀림 감지 및 비슷한 명령어 추천

🔖 zsh-syntax-highlighting (하이라이팅 기능)

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
## 플러그인 추가

# 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
	zsh-syntax-highlighting
)

 

사용 가능, 불가능 커맨드에 따라 다르게 하이라이팅 됨

🔖 zsh-autosuggestions (자동 완성 기능)

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
## 플러그인 추가

# 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
	zsh-syntax-highlighting
	zsh-autosuggestions
)

 

자동 추천 기능 추가

🔖 fd (find 업그레이드 버전)

brew install fd

 

🔖 ripgrep (grep 업그레이드 버전)

brew install ripgrep

 

Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.