2 min read

개발자를 위한 Zsh 플러그인 추천 가이드

zsh

Zsh와 Oh My Zsh 조합은 개발자들에게 강력한 쉘 환경을 제공합니다. 아래는 생산성을 높이는 데 유용한 플러그인들의 목록과 설정 방법을 마크다운 형식으로 정리한 가이드입니다.


🔧 Oh My Zsh 설치

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

🔌 필수 플러그인 목록

1. zsh-autosuggestions

  • 기능: 명령어 자동 제안
  • .zshrc 설정: plugins=(... zsh-autosuggestions)

설치:

git clone https://github.com/zsh-users/zsh-autosuggestions \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

2. zsh-syntax-highlighting

  • 기능: 명령어 구문 강조
  • .zshrc 설정: plugins=(... zsh-syntax-highlighting) (마지막에 추가 권장)

설치:

git clone https://github.com/zsh-users/zsh-syntax-highlighting \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

3. fzf + fzf-tab

  • 기능: 퍼지 검색, 탭 자동완성 향상
  • .zshrc 설정: plugins=(... fzf fzf-tab)

설치:

# fzf 설치 (macOS)
brew install fzf

# fzf-tab 설치
git clone https://github.com/Aloxaf/fzf-tab \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-tab

4. z

  • 기능: 자주 가는 디렉토리로 빠른 이동
  • .zshrc 설정: plugins=(... z) (기본 플러그인)

5. extract

  • 기능: 다양한 압축 파일 해제
  • .zshrc 설정: plugins=(... extract) (기본 플러그인)

  • 기능: 입력한 문자열 기반 히스토리 탐색

.zshrc 설정:

plugins=(... history-substring-search)

# 아래 바인딩도 추가
bindkey "^[[A" history-substring-search-up
bindkey "^[[B" history-substring-search-down

7. colored-man-pages

  • 기능: man 페이지 컬러 출력
  • .zshrc 설정: plugins=(... colored-man-pages)

8. alias-finder

  • 기능: 명령어에 대응하는 alias 제안
  • 설치: 기본 포함

.zshrc 설정:

plugins=(... alias-finder)
zstyle ':omz:plugins:alias-finder' autoload yes

9. sudo

  • 기능: 명령어 앞에 sudo 자동 추가 (ESC 두 번)
  • .zshrc 설정: plugins=(... sudo)

🧪 예시 .zshrc 설정

plugins=(
  git
  zsh-autosuggestions
  zsh-syntax-highlighting
  fzf
  fzf-tab
  z
  extract
  history-substring-search
  colored-man-pages
  alias-finder
  sudo
)

source $ZSH/oh-my-zsh.sh

bindkey "^[[A" history-substring-search-up
bindkey "^[[B" history-substring-search-down
zstyle ':omz:plugins:alias-finder' autoload yes