Use ZSH with ITerm2 under Mac to create a shell with git hints

Source: Internet
Author: User
Tags aliases git clone git commands

ITerm2 is an OS X next open source free terminal tool, as a substitute for terminal, compared to it has its own features, such as screen cutting, System hotkey, check copy and so on (below is a brief introduction). The use of zsh, paired with ITerm2, is good for improving productivity. as follows (borrow a picture):

1. Download ITerm2:

http://iterm2.com/

2. Download and use the Oh My zsh:

shell> git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

shell> CP ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.ZSHRC

shell> chsh-s/bin/zsh

( you can also put it in the cloud and copy it out. ZSHRC, creating oh-my-zsh soft links)

shell> ln-s/path/to/cloud/oh-my-zsh/~/.oh-my-zsh    

3. Add a little bit of skill to improve efficiency

"1.iterm2 and friendly staff"

   (1) Command+d: Vertical segmentation; command+shift+d: Horizontal split; (below)

(2) Set Quick call out: Menu bar-->iterm2----Preferences The menu bar, select Keys, check the Multi box, set shortcut keys:

  

(3) in ITerm2, directly with the mouse to select a word or a line of command, then has been copied, do not need to press COMMAND+C.

"2. Configure Git's command aliases"

Setting aliases for common git commands saves you from having to enter a long string of commands each time, and in Git it's easy to implement the alias setting with the git config command, as follows:
shell> git config--global alias.co checkout
shell> git config--global alias.br branch
shell> git config--global alias.ci commit
shell> git config--global alias.st status
shell> git config--global alias.last ' log-l HEAD '

That is: git config-global alias. Full write.
After executing the above command, you can see in the ~/.gitconfig file that these aliases are listed in the alias configuration item.
Note: Editing the ~/.gitconfig file directly also implements the alias setting.

Write to this almost close hand, here is just a point, for zsh and Oh My zsh, we can according to their actual needs to go to specific learning.

Use ZSH with ITerm2 under Mac to create a shell with git hints

Related Article

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.