Update log

  • 2018-05-20 Mac Powerline Installation permission problem

One, foreword

ITerm2 is the most useful terminal tool on the MAC, and it’s free. ITerm2 is a tMUX that is configured out of the box, with features such as label color change and intelligent selection. Git, CocoaPods, Homebrew, Hexo, etc.

Second, the directory

  • Download and install iTerm 2
  • Install the powerline
  • Oh – my – ZSH installation
  • Install font library fonts
  • Import the color matching
  • Theme Settings
  • Added command highlighting effect ZSH -syntax-highlighting
  • shortcuts
  • Problem solving

Three, download and installiTerm 2

  • GitHub

Install powerline

PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIP sudo easy_install PIPCopy the code

Install OH-my-ZSH

curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
Copy the code

Install font libraryfonts

// Clone the font library to local Gitclonehttps://github.com/powerline/fonts.git / / install the fontcd fonts
./install.sh
Copy the code

Output after successful installation:

➜ fonts git:(master)./install.sh Copying fonts... Powerline fonts installed to /Users/WENBO/Library/FontsCopy the code

Seven, import matching colors

  • First go to GitHub and download Solarized
git clone https://github.com/altercation/solarized
Copy the code
  • Decompress the ZIP filesolarized/iterm2-colors-solarizedFile, double clickSolarized Dark.itermcolorsandSolarized Light.itermcolorsInstall and import, as shown in the following figure
  • Go to system preferences,profiles->ColorsSelect the color scheme you just imported

Eight, theme setting

  • To use Agnoster, download and install:
// Clone the theme to local gitcloneHTTP: / / https://github.com/fcamblor/oh-my-zsh-agnoster-fcamblor / / install the themecd oh-my-zsh-agnoster-fcamblor
./install
Copy the code
  • After the installation is successful, edit the **~/.zshrc file and change the ZSH_THEME to agnoster**
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="agnoster"
Copy the code

Add command highlighting effectzsh-syntax-highlighting

  • The download file
// Clone the project to local gitclone git://github.com/zsh-users/zsh-syntax-highlighting.git
Copy the code
  • Edit the **.zshrc** file and add the following at the end
source /Users/WENBO/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
plugins=(zsh-syntax-highlighting)
Copy the code

Pay attention to

/Users/WENBO is where the *.zshrc file is locatedCopy the code
  • After successful setting, the effect is as follows:

10. Shortcut keys

I just installed it myself, so write it down.

instructions shortcuts
The new label command + t
A closing tag command + w
Switching between Command + digit Command + left and right arrow keys
Switch the full screen command + enter
To find the command +f
Vertical split screen command + d
Horizontal split screen command + shift + d
Switch the screen Command + option + arrow key
View History Command command + ;
View clipboard history command + shift + h
Clear current line ctrl + u
To the beginning of a line ctrl + a
To the end of each line ctrl + e
Move back CTRL + F/B (equivalent to left and right arrow keys)
Previous command ctrl + p
Search command History ctrl + r
Deletes the character of the current cursor ctrl + d
Deletes the character before the cursor ctrl + h
Delete the word before the cursor ctrl + w
Delete to the end of the text ctrl + k
Swap text at the cursor ctrl + t
CLS 1 command + r
CLS 2 ctrl + l

11. Problem solving

  • Brew Link Python reported an error
sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks
Copy the code

After execution, the link is successful

brew link python
Copy the code
  • Error “Permission denied” when installing powerline, python was not installed
brew install python
Copy the code
  • Command display? As shown below:

    Solution: EnterPreference->Profiles->Text, perform the following configuration:

  • The following error occurs when powerline is installed on the Mac

    Solutions:

pip install powerline-status --user -U
Copy the code

Xii. Conclusion

I found this terminal tool on the nuggets, and I usually use terminal tools, so I tried to install this software on my MAC. There were still some problems during the installation process, but they were solved in the end. If you also like terminal command operation, you can try DIY terminal style you like oh.

Refer to the article

  • ITerm 2 && Oh My Zsh
  • Mac Terminal iTerm2 configuration