본문 바로가기
IT, PC/Linux

zsh 설치/셋팅하기 - install, setting

by Chan_찬 2023. 3. 13.
728x90

zsh

zsh이 좋은점 : tab 자동완성, 제안(Ctrl + r),  프롬프트

 

install

zsh, oh-my-zsh, zsh-syntax-highlighting

$ sudo apt install zsh && \
chsh -s `which zsh` && \
sudo apt install zsh-syntax-highlighting && \
echo "source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ~/.zshrc && \
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh  

config zsh

edit theme and add plugin

$ vi ~/.zshrc
ZSH_THEME="agnoster"
...
plugins=(
              git
              python
              docker
              pip
              gnu-utils
              colored-man-pages
)

edit zsh prompt

# add at end of bottom
prompt_context() {
  if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then
    prompt_segment black default "%(!.%{%F{yellow}%}.)$HOST@$USER"
  fi
}
728x90
728x90
Buy me a coffeeBuy me a coffee

댓글