상현에 하루하루
개발자의 하루

내가 사용하는 쉘은? zsh

( 업데이트: )

fish shell을 1년 정도 아주 잘 사용했다. 별다른 플러그인 설치 없이.

  • 자동 제안
  • Awesome 😎 rgb 색상, 테마
  • sane scripting
  • simple setting

맥의 업데이트로 빅서에서 기본 쉘이 zsh로 변경됨에 따라서 기본 쉘을 활용하는 것이 더 좋다고 생각했고 synology shell에서 fish shell을 사용할 수 없어서 계속 마음에 걸려서 zsh의 셋팅을 정리하고 모든 곳에사 사용하려고 zsh로 갈아탄다.

Oh My Zsh 설치

오픈소스 zsh framework

Oh My Zsh는 zsh 구성을 관리하는 프레임 워크

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

Oh My Zsh Theme

나에게 테마는 매우매우 중요하다.

사용할 테마는 powerlevel10k

powerlevel10k

왜 powerlevel10k를 사용하나? 테마관련 기본설정을 자동으로 설정할 수 있어서 선택하였다.

.zshrc에 난잡한 설정을 하지 않아도 된다.

이게 나중에 보면 이해도 안가고 헷갈려서 😅 중요!

설치

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10kCode language: PHP (php)

Set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc

플러그인

Auto jump

autojump 설치

brew install autojump
git clone git://github.com/wting/autojump.gitCode language: PHP (php)

Run the installation script and follow on screen

> cd autojump
> ./install.py

Zsh-autosuggesion

fish shell을 사용하면서 가장 많이 사용했었던 기능이다. 사용했던 명령어지만 기억이 나지 않는다거나 그럴때 유용하게 사용했다.

zsh history를 기반으로 최근에 입력한 명령어를 미리 보여준다. 방향키를 통해 미리보기로 나타난 명령어 라인을 완성할 수있고 tab으로 완전 완성시킬 수도 있다

1. 이 저장소를 복제합니다.
$ZSH_CUSTOOM/plugins (기본값은 ~/.oh-my-zsh/custom/plugins)
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestionsCode language: PHP (php)
2. Oh My Zsh가 로드 할 플러그인 목록에 플러그인을 추가합니다. ~/.zshrc
plugins=([plugins...] zsh-autosuggestions)

zsh-syntax-highlighting

명령어와 미리보기등을 구분하기 쉽게 하이라이팅해주는 플러그인. git이라는 명령어를 gi까지만 타이핑하면 빨간색으로 git이 완성되면 초록색으로 하이라이팅 해준다.

미리보기 또한 회색으로 보여줌

1. 이 저장소를 복제합니다 $ZSH_CUSTOM/plugins(기본값은 ~/.oh-my-zsh/custom/plugins).
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlightingCode language: PHP (php)
2. Oh My Zsh가로드 할 플러그인 목록에 플러그인을 추가합니다 ~/.zshrc
plugins=([plugins...] zsh-syntax-highlighting)