ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • iTerm을 이용해 터미널 풍성하게 만들기
    Mac의 온도 2023. 6. 28. 19:39

     

    터미널은 편리하지만 사용하는데 있어 기능이 부족하고 다솟 밋밋한 감이 없지 않아 있다.

    이러한 문제점을 해결해 줄 고마운 앱이 바로 iTerm이다.

     

    아래 명령을 이용해  앱을 설치해준다.

    brew install --cask iterm2

     

    설치가 끝난 직후 바로 사용해도 되지만 심미적인 만족도를 위해 나는 몇가지를 더해줄 생각이다.

    우선 zsh-autosuggestions, zsh-syntax-highlighting 두가지를 설치할 예정인데 앞의 것은 자동완성이고 뒤의 것은 글자에 색을 입혀 주요한 부분에 색을 이용해 강조해 주는 패키지다.

    brew install zsh-autosuggestions
    brew install zsh-syntax-highlighting

     

    다음으로는 Oh My Zsh 그리고 Powerlevel10k라는 테마를 설치하려고 한다.

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

     

    설치가 끝나고 처음 받은 테마와 플러그인을 설정 파일에 넣어줘야 인식이 된다.

    open ~/.zshrc

     

    아래는 zshrc 파일 내의 내용인데 강조한 부분을 수정해주면 된다.

     

    # If you come from bash you might have to change your $PATH.
    # export PATH=$HOME/bin:/usr/local/bin:$PATH

    # Path to your oh-my-zsh installation.
    export ZSH="$HOME/.oh-my-zsh"

    # Set name of the theme to load --- if set to "random", it will
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME="powerlevel10k/powerlevel10k"

    # Set list of themes to pick from when loading at random
    # Setting this variable when ZSH_THEME=random will cause zsh to load
    # a theme from this variable instead of looking in $ZSH/themes/
    # If set to an empty array, this variable will have no effect.
    # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

    # Uncomment the following line to use case-sensitive completion.
    # CASE_SENSITIVE="true"

    # Uncomment the following line to use hyphen-insensitive completion.
    # Case-sensitive completion must be off. _ and - will be interchangeable.
    # HYPHEN_INSENSITIVE="true"

    # Uncomment one of the following lines to change the auto-update behavior
    # zstyle ':omz:update' mode disabled  # disable automatic updates
    # zstyle ':omz:update' mode auto      # update automatically without asking
    # zstyle ':omz:update' mode reminder  # just remind me to update when it's time

    # Uncomment the following line to change how often to auto-update (in days).
    # zstyle ':omz:update' frequency 13

    # Uncomment the following line if pasting URLs and other text is messed up.
    # DISABLE_MAGIC_FUNCTIONS="true"

    # Uncomment the following line to disable colors in ls.
    # DISABLE_LS_COLORS="true"

    # Uncomment the following line to disable auto-setting terminal title.
    # DISABLE_AUTO_TITLE="true"

    # Uncomment the following line to enable command auto-correction.
    # ENABLE_CORRECTION="true"

    # Uncomment the following line to display red dots whilst waiting for completion.
    # You can also set it to another string to have that shown instead of the default red dots.
    # e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
    # Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
    # COMPLETION_WAITING_DOTS="true"

    # Uncomment the following line if you want to disable marking untracked files
    # under VCS as dirty. This makes repository status check for large repositories
    # much, much faster.
    # DISABLE_UNTRACKED_FILES_DIRTY="true"

    # Uncomment the following line if you want to change the command execution time
    # stamp shown in the history command output.
    # You can set one of the optional three formats:
    # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
    # or set a custom format using the strftime function format specifications,
    # see 'man strftime' for details.
    # HIST_STAMPS="mm/dd/yyyy"

    # Would you like to use another custom folder than $ZSH/custom?
    # ZSH_CUSTOM=/path/to/new-custom-folder

    # Which plugins would you like to load?
    # Standard plugins can be found in $ZSH/plugins/
    # Custom plugins may be added to $ZSH_CUSTOM/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(
    git
    autojump)

    source $ZSH/oh-my-zsh.sh

    # User configuration

    # export MANPATH="/usr/local/man:$MANPATH"

    # You may need to manually set your language environment
    # export LANG=en_US.UTF-8

    # Preferred editor for local and remote sessions
    # if [[ -n $SSH_CONNECTION ]]; then
    #   export EDITOR='vim'
    # else
    #   export EDITOR='mvim'
    # fi

    # Compilation flags
    # export ARCHFLAGS="-arch x86_64"

    # Set personal aliases, overriding those provided by oh-my-zsh libs,
    # plugins, and themes. Aliases can be placed here, though oh-my-zsh
    # users are encouraged to define aliases within the ZSH_CUSTOM folder.
    # For a full list of active aliases, run `alias`.
    #
    # Example aliases
    # alias zshconfig="mate ~/.zshrc"
    # alias ohmyzsh="mate ~/.oh-my-zsh"

    # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
    [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
    export PATH=/opt/homebrew/bin:$PATH
    export PATH="/opt/homebrew/sbin:$PATH"
    source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
    source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
    DEFAULT_USER=$(whoami)

     

    이후 iTerm을 껐다가 다시 켜면 폰트를 요구하고 설치한 후 안내에 따라 설정을 완료하면 된다.

     

    이제는 iTerm 자체 설정을 할 차례이다.

    사진을 보며 똑같이 설정해도 되고 해본 후 자신의 취향대로 꾸미면 된다.

     

    종료할 때 매번 확인을 받다 보면 스트레스가 이만저만이 아니다.                                   iTerm 상단바 색상을 테마와 일치 시켜준다.

     

                             오른쪽 스크롤바를 숨긴다.                                                           마진값을 줘서 여백을 만들어 좀더 깔끔한 공간구성을 할 수 있다.

     

    모니터 크기에 따라 폰트 크기, 간격을 조절해 가독성을 높힌다.                                               Send Hex Codes: 0x15는 줄 삭제다.

     

    In the Minimal theme...outline be? 위에서 변경한 미니멀 테마에서 아웃라인을 제거한다.

     

    마지막 업데이트로 인해 위 사진처럼 명령줄 그래픽이 깨지는 경우가 생겼는데 이런경우 Setting -> Profiles -> Text 순서로 진입해서 "Use ligatures" 옵션을 체크해주면 해결된다.

    댓글