Mac efficiency tool and mac Efficiency

Source: Internet
Author: User
Tags install homebrew

Mac efficiency tool and mac Efficiency

Switching directories in the command line is the most common operation. I believe that "cd ls…" is repeated over and over again ......" It will definitely drive you crazy.

Record it to facilitate next system reinstallation. Haha

 

I. oh-my-zsh

Zsh is pre-installed on mac. You only need to set zsh as the local shell. 1. Set zsh to your default shell.
chsh -s /bin/zsh
2. Restart zsh.  3. Enter the following command in the terminal:
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh

 

4. advantages of using oh-my-zsh

4.1. after entering a directory, if git exists, the current branch is automatically displayed (the current git branch is clearly displayed, which is cool) 4.2. more powerful tab completion: When you switch to a directory and double click the tab, it can list all the directories under the current directory, and you can use the keyboard to select the directory to enter. No more frequent ls. 4. 3. more intelligently switch directories. For example, if you want to enter a deep directory,/var/log/nginx/error/lastyear/may/first/Monday, zsh can be used to input cd/v/l/n/e/l/m/f/m, and then press tab to complete the entire path. 4.4. under bash cd-you can switch to the directory you just entered. Under zsh, you can record the 10 directories you recently entered. You only need to enter d and then see the corresponding 0-9 directory, enter a cd-number to enter the corresponding directory. You can also directly enter cd-and then click TAB. You will find 31 directories that have been recently used waiting for you to choose from. Ii. zsh Plug-In ---- autojump1. Note: It records your current location every time you start the command and adds it to its own database. In this way, some directories are added more times than other directories. These directories generally represent your most important directories, and their "weight" increases. This makes the directory jump more convenient. 2. installation:
Brew install autojump (homebrew needs to be installed)

Install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

 

Find plugins = in. zshrc and add

 plugins=(git autojump)

Then add

[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh

[By default, you can run BASIC linux commands ~ ]

Then, in the command line, enter

source ~/.zshrc

Restart, OK ~

Common commands
Pwd // display the current directory ls-la // display hidden files common operations: vim xx.css // edit xx.css file I // after entering the editing status and modifying, Press esc: wq // save and exit
3. If you execute j read, the system will automatically search for directories containing read and jump to the directory with one click ~

 

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.