C.W.K.
Stream
Lesson 06 of 10 · published

Prompt 커스터마이즈

~10 min · prompt, starship, powerlevel10k

Level 0창 구경꾼
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Prompt 를 굳이 만지는 이유

좋은 prompt 는 context 를 알려줘 — 현재 디렉터리, git branch, Python venv, 직전 command 상태 — 네가 묻지 않아도. 작은 사실 세넷이면 하루에 pwd, git status, echo $? 백 번 안 쳐도 돼.

직접 만드는 zsh prompt

setopt PROMPT_SUBST
autoload -U colors && colors
PROMPT='%F{cyan}%n%f@%m %~ %F{red}%(?..[%?] )%f%# '
RPROMPT='%F{8}%*%f'

사용자명 (cyan), host, 현재 디렉터리, exit code (0 아닐 때만 빨강), prompt 글자. 오른쪽: 시계.

Starship — 모던 기본

크로스 shell, 빠름 (Rust), 좋은 기본 설정. 설치:

brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc

git status, 언어 버전, k8s context, AWS profile, command duration 자동 감지. ~/.config/starship.toml 로 커스터마이즈, preset 마다 한 줄 복사 명령 제공.

Powerlevel10k — zsh 전용, 초고속

P10k 의 첫 설정 마법사 (p10k configure) 가 매끄럽고, instant-prompt 기능이 zsh 가 다 로드되기 전에 prompt 를 먼저 띄움. zsh 전용이지만 zsh 사는 사람한텐 환상적.

Async / instant-prompt

Starship 도 P10k 도 정적 부분을 즉시 그리고, git / Python 정보는 비동기로 업데이트. 그래서 화려한 prompt 도 즉각적으로 느껴짐 — 느린 부분이 타이핑을 막지 않으니까.

Code

60 초 안에 Starship 으로·bash
brew install starship
echo 'eval "$(starship init zsh)"' >> ~/.zshrc
exec zsh
# Try a preset
starship preset gruvbox-rainbow -o ~/.config/starship.toml

External links

Exercise

Starship 설치: brew install starship. .zshrc 에 eval 줄 추가. exec zsh 후 git repo 로 cd — branch 정보 나타나는 거 확인. preset 시도: starship preset nerd-font-symbols -o ~/.config/starship.toml.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.