# 맥북프로 m1 초기 개발자 설정
# Homebrew 설치
다운로드: https://brew.sh/index_ko
- 주의: 설치 후 입력하라는 화면상 명령어도 입력해야함.
# D2Coding 폰트 설치
다운로드: https://github.com/naver/d2codingfont
# iTerm2 설치
다운로드: https://iterm2.com
- Profiles > Text > Font를 기본 Monaco에서 D2 Coding으로 변경
- Profiles > Colors > Color Presets를 Pastel (Dark Backgrond) 또는 Tango Dark로 변경
- Window > Columns를 80에서 120로 Rows를 30으로 변경(14인치 맥북 기준입니다.)
# 한/영 전환키 매핑(선택)
M1 오른쪽 Command 키를 한/영 전환키로 맵핑하는 방법 (opens new window)
# Oh-My-Zsh 설치
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- 플러그인 설치
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- ~/.zshrc 파일을 열어서 다음 부분을 찾아서 변경
ZSH_THEME="agnoster"
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
- .zshrc 파일 아래 부분에도 추가
# for (i-search)
stty stop undef
# 프롬프트에서 컴퓨터 이름 삭제
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)$USER"
fi
}
# Git 설정
git config --global user.name "유저네임"
git config --global user.email "이메일@gmail.com"
git config --global core.precomposeunicode true
git config --global core.quotepath false
# java 17 설치
brew install openjdk@17
sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
- .zshrc 파일 내용 수정
# java 17
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
- source .zshrc
# Git 설정
- name과 email은 깃허브 Settings > Name, Public email 이랑 일치해야 함. 불일치시 잔디 안 심어짐.
git config --global user.name ""
git config --global user.email ""
# nvm 설치
brew install nvm
~/.zshrc 파일 수정
# nvm
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
elif [[ $(nvm version) != $(nvm version default) ]]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# mysql 설치
brew install mysql
# mongodb 설치
brew install mongodb-community
brew services start mongodb-community
brew services stop mongodb-community
# 유용한 zsh plugins 설치
brew install zsh-syntax-highlighting
brew install zsh-autosuggestions
brew install autojump
~/.zshrc 파일 수정
# zsh plugins
[ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh
source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh