2018 Update:
In the process of using it, I found that although the theme of agnoster is beautiful, it is not very user-friendly in the actual use process. Personally, the ys theme is more suitable for me.
Change the theme:
1 |
|
1. I recently reinstalled the system, so I reconfigured the terminal to make it more in line with user habits.
The effect is as follows:
It has functions such as syntax highlighting, command line tab completion, automatic prompting, and Git repository status display.
Install
First of all, the iTem2 software we downloaded is more powerful than the terminal that comes with Mac. Download and install directly from the official website http://iterm2.com/ .
configure
Set iTem2 as default terminal:
(Menu bar) iTerm2 -> Make iTerm2 Default Term
Then open the preferences, select Keys, check Show/hide iTerm2 with a system-wide hotkey under Hotkey, and set the hotkey to command+., so that you can open or close the iTerm2 window through the command+. global hotkey, Very convenient.
coloring scheme
I chose solarized , and the effect is not bad. Click on the official website, download, unzip, then open the preferences under iTerm2, click the colors option under profiles, click the Color Presets option in the lower right corner, select import, and import Solarized Dark.itermcolors under the unzipped solarized file .
install oh-my-zsh
github connection: https://github.com/robbyrussell/oh-my-zsh
Install with crul:
1 |
|
or use wget:
1 |
|
theme
After the installation is successful, open the hidden file .zshrc with vim, and modify the theme to agnoster:
1 |
|
Applying this theme requires special font support, otherwise there will be garbled characters, then we configure the font:
1. Use the Meslo font, click the link and click view raw to download the font.
2. Install the fonts to the system font book.
3. Apply the font to iTerm2, I like to set the font size to 14px, which looks comfortable (iTerm -> Preferences -> Profiles -> Text -> Change Font).
4. Re-open the iTerm2 window, and then you can see the effect.
At this point, our terminal looks very good. At this time, we will install other plug-ins to make the terminal look more coquettish.
auto prompt command
When we enter commands, the terminal will automatically prompt you for the commands that you may want to enter next. At this time, you can press → to output these commands, which is very convenient.
The settings are as follows:
1. Clone the repository to the local ~/.oh-my-zsh/custom/plugins path
1 |
|
2. Open the .zshrc file with vim, find the plugin setting command, the default is plugins=(git) , we will change it to
1 |
|
3. Reopen the terminal window.
PS: You may not see the change when you reopen the terminal, maybe your font color is too light, let's make it brighter:
Move to ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions path
1 |
|
Open the zsh-autosuggestions.zsh file with vim and change ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10' (fg=10 works fine on my computer).
syntax highlighting
1. Install using homebrew zsh-syntax-highlighting 插件。
1 |
|
2. Configure the .zshrc file and insert a line.
1 |
|
3. Enter the command.
1 |
|
PS: Install the homebrew package management tool:
1 |
|
*Open the terminal window at this time, your terminal will look as beautiful as mine~
*use it and enjoy it~
ps :
This article is reproduced, just for my own record