본문으로 건너뛰기

[2023 ver.] 서버 개발자 mac 장비 설정

· 약 5분
Seokjae Lee
Software engineer

원문: https://doljae.tistory.com/318

2021년에 비슷한 주제의 포스트를 작성했습니다.

 [Mac 장비 지급 후 세팅 방법 정리

21.10.08. 업데이트 Xcode homebrew iterm 폰트 바꾸기 한글 깨짐 해결 투명도 조절 color scheme 수정 oh-my-zsh 설치 테마 변경 플러그인 설치 호스트 이름 가리기 문단 줄바꿈 자주 사용하는 명령어 alias 설정

doljae.tistory.com](https://doljae.tistory.com/195)

이번에 개인 장비를 새로 설정하는 과정을 단계 별로 정리했습니다.

시스템 계정 생성​

전체 이름은 변경 가능하지만 유저 디렉토리 이름은 이후에 변경하기 조금 부담스러울 수 있습니다.

네이밍 컨벤션 및 저의 경험 상 서버에서 많이 사용하고 있는 firstname.lastname 형식으로 설정합니다.

macOS 환경 설정​

화면 모드​

  • 스크롤 막대 보기: 항상

데스크탑 및 Dock​

  • Dock 크기 조절
  • 응용 프로그램 아이콘 속으로 윈도우 최소화: on
  • 자동으로 Dock 가리기와 보기: on
  • Dock에서 최근 사용한 응용 프로그램 보기: off
  • 문서를 열 때 탭 사용: 항상

배터리​

  • 최적화된 배터리 충전: off

키보드​

  • 키 반복 속도: 빠르게
  • 반복 지연 시간: 짧게
  • 🌐 키를 누를 때 실행할 동작 : 안 함
  • 텍스트 입력: 입력 소스: 편집: Caps Lock 키로 ABC 입력 소스 전환: off, 자동으로 대문자 시작: off

키보드 단축키​

  • 입력 소스: 입력 메뉴에서 다음 소스 선택: off
  • Caps Lock 키로 ABC 입력 소스 전환: off
  • 기능 키: F1, F2 등의 키를 표준 기능 키로 사용: on

트랙패드​

  • 클릭: 세게
  • 탭하여 클릭하기: on

터미널​

독 애니메이션 모두 삭제

defaults write com.apple.dock autohide -bool true && defaults write com.apple.dock autohide-delay -float 0 && defaults write com.apple.dock autohide-time-modifier -float 0 && killall Dock

스크린샷 기본 저장 경로 수정

defaults write com.apple.screencapture location ~/screenshots && mkdir ~/screenshots

스크린샷 그림자 제거

defaults write com.apple.screencapture disable-shadow -bool true

런치패드 정렬

defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock

Finder​

  • 설정: 사이드바: home 디렉토리 추가
  • 고급: 모든 파일 확장자 보기: on
  • 보기: 탭 막대, 경로 막대, 상태 막대: on
  • 보기옵션: 크기 추가

Homebrew​

homebrew 설치

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
From https://github.com/Homebrew/brew
* [new tag] 4.0.29 -> 4.0.29
HEAD is now at aa74840dc Merge pull request #15729 from dduugg/inreplace-sig
Warning: /opt/homebrew/bin is not in your PATH.
Instructions on how to configure your shell for Homebrew
can be found in the 'Next steps' section below.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (nor will any be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/{홈 디렉터리 이름}/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
https://docs.brew.sh

Next steps 아래의 커맨들을 ~/ 디렉토리에서 실행

(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/{home 디렉터리 이름}/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

Terminal(iTerm2)​

brew install --cask iterm2

이후 터미널 대신 iterm2를 사용

Preferernce 

  • Colors: Brogrammer
  • Text: Cursor: Vertical bar
  • Unicode normalization form: NFC
  • Font: size: 15
  • Window: Transarency: 15

omz 설치

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

omz 플러그인

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

3. autojump

brew install autojump

.zshrc의 필요한 부분을 아래 설정으로 대치 or 추가

# kubeconfig, 필요한 경우 주석 해제
# export KUBECONFIG=$HOME/.kube/CONFIG_ONE:$HOME/.kube/CONFIG_TWO

# asdf
# . /opt/homebrew/opt/asdf/libexec/asdf.sh

ZSH_THEME="agnoster"

plugins=(git zsh-autosuggestions zsh-syntax-highlighting history dirhistory copypath web-search autojump kubectl kube-ps1 asdf)

# For autojump plugin
[ -f /opt/homebrew/etc/profile.d/autojump.sh ] && . /opt/homebrew/etc/profile.d/autojump.sh

# prompt 정리
prompt_context() {
if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
prompt_segment black default "%(!.%{%F{yellow}%}.)😎"
fi
}

prompt_newline() {
if [[ -n $CURRENT_BG ]]; then
echo -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR
%{%k%F{blue}%}$SEGMENT_SEPARATOR"
else
echo -n "%{%k%}"
fi

echo -n "%{%f%}"
CURRENT_BG=''
}

# Main prompt
build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
prompt_context
prompt_dir
prompt_git
prompt_hg
prompt_newline
prompt_end
}

# alias
alias fetchAll="find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} fetch --all --recurse-submodules \;"

alias brews="brew update && brew outdated && brew upgrade && brew upgrade --cask && omz update"

alias k="kubectl"

(25.01.01) 테마는 powerlevel10k로 변경

 [GitHub - romkatv/powerlevel10k: A Zsh theme

A Zsh theme. Contribute to romkatv/powerlevel10k development by creating an account on GitHub.

github.com](https://github.com/romkatv/powerlevel10k)

필요한 애플리케이션​

Homebrew​

~ ❯ brew list 21:43:30
==> Formulae
asdf hey oniguruma
autoconf htop openssl@3
autojump httpie python@3.13
automake jq readline
ca-certificates libtool sqlite
certifi libyaml unixodbc
coreutils m4 xz
gmp mpdecimal yarn
go ncp-iam-authenticator
helm ncurses

==> Casks
aldente iterm2 rectangle
chatgpt itsycal scroll-reverser
coconutbattery jetbrains-toolbox slack
discord karabiner-elements stats
google-chrome maccy visual-studio-code
hiddenbar obsidian

AppStore​

  • 메신저
  • Bear
  • RunCat
  • Pages, Numbers, Keynote, iMovie

기타​

그 이외​

서체​

karabiner 설정​

  • right command: f17
  • f17을 macOS 입력 소스 변경 키로 설정

한글 백틱 활성화​

mkdir -p ~/Library/KeyBindings
vi ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"₩" = ("insertText:", "`");
}

Java​

아래 중 택 1

  • jenv
  • sdkman
  • asdf
  • IDE로 다운로드 후 관리

키체인 접근​

  • 로그인: Github personal access token 등록