본문 바로가기
기타

아마존 리눅스 zsh 셋팅

by 앗사비 2023. 1. 26.
728x90

zsh 설치

sudo yum install zsh

 

패스워드 없으면 생성

sudo passwd ec2-user

 

기본 쉘 변경

sudo yum install util-linux-user
chsh -s $(which zsh)

 

터미널 재접속 후 기본 쉘 확인 (처음에 객관식 물어보면 0번)

echo $SHELL

 

oh-my-zsh 설치

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

 

다른 테마로 변경

vim ~/.zshrc
# vscode에서는 code ~/.zshrc

ZSH_THEME 항목 수정 (ex. ZSH_THEME="agnoster")

 

 

테마 리스트
https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

 

플러그인 설치

올바른 커맨드 체크

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


히스토리 기반 추천 

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

 

플러그인 적용

vim ~/.zshrc
# vscode에서는 code ~/.zshrc

plugins=(git vscode zsh-autosuggestions zsh-syntax-highlighting)

 

 

VSCode

터미널 더보기 메뉴에서 기본 터미널을 zsh로 변경

 

참고

https://velog.io/@bluewind8791/aws-ec2-start-setting

https://europani.github.io/aws/2021/11/18/003-zsh.html

https://proni.tistory.com/entry/oh-my-zsh-%ED%85%8C%EB%A7%88-%EB%B0%8F-%EC%9C%A0%EC%9A%A9%ED%95%9C-%ED%94%8C%EB%9F%AC%EA%B7%B8%EC%9D%B8-%EC%A0%95%EB%A6%AC

 

---

 

pip 사용시 WARNING 이 뜨면 zshrc 에서 아래 주석 해제 필요

export PATH=$HOME/bin:/usr/local/bin:$PATH 

728x90