A beautiful and colourful coding UI can make us happy.
- For Shell,
Life is short, I am ZSHer
. - For Terminal, I chosen
iTerm 2
, instead ofTerminal
of Mac.
Below is my iTerm 2
UI.
iTerm 2
iTerm 2: Download
Download iTerm 2
from official site, unzip the ZIP file and put the iTerm 2
application to your preferred directory of your Mac, recommend store iTerm 2
application to directory /Application
.
Transparency setting for iTerm 2
I like transparent UI in Terminal, so in this setup, setting transparency for iTerm 2.
- Open
iTerm 2
. - Open
Preferences
ofiTerm 2
:- Click
iTerm
->Preferences...
atmenu bar
or - Press shortcut keys
Command + ,
.
- Click
- Tap
Profile
inPreferences
. - Select your preferred
Profile
at the left list view, the user profile list. - Change
Window Appearance
->Transparency
as you prefer the transparency by scrolling the bar.
Install oh-my-zsh
The Shell ZSH
is better than Bash
, and in Mac, the default Shell is Bash
.
Installing oh-my-zsh
, the installer will change the Shell from Bash
to ZSH
, and maybe the installation will ask you to input ROOT
's password for the Shell
changing, as change Shell
need ROOT
permission.
Enter the command below in iTerm 2
or Terminal
to install oh-my-zsh
:
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
Install Powerline
For display Non-ASCII
characters, we need to install Powerline
.
From official site of Powerline
, to install Powerline
just command run below:
pip install powerline-status
If no pip
installed, you need to install pip
first, the installation command is:
sudo easy_install pip
Fonts download and install: Powerline Fonts
- Download the project from
Github
and unzip it. - Change directory to the directory just unzip �at step 1.
- Run
./install.sh
to install allPowerline Fonts
.
After the installation completed, all Powerline Fonts
were installed to directory
/Users/<Your Home Directory>/Library/Fonts
and in iTerm 2
or Terminal
, message can be saw:
All Powerline fonts installed to /User/<Your Home Directory>/Library/Fonts
Fonts Setting for iTerm 2: Regular Font
, Non-ASCII Font
After Powerline Fonts
installed, we can setting fonts to iTerm 2
.
As mention above, Poweline Fonts
is the solution for displaying Non-ASCII
character in iTerm 2
or Terminal
correctly, so I keep Regular Font
default setting and set Non-ASCII Font
to font Inconsolata for Powerline
with 14pt
.
- Open "Preferences" of
iTerm 2
. - Goto
Profile
->Text
, you will findRegular Font
andNon-ASCII Font
settings. - Click
Change Font
button in sectionNon-ASCII Font
. - Select fonts
Inconsolata for Powerline
and select the font size to14pt
.
Colour Scheme installation for iTerm 2: Solarized
- Download Solarized theme from Github, unzip it.
- Change directory to the upzip project folder and change directory to folder
iterm2-colors-solarized
. - Double click the theme installation file to install the colour scheme for
iTerm 2
:Solarized Dark.itermcolors
,Solarized Light.itermcolors
.
Colour Scheme Setting for iTerm 2
After Solarized
colour scheme installed, now can setup Solarized
scheme to iTerm 2
.
I like the dark style as the UI is not too sharp.
- Open
Preferences
ofiTerm 2
. - Goto
Profile
->Colors
. - Click dropdown menu
Load Presets...
, and selectSolarized Dark
.
Install theme Cobalt2
Why Cobalt2
and not Agnoster
?
Agnoster
theme, before prompt
, display username
, hostname
, it is long.
Cobalt2
theme is hide username
, hostname
, so looks shorter for prompt
.
Though can modify "Agnoster" configuration to hide username
and hostname
, stupid I chosen to install others theme.
- Download
Cobalt2
project from Github, unzip it. - Copy
Cobalt2
project filecobalt2.zsh-theme
tooh-my-zsh
theme folder, the folder path is:
~/.oh-my-zsh/themes/
- Setting
ZSH
theme toCobalt2
, openZSH
setting file:
vim ~/.zshrc
. - Change the theme setting to
Cobalt2
, change the value of variableZSH_THEME
tocobalt2
.
ZSH_THEME=cobalt2
.
After ZSH
theme set, run source
to make the ZSH
environment setting to activate:
source ~/.zshrc
Now you can check the iTerm 2 displaying in colourful, looks good.
Install Syntax Highlight: ZSH Syntax Highlighting
Syntax highlighting is display entering command in GREEN colour if it is correct
, otherwise in RED if it is incorrect
.
- Change directory to
.zshrc
directory.
Warm reminder, file.zshrc
directory is current login user's home directory, you can change directory to your home directory bycd
directory. - Run
git clone
command to cloneZSH-Syntax-Highlighting
project to the directory.
git clone git://github.com/zsh-users/zsh-syntax-highlighting.git
- Open
.zshrc
, and add the context below to the end of.zshrc
:
source XXX/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
plugins=(zsh-syntax-highlighting)
please note that,XXX
=Directory
of.zshrc
.
Save and quit.zshrc
with:wq
- Source
.zshrc
:
source ~/.zshrc
Problem:
- Actually, one thing in Solarized scheme is trouble me, it is display the syntax of VIM is bad, it looks that no syntax highlighting for variables, value, etc., please check screenshot below.
Update (Mar -12 -2016)
Use Cobalt2
colour scheme can display VIM
in colour.
- Download Cobalt2 project for
iTerm 2
fromGithub
. - Double click
Cobalt2
project filecobalt2.itermcolors
to installCobalt2
scheme. - Change
iTerm 2
colour scheme toCobalt2
.
网友评论