Ubuntu에서 zsh와 homebrew를 설치하면서 같이 설치했다.
Windows Terminal과 Nerd Font, oh-my-zsh와 같이 사용하니 터미널이 아주 화사해졌다.
(집은 인테리어 문제로 시멘트 나오고 물에 젖은 바닥 등 엉망인데... 컴퓨터 터미널만 화사하니...)
zsh-syntax-highlighting 은 zsh 쉘에 대한 구문 강조 기능을 제공함.
명령어, 인자 등의 구문 요소를 강조 표시함.
brew로 설치하기
oh-my-zsh에서 git을 이용한 설치가 아닌 brew를 사용한 설치는 다음과 같음.
다음의 명령어를 실행하면 설치가 이루어진다.
brew install zsh-syntax-highlighting
이후 ~/.zshrc 파일에 다음을 추가해준다.
source /home/linuxbrew/.linuxbrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
macOS인 경우엔 다음과 같음.
source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
이후 명령어에 색깔이 들어가기 시작했다.

oh-my-zsh에서 git을 이용한 설치
다음은 git clone으로 oh-my-zsh의 플러그인으로 설치하는 방법임.
# 다운로드 및 oh-my-zsh 플러그인 위치에 설치.
cd ~/.oh-my-zsh/plugins
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
# .zshrc 마지막 라인에 설정 적용
# 사실 다음에 나오는
# .zshrc에서 oh-my-zsh 의 plugin에서만 처리를 해줘도 되고
# 이 부분은 생략해도 됨.
echo "source $(pwd)/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> $HOME/.zshrc
# .zshrc의 plugins 부분에 추가해주기
vi ~/.zshrc
plugins=(git ... zsh-syntax-highlighting)
맨 마지막의 plugins의 설정에서 ... 는 기존의 설치된 plugins 들이 기재되어있는 곳을 표시하기위해 사용됨.
더 읽어보면 좋은 자료들
zsh-syntax-highlighting 관련 설명자료:
https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/INSTALL.md
zsh-syntax-highlighting/INSTALL.md at master · zsh-users/zsh-syntax-highlighting
Fish shell like syntax highlighting for Zsh. Contribute to zsh-users/zsh-syntax-highlighting development by creating an account on GitHub.
github.com
2023.09.05 - [Linux] - [Linux] homebrew 설치하기 (Ubuntu)
[Linux] homebrew 설치하기 (Ubuntu)
Homebrew는 Max Howell이 만든 패키지 관리자 (Debian 계열 linux의 apt-get 또는 Windows 의 winget과 비슷)임.macOS 용 으로 2009년 ruby로 개발됨.사실상 macOS에서는 표준 패키지 관리자임.최근 들어 linux 및 WSL에서
ds31x.tistory.com
2023.09.08 - [개발환경] - [zsh] zsh-autosuggestions
[zsh] zsh-autosuggestions
zsh에서 history를 기반으로 최근 입력한 명령어를 일종의 미리보기 형태로 추천해주는 기능을 제공한다. 방향키를 통해 command를 쉽게 입력할 수 있다. 관련 공식 사이트는 다음과 같음:https://github.
ds31x.tistory.com
'개발환경' 카테고리의 다른 글
| [conda] shell에서 conda 명령어가 제대로 동작하지 않을 때 : conda init (1) | 2023.10.24 |
|---|---|
| [zsh] zsh-autosuggestions (1) | 2023.09.08 |
| [zsh] .profile의 설정을 .zprofile로 ... (2) | 2023.09.08 |
| [Env] Mamba 설치하기. (0) | 2023.08.23 |
| [Env] WSL 기본 명령어 정리. (0) | 2023.08.23 |