Iterm2
Iterm이란?
맥에서 터미널을 대체할 수 있는 프로그램이다.
터미널의 기능을 사용하면서 좀 더 편리하고 예쁘게 커스터마이징 할 수 있는 장점이 있다.
설치
아래의 링크를 통해 다운로드 하여 설치한다.
iTerm2 - macOS Terminal Replacement
iTerm2 - macOS Terminal Replacement
iTerm2 by George Nachman. Website by Matthew Freeman, George Nachman, and James A. Rosen. Website updated and optimized by HexBrain
iterm2.com
ZSH
bash가 아닌 zsh쉘을 사용하므로 zsh의 설치가 필요하다.
최근의 맥 OS에서는 zsh가 기본적으로 설치되어 있지만 이전 OS에서는 설치되어 있지 않을 수 있다.
설치
homebrew
homebrew는 맥 전용 패키지 관리자이다.
설치해두면 굉장히 편리하기도 하고, brew를 통해 설치를 진행할 것이기 때문에 설치가 되어 있어야 한다.
homebrew가 설치되어 있지 않다면 아래의 명령어를 터미널에 입력해 설치한다.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
zsh
brew의 설치가 되었다면 아래의 명령어를 통해 zsh를 설치해준다.
zsh가 설치되어 있다면 설치할 필요는 없다. (zsh --version
를 통해 버전을 확인)
brew install zsh
oh my zsh
oh my zsh는 zsh의 프레임워크다.
기본 zsh는 그냥 사용하기엔 좀 투박하고 예쁘지 않다. DOS에 색만 추가된 느낌이기도 하고.
oh my zsh는 zsh를 좀 더 편리하고 예쁘게 사용할 수 있게 해주며, 플러그인과 테마를 이용하기 위해선 설치가 필수이다.
아래의 명령어를 이용해 설치한다.
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
zsh 테마 적용
GitHub - ohmyzsh/ohmyzsh: 🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh config
🙃 A delightful community-driven (with 2,000+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, pyth...
github.com
위의 페이지에서 적용하고 싶은 테마를 선택하여 고르면 된다.
골랐다면 아래와 같이 테마를 적용한다.
vim ./zshrc
- vim 을 통해 zshrc파일을 연다.
- zshrc의 파일 안에 ZSH_THEME="robbyrussell” 의 robbyrussell을 내가 적용할 테마의 이름으로 바꾼다.
source ~/.zshrc
- source명령어를 통해 적용
Iterm 테마 적용
- 아래 사이트에서 사용하고자 하는 테마의 소스파일을 저장한다.
Iterm Themes - Color Schemes and Themes for Iterm2
Iterm Themes - Color Schemes and Themes for Iterm2
iTerm Themes Intro This is a set of color themes for iTerm (aka iTerm2). Screenshots below and in the screenshots directory. Installation Instructions To install: Launch iTerm 2. Get the latest version at iterm2.com Type CMD+i Navigate to Colors tab Click
iterm2colorschemes.com
- 저장한 파일 확장자 부분(.txt)를 지운다.
- Iterm2의 환경설정 → profile - colors - color presets... → Import하고 다운받은 파일을 선택
폰트 적용
스킨을 적용한 iterm을 보면 텍스트가 깨지는 것을 볼 수 있는데, 이것을 해결하기 위해 폰트를 변경하는 작업이 필요하다.
사용하고 싶은 폰트를 설치하고 적용하면 되고, 나는 Hack이라는 폰트를 설치했다.
Hack | A typeface designed for source code
Hack | A typeface designed for source code
A Family of Four Faces Hack includes monospaced regular, bold, italic, and bold italic sets to cover all of your syntax highlighting needs.
sourcefoundry.org
- Iterm2의 환경설정 → Profile - Text - Font
- 테마를 설정했던 Colors의 바로 옆 탭에 위치한다.
- 폰트를 설치했다면 목록에 해당 폰트가 보일 것이므로 선택하면 된다.
플러그인
많이 사용되는 플러그인 중 다음 3가지를 사용해보려 한다.
Auto Suggestions
- 이전에 사용했던 명령어를 기억하고 추천해준다.
- 오른쪽 방향키를 누르면 자동으로 완성된다
Syntax Highlighting
- 유효한 명령어, 존재하지 않는 명령어에 따라 색을 다르게 보여준다.
- 위의 Auto Suggestions과 잘 어울리는 플러그인이다.
Autojump
- 방문했던 곳의 폴더명을 통해 바로 이동이 가능하다.
설치
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
brew install autojump
- 위의 명령어로 설치 후 .zshrc에 아래의 내용을 작성한다.
vim ~/.zshrc
plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
autojump
)
source ~/.zshrc
₩ → `
이글의 내용과는 상관없는 내용이지만, 유용한 내용이라 첨부한다.
마크다운 형식을 사용하면서 `를 쓸 일이 많은데, 한글상태에서 `를 입력하게 되면 ₩가 입력된다.
아래의 절차를 통해 한글 입력 상태에서도 `를 입력하게 변경할 수 있다.
- ~/Library 폴더로 이동
- KeyBindings 폴더를 생성
- DefaultkeyBinding.dict 파일에 아래 내용 작성
{ "₩" = ("insertText:", "`"); }
- 재부팅
'Development > 개발환경' 카테고리의 다른 글
Karabiner로 input source 변경하기 (0) | 2022.04.18 |
---|---|
[MAC]Karabiner로 키맵핑하기 (0) | 2022.03.31 |