After using MAC osx for a year, the Terminal has always been black on a white background, tasteless and less and less fresh, so I had to find a way to stimulate the eye. Otherwise spend so much money to buy you back is to what kind, is it really to study and work?? How is that possible, if you don’t pretend to force someone to buy apple… Okay, well, it’s amateurish to pretend to work or study.

The terminal has the following functions:

  1. Syntax highlighting
  2. Command line TAB completion
  3. Autoprompt
  4. Display Git repository status and other functions
  5. ⌘+ R to clear the code palette quickly, the same effect as terminal type clear ***

Installation steps

1. DownloadiTerm2

2. Decompress the package and install iTerm2

  1. iTerm2 -> Make iTerm2 Default Term

  2. ⌘+. To ⌘+. Open preference, click Keys, check the Hotkey Show/hide iTerm2 with a system-wide Hotkey, set the Hotkey to ⌘+. So that you can ⌘+. Global hotkeys to open or close the iTerm2 window, very handy

    3. Color scheme

    choosesolarizedOpen preference under iTerm2, open colors under Profiles, click Color Presets in the lower right corner, and select Import. Import solarized Dark. Itermcolors from the extracted solarized file

4. Oh – my – ZSH installation

Github:github.com/robbyrussel… You can install curl and wGET using the following two methods: Sh -c ` ` “$(curl – fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)” wget installation: sh -c “”$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)”

5. Configure the theme

After installing OH-my-Zsh successfully

  1. Use vim to edit hidden file. ZSHRC, terminal inputvi ~/.zshrc

    ZSH_THEME="agnoster"Change the ZSH theme to “agnoster”
  2. To apply the “Agnoster” theme, you need special font support, otherwise it will be garbled. Use the Meslo font, click on the link and click on View Raw to download the font
  3. Install fonts into the system font book
  4. Apply the Font iTerm -> Preferences -> Profiles -> Text -> Change Font)

  5. Reopen the iTerm2 window (or open a new iTerm2 window) to see the font effect

6. Automatic prompt and command completion

More powerful command prompt and completion than iTerm2 comes with

  1. Git clone git://github.com/zsh-users/zsh-autosuggestions ~/. Oh-my-zsh /custom/plugins $ZSH_CUSTOM/plugins/zsh-autosuggestions

  2. Use vim to edit the.zshrc file and go to plugins=(git). Let’s change it to plugins=(zsh-autosuggestions git).

PS: When you open the terminal again, you may not see the change, maybe your font color is too light, let’s make it lighter:

  1. cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
  2. Use vim to edit the zsh-autosuggestion. ZSH file and modify itZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'

7. Syntax highlighting

  1. Install zSH-syntax-highlighting plug-ins using Homebrew package Management tools

    brew install zsh-syntax-highlighting

    If homebrew is not already installed on your computer, install it first

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  2. Configure the.zshrc file and insert a line

    source /xxx/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

    (Note: / XXX/represents the path where.zshrc is located)
  3. Load the.zshrc configuration

    source ~/.zshrc
  4. Reopen the iTerm2 window (or open a new iTerm2 window) to see the effect

extension

  1. ITerm2 defaults to dash instead of ZSH:chsh -s /bin/zsh
  2. ITerm2 ZSH switches back to the original dash:chsh -s /bin/bash
  3. uninstalloh my zshFrom the command line, enter:uninstall_oh_my_zsh
  4. Path prefix XX@XX is too long, shorten problem:

    The editor~/.oh-my-zsh/themes/agnoster.zsh-themeThe body file will be insidebuild_promptUnder theprompt_contextFields are added first#Just comment it out

Author: in the name of music this article is original, there are inappropriate places welcome to point out. Reprint please indicate the source.