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:
1 |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" |
or use wget:
1 |
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:
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
1 |
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
1 |
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
1 |
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 插件。
1 |
brew install zsh-syntax-highlighting |
2. Configure the. zshrc file to insert a row.
1 |
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting .zsh |
3. Enter the command.
PS: Install Homebrew package management tool:
1 |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
Mac Terminal configuration (item2 + oh-my-zsh + solarized color scheme)