Mac Terminal configuration (item2 + oh-my-zsh + solarized color scheme)

Source: Internet
Author: User
Tags curl install homebrew git clone

Recently re-installed the system, and then reconfigure the terminal to make it more consistent with user habits.

The effect is as follows:

has syntax highlighting, command line tab completion, automatic prompt, display git warehouse status and other functions.

Installation

First of all we downloaded the iTem2 this software, more powerful than the Mac comes with the terminal. Direct official website http://iterm2.com/download and install.

Configuration

Set ITEM2 as the default terminal:

(menu bar) ITerm2 make ITerm2 Default term

Then open the preferences preference, check keys, tick hotkey under Show/hide ITerm2 with a system-wide hotkey, set the hotkey to command+. , so you can go through command+. Global hotkey to open or close the ITerm2 window is very convenient.

Color scheme

I chose the solarized, the effect is good. Click on the official website, download, unzip, and then open the ITerm2 under the Preferences preference, click on the profiles under the Colors option, the bottom right corner of the Color presets option, select Import, import extracted to the solarized file under the S Olarized dark.itermcolors.

Installing OH-MY-ZSH

GitHub Connection: Https://github.com/robbyrussell/oh-my-zsh

To install using Crul:

Sh-c "$ (curl-fssl https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

or use wget:

Sh-c "$ (wget Https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh-O-)"

Theme

After the installation is successful, open the hidden file with vim. ZSHRC, modify the theme to Agnoster:

Zsh_theme= "Agnoster"

Apply this theme requires special font support, otherwise there will be garbled situation, then we configure the font:

1. Using the Meslo font, tap Connect to click View Raw to download the font.

2. Install font to System font book.

3. Apply font to ITerm2, I like to set the font size to 14px, looking comfortable (iTerm, Preferences, Profiles, Text, change font).

4. Reopen the ITerm2 window and you will see the effect.

At this point our terminal looks pretty good, so let's install other plugins to make the terminal look more attractive.

Automatic prompt command

When we enter the command, the terminal will automatically prompt you to enter the next command, then press → to output these commands, very convenient.

Settings are as follows:

1. Clone the repository to the local ~/.oh-my-zsh/custom/plugins path

git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH _custom/plugins/zsh-autosuggestions

2. Open the. zshrc file with vim, find the plugin settings command, default is plugins= (git), we'll change it to

plugins= (zsh-autosuggestions git)

3. Reopen the terminal window.

PS: When you re-open the terminal may not see the change, maybe your font color is too light, we can change it to some:

Move to the ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions path

CD ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

Open the Zsh-autosuggestions.zsh file with vim, modify the zsh_autosuggest_highlight_style= ' fg=10 ' (fg=10 on my Computer display good).

Syntax highlighting

1. Install with homebrewzsh-syntax-highlighting 插件。

Brew Install Zsh-syntax-highlighting

2. Configure the. zshrc file to insert a row.

Source/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

3. Enter the command.

SOURCE ~/.ZSHRC

PS: Install Homebrew package management tool:

/usr/bin/ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

* When you open the Terminal window, your terminal looks just as beautiful as mine ~

*use it and enjoy it~

Mac Terminal configuration (item2 + oh-my-zsh + solarized color scheme)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.